Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenaka Moorthi <benaka.moorthi@gmail.com>2013-07-06 03:44:45 +0400
committerBenaka Moorthi <benaka.moorthi@gmail.com>2013-07-06 03:44:45 +0400
commitddd7aac6f2d1e3b1660f38045cab4214a26f2325 (patch)
tree8e49b4362a6a88505d1b790d64a546a719056188 /plugins/SitesManager
parent3a3517e48823a4d7dc521e5a754c51ddbcf5d210 (diff)
Implemented custom event dispatching system for Piwik (replaced event dispatcher lib in libs/Event).
Notes: - New dispatcher can execute callbacks before or after other callbacks. - It is also possible to dispatch events only to a specific set of plugins instead of all plugins. - Moved Piwik::unprefixClass to Piwik_Common::unprefixClass - Added visibility to some event handlers that were missing it. - Allowed two unit tests to fail w/ better diagnostic messages.
Diffstat (limited to 'plugins/SitesManager')
-rw-r--r--plugins/SitesManager/API.php6
-rw-r--r--plugins/SitesManager/SitesManager.php21
2 files changed, 9 insertions, 18 deletions
diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php
index 77fc07d507..fcb5d7fbfe 100644
--- a/plugins/SitesManager/API.php
+++ b/plugins/SitesManager/API.php
@@ -518,7 +518,7 @@ class Piwik_SitesManager_API
Zend_Registry::get('access')->reloadAccess();
$this->postUpdateWebsite($idSite);
- Piwik_PostEvent('SitesManager.addSite', $idSite);
+ Piwik_PostEvent('SitesManager.addSite', array($idSite));
return (int)$idSite;
}
@@ -564,7 +564,7 @@ class Piwik_SitesManager_API
// we do not delete logs here on purpose (you can run these queries on the log_ tables to delete all data)
Piwik_Tracker_Cache::deleteCacheWebsiteAttributes($idSite);
- Piwik_PostEvent('SitesManager.deleteSite', $idSite);
+ Piwik_PostEvent('SitesManager.deleteSite', array($idSite));
}
@@ -1025,7 +1025,7 @@ class Piwik_SitesManager_API
}
$this->postUpdateWebsite($idSite);
- Piwik_PostEvent('SitesManager.updateSite', $idSite);
+ Piwik_PostEvent('SitesManager.updateSite', array($idSite));
}
private function checkAndReturnCommaSeparatedStringList($parameters)
diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php
index b2b5821d0a..81f7c8a60b 100644
--- a/plugins/SitesManager/SitesManager.php
+++ b/plugins/SitesManager/SitesManager.php
@@ -50,41 +50,32 @@ class Piwik_SitesManager extends Piwik_Plugin
/**
* Get CSS files
- *
- * @param Piwik_Event_Notification $notification notification object
*/
- function getCssFiles($notification)
+ public function getCssFiles(&$cssFiles)
{
- $cssFiles = & $notification->getNotificationObject();
-
$cssFiles[] = "plugins/SitesManager/stylesheets/SitesManager.css";
$cssFiles[] = "plugins/Zeitgeist/stylesheets/styles.css";
}
/**
* Get JavaScript files
- *
- * @param Piwik_Event_Notification $notification notification object
*/
- function getJsFiles($notification)
+ public function getJsFiles(&$jsFiles)
{
- $jsFiles = & $notification->getNotificationObject();
-
$jsFiles[] = "plugins/SitesManager/javascripts/SitesManager.js";
}
/**
* Hooks when a website tracker cache is flushed (website updated, cache deleted, or empty cache)
* Will record in the tracker config file all data needed for this website in Tracker.
- *
- * @param Piwik_Event_Notification $notification notification object
+ *
* @return void
*/
- function recordWebsiteDataInCache($notification)
+ public function recordWebsiteDataInCache(&$array, $idSite)
{
- $idSite = (int)$notification->getNotificationInfo();
+ $idSite = (int)$idSite;
+
// add the 'hosts' entry in the website array
- $array =& $notification->getNotificationObject();
$array['hosts'] = $this->getTrackerHosts($idSite);
$website = Piwik_SitesManager_API::getInstance()->getSiteFromId($idSite);