diff options
Diffstat (limited to 'plugins/CoreAdminHome')
-rw-r--r-- | plugins/CoreAdminHome/API.php | 14 | ||||
-rw-r--r-- | plugins/CoreAdminHome/Controller.php | 30 | ||||
-rw-r--r-- | plugins/CoreAdminHome/CoreAdminHome.php | 10 |
3 files changed, 31 insertions, 23 deletions
diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php index 2768708ef5..71444288e3 100644 --- a/plugins/CoreAdminHome/API.php +++ b/plugins/CoreAdminHome/API.php @@ -6,8 +6,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * * @category Piwik_Plugins - * @package Piwik_CoreAdminHome + * @package CoreAdminHome */ +namespace Piwik\Plugins\CoreAdminHome; + +use Exception; use Piwik\DataAccess\ArchiveTableCreator; use Piwik\Period; use Piwik\Period\Week; @@ -20,14 +23,14 @@ use Piwik\Site; use Piwik\Db; /** - * @package Piwik_CoreAdminHome + * @package CoreAdminHome */ -class Piwik_CoreAdminHome_API +class API { static private $instance = null; /** - * @return Piwik_CoreAdminHome_API + * @return \Piwik\Plugins\CoreAdminHome\API */ static public function getInstance() { @@ -103,7 +106,6 @@ class Piwik_CoreAdminHome_API } } - // If using the feature "Delete logs older than N days"... $logsAreDeletedBeforeThisDate = Config::getInstance()->Deletelogs['delete_logs_schedule_lowest_interval']; $logsDeleteEnabled = Config::getInstance()->Deletelogs['delete_logs_enable']; @@ -188,7 +190,7 @@ class Piwik_CoreAdminHome_API Db::query($query, $bind); // Force to re-process data for these websites in the next archive.php cron run - $invalidatedIdSites = Piwik_CoreAdminHome_API::getWebsiteIdsToInvalidate(); + $invalidatedIdSites = self::getWebsiteIdsToInvalidate(); $invalidatedIdSites = array_merge($invalidatedIdSites, $idSites); $invalidatedIdSites = array_unique($invalidatedIdSites); $invalidatedIdSites = array_values($invalidatedIdSites); diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php index 64d62ed158..f8a23c8dc2 100644 --- a/plugins/CoreAdminHome/Controller.php +++ b/plugins/CoreAdminHome/Controller.php @@ -6,12 +6,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * * @category Piwik_Plugins - * @package Piwik_CoreAdminHome + * @package CoreAdminHome */ +namespace Piwik\Plugins\CoreAdminHome; + +use Exception; use Piwik\API\ResponseBuilder; use Piwik\ArchiveProcessor\Rules; use Piwik\Config; -use Piwik\Controller\Admin; use Piwik\Piwik; use Piwik\Common; use Piwik\Nonce; @@ -19,12 +21,15 @@ use Piwik\Tracker\IgnoreCookie; use Piwik\View; use Piwik\Url; use Piwik\Site; +use Piwik\Plugins\LanguagesManager\LanguagesManager; +use Piwik\Plugins\LanguagesManager\API as LanguagesManagerAPI; +use Piwik\Plugins\SitesManager\API; /** * - * @package Piwik_CoreAdminHome + * @package CoreAdminHome */ -class Piwik_CoreAdminHome_Controller extends Admin +class Controller extends \Piwik\Controller\Admin { const LOGO_HEIGHT = 300; const LOGO_SMALL_HEIGHT = 100; @@ -67,7 +72,8 @@ class Piwik_CoreAdminHome_Controller extends Admin $directoryWritable = is_writable(PIWIK_DOCUMENT_ROOT . '/misc/user/'); $logoFilesWriteable = is_writeable(PIWIK_DOCUMENT_ROOT . '/misc/user/logo.png') && is_writeable(PIWIK_DOCUMENT_ROOT . '/misc/user/logo.svg') - && is_writeable(PIWIK_DOCUMENT_ROOT . '/misc/user/logo-header.png');; + && is_writeable(PIWIK_DOCUMENT_ROOT . '/misc/user/logo-header.png'); + ; $view->logosWriteable = ($logoFilesWriteable || $directoryWritable) && ini_get('file_uploads') == 1; $trustedHosts = array(); @@ -77,7 +83,7 @@ class Piwik_CoreAdminHome_Controller extends Admin $view->trustedHosts = $trustedHosts; } - $view->language = Piwik_LanguagesManager::getLanguageCodeForCurrentUser(); + $view->language = LanguagesManager::getLanguageCodeForCurrentUser(); $this->setBasicVariablesView($view); echo $view->render(); } @@ -141,7 +147,7 @@ class Piwik_CoreAdminHome_Controller extends Admin $this->setBasicVariablesView($view); $view->topMenu = Piwik_GetTopMenu(); - $viewableIdSites = Piwik_SitesManager_API::getInstance()->getSitesIdWithAtLeastViewAccess(); + $viewableIdSites = API::getInstance()->getSitesIdWithAtLeastViewAccess(); $defaultIdSite = reset($viewableIdSites); $view->idSite = Common::getRequestVar('idSite', $defaultIdSite, 'int'); @@ -149,7 +155,7 @@ class Piwik_CoreAdminHome_Controller extends Admin $view->defaultReportSiteName = Site::getNameFor($view->idSite); $view->defaultSiteRevenue = Piwik::getCurrency($view->idSite); - $allUrls = Piwik_SitesManager_API::getInstance()->getSiteUrlsFromId($view->idSite); + $allUrls = API::getInstance()->getSiteUrlsFromId($view->idSite); if (isset($allUrls[1])) { $aliasUrl = $allUrls[1]; } else { @@ -161,9 +167,9 @@ class Piwik_CoreAdminHome_Controller extends Admin $view->defaultReportSiteDomain = @parse_url($mainUrl, PHP_URL_HOST); // get currencies for each viewable site - $view->currencySymbols = Piwik_SitesManager_API::getInstance()->getCurrencySymbols(); + $view->currencySymbols = API::getInstance()->getCurrencySymbols(); - $view->serverSideDoNotTrackEnabled = \Piwik_PrivacyManager_Controller::isDntSupported(); + $view->serverSideDoNotTrackEnabled = \Piwik\Plugins\PrivacyManager\Controller::isDntSupported(); echo $view->render(); } @@ -186,9 +192,9 @@ class Piwik_CoreAdminHome_Controller extends Admin $view = new View('@CoreAdminHome/optOut'); $view->trackVisits = $trackVisits; $view->nonce = Nonce::getNonce('Piwik_OptOut', 3600); - $view->language = Piwik_LanguagesManager_API::getInstance()->isLanguageAvailable($language) + $view->language = LanguagesManagerAPI::getInstance()->isLanguageAvailable($language) ? $language - : Piwik_LanguagesManager::getLanguageCodeForCurrentUser(); + : LanguagesManager::getLanguageCodeForCurrentUser(); echo $view->render(); } diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index c3517d8870..607df94246 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -6,22 +6,23 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * * @category Piwik_Plugins - * @package Piwik_CoreAdminHome + * @package CoreAdminHome */ +namespace Piwik\Plugins\CoreAdminHome; + use Piwik\DataAccess\ArchiveSelector; use Piwik\DataAccess\ArchiveTableCreator; use Piwik\Piwik; use Piwik\Date; use Piwik\ScheduledTask; -use Piwik\Plugin; use Piwik\Db; use Piwik\ScheduledTime\Daily; /** * - * @package Piwik_CoreAdminHome + * @package CoreAdminHome */ -class Piwik_CoreAdminHome extends Plugin +class CoreAdminHome extends \Piwik\Plugin { /** * @see Piwik_Plugin::getListHooksRegistered @@ -91,7 +92,6 @@ class Piwik_CoreAdminHome extends Plugin array('module' => 'CoreAdminHome', 'action' => 'trackingCodeGenerator'), Piwik::isUserHasSomeAdminAccess(), $order = 4); - } function purgeOutdatedArchives() |