Ejemplo n.º 1
0
class WConferenceInstantMessaging(WConfDisplayBodyBase):

    _linkname = "instantMessaging"

    def __init__(self, conference, aw):
        self._conf = conference
        self._aw = aw
        self._user = aw.getUser()

    def getVars(self):
        wvars = WTemplated.getVars(self)

        wvars["body_title"] = self._getTitle()
        wvars["Conference"] = self._conf

        try:
            wvars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            wvars["Chatrooms"] = None
        wvars["Links"] = {}
        for cr in wvars["Chatrooms"]:
            wvars["Links"][cr.getId()] = {}
            wvars["Links"][cr.getId()]['custom'] = generateCustomLinks(cr)

        return wvars
Ejemplo n.º 2
0
class WConferenceInstantMessaging(wcomponents.WTemplated):
    def __init__(self, conference, aw):
        self._conf = conference
        self._aw = aw
        self._user = aw.getUser()

    def getVars(self):
        vars = WTemplated.getVars(self)

        vars["Conference"] = self._conf

        try:
            vars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            vars["Chatrooms"] = None
        vars["Links"] = {}
        for cr in vars["Chatrooms"]:
            vars["Links"][cr.getId()] = {}
            vars["Links"][cr.getId()]['custom'] = generateCustomLinks(cr)

        return vars
Ejemplo n.º 3
0
class WConfModifChat(wcomponents.WTemplated):
    def __init__(self, conference, activeTab, tabNames, aw):
        self._conf = conference
        self._activeTab = activeTab
        self._tabNames = tabNames
        self._aw = aw
        self._user = aw.getUser()

    def getVars(self):
        vars = WTemplated.getVars(self)
        vars["Conference"] = self._conf
        try:
            chatrooms = list(DBHelpers.getChatroomList(self._conf))
            vars["Chatrooms"] = fossilize(chatrooms)
            if len(vars['Chatrooms']) is 0:
                vars['Chatrooms'] = None
        except Exception, e:
            vars["Chatrooms"] = None
            chatrooms = {}
        links = {}

        for cr in chatrooms:
            crinfo = links[cr.getId()] = {}
            crinfo['custom'] = generateCustomLinks(cr)
            crinfo['logs'] = generateLogLink(cr, self._conf)

        vars['links'] = links

        vars['DefaultServer'] = PluginFieldsWrapper(
            'InstantMessaging', 'XMPP').getOption('chatServerHost')
        vars["EventDate"] = formatDateTime(
            getAdjustedDate(nowutc(), self._conf))
        vars["User"] = self._user
        vars["tz"] = DisplayTZ(self._aw, self._conf).getDisplayTZ()
        vars["MaterialUrl"] = RHMaterialsShow._uh().getURL(
            self._conf).__str__()
        vars["ShowLogsLink"] = XMPPLogsActivated()

        return vars