示例#1
0
文件: chrome.py 项目: arturodr/indico
    def eventDetailFooter(cls, obj, vars):
        """
        Add the footer extension for the statistics tracking.
        """
        stats = PluginsHolder().getPluginType('statistics')
        register = StatisticsRegister()

        if not stats.isActive() or not register.hasActivePlugins():
            return False

        key = 'extraFooterContent'
        extension = {}
        tracking = {}

        tracking['trackingActive'] = True
        tracking['trackingHooks'] = register.getAllPluginJSHooks(obj)

        # Build the extension object to be passed to the footer.
        extension['path'] = register.getJSInjectionPath()
        extension['args'] = tracking

        if key not in vars:
            vars[key] = [extension]
        else:
            vars[key].append(extension)
示例#2
0
文件: chrome.py 项目: arturodr/indico
    def materialDownloaded(cls, obj, resource):
        register = StatisticsRegister()
        listeners = register.getAllPluginDownloadListeners()

        for listener in listeners:
            listener.trackDownload(resource)

        return False
示例#3
0
文件: chrome.py 项目: arturodr/indico
 def __init__(self, rh, templateClass, activeTab, params):
     WPConferenceModifBase.__init__(self, rh, rh._conf)
     self._rh = rh
     self._conf = self._rh._conf
     self._register = StatisticsRegister()
     self._plugins = self._register.getAllPlugins(activeOnly=True)
     self._templateClass = templateClass
     self._extraJS = []
     self._activeTabName = activeTab
     self._params = params
     self._tabs = []
     self._tabCtrl = wcomponents.TabControl()
示例#4
0
class RHStatisticsView(RHConferenceModifBase):

    _register = StatisticsRegister()

    def _checkProtection(self):
        if not PluginsHolder().hasPluginType("statistics"):
            raise PluginError(_("Statistics plugin is not active."))

        self._checkSessionUser()

        RHConferenceModifBase._checkProtection(self)

    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)
        self._activeTab = params.pop("tab", 'Piwik')
        self._params = params

    def _process(self):
        return WPStatisticsView(self, WStatisticsView, self._activeTab,
                                self._params).display()
示例#5
0
文件: chrome.py 项目: arturodr/indico
    def fillManagementSideMenu(cls, obj, params={}):
        if obj._conf.canModify(obj._rh._aw):

            if StatisticsRegister().hasActivePlugins():
                params['Statistics'] = wcomponents.SideMenuItem(
                    _('Statistics'), UHConfModifStatistics.getURL(obj._conf))