function postLoad() { Piwik_AddAction('template_headerVisitsFrequency', array('Piwik_VisitorInterest', 'headerVisitsFrequency')); Piwik_AddAction('template_footerVisitsFrequency', array('Piwik_VisitorInterest', 'footerVisitsFrequency')); }
function postLoad() { Piwik_AddAction('template_headerUserCountry', array('Piwik_Provider', 'headerUserCountry')); Piwik_AddAction('template_footerUserCountry', array('Piwik_Provider', 'footerUserCountry')); }
function postLoad() { Piwik_AddAction('template_headerMobileDevices', array('Piwik_MobileAnalytics', 'headerMobileDevices')); Piwik_AddAction('template_footerMobileDevices', array('Piwik_MobileAnalytics', 'footerMobileDevices')); }
/** Test no concurrency issues when deleting log data from log_action table. */ public function test_purgeLogData_concurrency() { Piwik_AddAction("LogDataPurger.actionsToKeepInserted.olderThan", array($this, 'addReferenceToUnusedAction')); $this->addLogData(); $purger = Piwik_PrivacyManager_LogDataPurger::make($this->settings, true); $this->unusedIdAction = Piwik_FetchOne("SELECT idaction FROM " . Piwik_Common::prefixTable('log_action') . " WHERE name = ?", array('whatever.com/_40')); $this->assertTrue($this->unusedIdAction); // purge data $purger->purgeData(); // check that actions were purged $this->assertEqual(22, $this->getTableCount('log_action')); // January // check that the unused action still exists $count = Piwik_FetchOne("SELECT COUNT(*) FROM " . Piwik_Common::prefixTable('log_action') . " WHERE idaction = ?", array($this->unusedIdAction)); $this->assertEqual(1, $count); $this->unusedIdAction = null; // so the hook won't get executed twice }
<?php Piwik_AddAction('Menu', 'Piwik_BuildMenu'); static $widgets = array(); function Piwik_GetListWidgets() { global $widgets; return $widgets; } function Piwik_AddWidget($pluginName, $controllerMethodToCall, $widgetTitle) { global $widgets; // get the plugin name from controller $widgets[$pluginName][] = array($widgetTitle, $controllerMethodToCall); }