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)
def materialDownloaded(cls, obj, resource): register = StatisticsRegister() listeners = register.getAllPluginDownloadListeners() for listener in listeners: listener.trackDownload(resource) return False
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()
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()
def fillManagementSideMenu(cls, obj, params={}): if obj._conf.canModify(obj._rh._aw): if StatisticsRegister().hasActivePlugins(): params['Statistics'] = wcomponents.SideMenuItem( _('Statistics'), UHConfModifStatistics.getURL(obj._conf))