diff options
author | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-01-30 04:51:09 +0300 |
---|---|---|
committer | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-01-30 04:51:09 +0300 |
commit | 96eea79c6628c8b36ac8528a892a7ba699bbb194 (patch) | |
tree | dc7907df7d26339598fda423fdc65ae867c3594d /plugins/Referers | |
parent | 190431e3a98cc5512c79891c3dd3519e4810a779 (diff) |
fixes #1122
Diffstat (limited to 'plugins/Referers')
-rw-r--r-- | plugins/Referers/API.php | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/plugins/Referers/API.php b/plugins/Referers/API.php index decd1cbd2f..7e261feff3 100644 --- a/plugins/Referers/API.php +++ b/plugins/Referers/API.php @@ -38,7 +38,7 @@ class Piwik_Referers_API /** * @return Piwik_DataTable */ - protected function getDataTable($name, $idSite, $period, $date, $expanded, $idSubtable = null) + static protected function getDataTable($name, $idSite, $period, $date, $expanded, $idSubtable = null) { Piwik::checkUserHasViewAccess( $idSite ); $archive = Piwik_Archive::build($idSite, $period, $date ); @@ -57,9 +57,9 @@ class Piwik_Referers_API return $dataTable; } - function getRefererType($idSite, $period, $date, $typeReferer = false) + static public function getRefererType($idSite, $period, $date, $typeReferer = false) { - $dataTable = $this->getDataTable('Referers_type', $idSite, $period, $date, $expanded = false); + $dataTable = self::getDataTable('Referers_type', $idSite, $period, $date, $expanded = false); if($typeReferer !== false) { $dataTable->filter('Pattern', array('label', $typeReferer)); @@ -68,97 +68,97 @@ class Piwik_Referers_API return $dataTable; } - function getKeywords($idSite, $period, $date, $expanded = false) + static public function getKeywords($idSite, $period, $date, $expanded = false) { - $dataTable = $this->getDataTable('Referers_searchEngineByKeyword', $idSite, $period, $date, $expanded); + $dataTable = self::getDataTable('Referers_searchEngineByKeyword', $idSite, $period, $date, $expanded); return $dataTable; } - function getSearchEnginesFromKeywordId($idSite, $period, $date, $idSubtable) + static public function getSearchEnginesFromKeywordId($idSite, $period, $date, $idSubtable) { - $dataTable = $this->getDataTable('Referers_searchEngineByKeyword',$idSite, $period, $date, $expanded = false, $idSubtable); + $dataTable = self::getDataTable('Referers_searchEngineByKeyword',$idSite, $period, $date, $expanded = false, $idSubtable); $dataTable->queueFilter('ColumnCallbackAddMetadata', array( 'label', 'url', 'Piwik_getSearchEngineUrlFromName') ); $dataTable->queueFilter('MetadataCallbackAddMetadata', array( 'url', 'logo', 'Piwik_getSearchEngineLogoFromUrl') ); // get the keyword and create the URL to the search result page - $keywords = $this->getKeywords($idSite, $period, $date); + $keywords = self::getKeywords($idSite, $period, $date); $keyword = $keywords->getRowFromIdSubDataTable($idSubtable)->getColumn('label'); $dataTable->queueFilter('MetadataCallbackReplace', array( 'url', 'Piwik_getSearchEngineUrlFromUrlAndKeyword', array($keyword)) ); return $dataTable; } - function getSearchEngines($idSite, $period, $date, $expanded = false) + static public function getSearchEngines($idSite, $period, $date, $expanded = false) { - $dataTable = $this->getDataTable('Referers_keywordBySearchEngine',$idSite, $period, $date, $expanded); + $dataTable = self::getDataTable('Referers_keywordBySearchEngine',$idSite, $period, $date, $expanded); $dataTable->queueFilter('ColumnCallbackAddMetadata', array( 'label', 'url', 'Piwik_getSearchEngineUrlFromName') ); $dataTable->queueFilter('MetadataCallbackAddMetadata', array( 'url', 'logo', 'Piwik_getSearchEngineLogoFromUrl') ); return $dataTable; } - function getKeywordsFromSearchEngineId($idSite, $period, $date, $idSubtable) + static public function getKeywordsFromSearchEngineId($idSite, $period, $date, $idSubtable) { - $dataTable = $this->getDataTable('Referers_keywordBySearchEngine',$idSite, $period, $date, $expanded = false, $idSubtable); + $dataTable = self::getDataTable('Referers_keywordBySearchEngine',$idSite, $period, $date, $expanded = false, $idSubtable); // get the search engine and create the URL to the search result page - $searchEngines = $this->getSearchEngines($idSite, $period, $date); + $searchEngines = self::getSearchEngines($idSite, $period, $date); $searchEngines->applyQueuedFilters(); $searchEngineUrl = $searchEngines->getRowFromIdSubDataTable($idSubtable)->getMetadata('url'); $dataTable->queueFilter('ColumnCallbackAddMetadata', array( 'label', 'url', 'Piwik_getSearchEngineUrlFromKeywordAndUrl', array($searchEngineUrl))); return $dataTable; } - function getCampaigns($idSite, $period, $date, $expanded = false) + static public function getCampaigns($idSite, $period, $date, $expanded = false) { - $dataTable = $this->getDataTable('Referers_keywordByCampaign',$idSite, $period, $date, $expanded); + $dataTable = self::getDataTable('Referers_keywordByCampaign',$idSite, $period, $date, $expanded); return $dataTable; } - function getKeywordsFromCampaignId($idSite, $period, $date, $idSubtable) + static public function getKeywordsFromCampaignId($idSite, $period, $date, $idSubtable) { - $dataTable = $this->getDataTable('Referers_keywordByCampaign',$idSite, $period, $date, $expanded = false, $idSubtable); + $dataTable = self::getDataTable('Referers_keywordByCampaign',$idSite, $period, $date, $expanded = false, $idSubtable); return $dataTable; } - function getWebsites($idSite, $period, $date, $expanded = false) + static public function getWebsites($idSite, $period, $date, $expanded = false) { - $dataTable = $this->getDataTable('Referers_urlByWebsite',$idSite, $period, $date, $expanded); + $dataTable = self::getDataTable('Referers_urlByWebsite',$idSite, $period, $date, $expanded); return $dataTable; } - function getUrlsFromWebsiteId($idSite, $period, $date, $idSubtable) + static public function getUrlsFromWebsiteId($idSite, $period, $date, $idSubtable) { - $dataTable = $this->getDataTable('Referers_urlByWebsite',$idSite, $period, $date, $expanded = false, $idSubtable); + $dataTable = self::getDataTable('Referers_urlByWebsite',$idSite, $period, $date, $expanded = false, $idSubtable); $dataTable->queueFilter('ColumnCallbackAddMetadata', array( 'label', 'url', create_function('$label', 'return $label;')) ); $dataTable->queueFilter('ColumnCallbackReplace', array('label', 'Piwik_getPathFromUrl')); return $dataTable; } - function getNumberOfDistinctSearchEngines($idSite, $period, $date) + static public function getNumberOfDistinctSearchEngines($idSite, $period, $date) { - return $this->getNumeric('Referers_distinctSearchEngines', $idSite, $period, $date); + return self::getNumeric('Referers_distinctSearchEngines', $idSite, $period, $date); } - function getNumberOfDistinctKeywords($idSite, $period, $date) + static public function getNumberOfDistinctKeywords($idSite, $period, $date) { - return $this->getNumeric('Referers_distinctKeywords', $idSite, $period, $date); + return self::getNumeric('Referers_distinctKeywords', $idSite, $period, $date); } - function getNumberOfDistinctCampaigns($idSite, $period, $date) + static public function getNumberOfDistinctCampaigns($idSite, $period, $date) { - return $this->getNumeric('Referers_distinctCampaigns', $idSite, $period, $date); + return self::getNumeric('Referers_distinctCampaigns', $idSite, $period, $date); } - function getNumberOfDistinctWebsites($idSite, $period, $date) + static public function getNumberOfDistinctWebsites($idSite, $period, $date) { - return $this->getNumeric('Referers_distinctWebsites', $idSite, $period, $date); + return self::getNumeric('Referers_distinctWebsites', $idSite, $period, $date); } - function getNumberOfDistinctWebsitesUrls($idSite, $period, $date) + static public function getNumberOfDistinctWebsitesUrls($idSite, $period, $date) { - return $this->getNumeric('Referers_distinctWebsitesUrls', $idSite, $period, $date); + return self::getNumeric('Referers_distinctWebsitesUrls', $idSite, $period, $date); } - private function getNumeric($name, $idSite, $period, $date) + static private function getNumeric($name, $idSite, $period, $date) { Piwik::checkUserHasViewAccess( $idSite ); $archive = Piwik_Archive::build($idSite, $period, $date ); |