diff --git a/config/global.ini.php b/config/global.ini.php index 1114efc681f..a818c3248c9 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -236,7 +236,7 @@ ; maximum number of rows for any of the Actions tables (pages, downloads, outlinks) datatable_archiving_maximum_rows_actions = 500 ; maximum number of rows for pages in categories (sub pages, when clicking on the + for a page category) -; note: should not exceed the display limit in Piwik_Actions_Controller::ACTIONS_REPORT_ROWS_DISPLAY +; note: should not exceed the display limit in Piwik\Actions\Controller::ACTIONS_REPORT_ROWS_DISPLAY ; because each subdirectory doesn't have paging at the bottom, so all data should be displayed if possible. datatable_archiving_maximum_rows_subtable_actions = 100 diff --git a/core/AssetManager.php b/core/AssetManager.php index 79f81fafe1c..086f538a3f5 100644 --- a/core/AssetManager.php +++ b/core/AssetManager.php @@ -254,7 +254,18 @@ private static function getCssFiles() { $cssFiles = array(); Piwik_PostEvent(self::CSS_IMPORT_EVENT, array(&$cssFiles)); + $cssFiles = self::sortCssFiles($cssFiles); + + // We also look for the currently enabled theme and add CSS from the json + $theme = PluginsManager::getInstance()->getThemeEnabled(); + if($theme) { + $info = $theme->getInformation(); + if(isset($info['stylesheet'])) { + $themeStylesheetFile = 'plugins/'. $theme->getPluginName() . '/' . $info['stylesheet']; + } + $cssFiles[] = $themeStylesheetFile; + } return $cssFiles; } diff --git a/core/PluginsManager.php b/core/PluginsManager.php index 50ede0d98df..faea3d3b234 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -283,8 +283,9 @@ public function activatePlugin($pluginName) } // Only one theme enabled at a time - $themeAlreadyEnabled = $this->getThemeEnabled(); - if($themeAlreadyEnabled) { + $themeEnabled = $this->getThemeEnabled(); + if($themeEnabled) { + $themeAlreadyEnabled = $themeEnabled->getPluginName(); $plugin = $this->loadPlugin($pluginName); if($plugin->isTheme()) { $plugins = $this->deactivatePlugin( $themeAlreadyEnabled, $plugins ); @@ -325,16 +326,16 @@ protected function isPluginInFilesystem($pluginName) * Returns the name of the non default theme currently enabled. * If Zeitgeist is enabled, returns false (nb: Zeitgeist cannot be disabled) * - * @return string + * @return Plugin */ - protected function getThemeEnabled() + public function getThemeEnabled() { $plugins = $this->getLoadedPlugins(); foreach($plugins as $plugin) { /* @var $plugin Plugin */ if($plugin->isTheme() && $plugin->getPluginName() != self::DEFAULT_THEME) { - return $plugin->getPluginName(); + return $plugin; } } return false; diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index 3744eb71601..a75b2354d59 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -977,8 +977,7 @@ public function hasReportBeenPurged() $reportYear = $reportDate->toString('Y'); $reportMonth = $reportDate->toString('m'); - //TODOA - if (class_exists('Piwik\Plugins\PrivacyManager\PrivacyManager') + if (PluginsManager::getInstance()->isPluginActivated('PrivacyManager') && Plugins\PrivacyManager\PrivacyManager::shouldReportBePurged($reportYear, $reportMonth) ) { return true; @@ -1013,7 +1012,6 @@ private function getBaseReportUrl($module, $action, $queryParams = array()) */ static public function renderReport($pluginName, $apiAction, $fetch = true) { - //TODOA $namespacedApiClassName = "\\Piwik\\Plugins\\$pluginName\\API"; if (!method_exists($namespacedApiClassName::getInstance(), $apiAction)) { throw new \Exception("$namespacedApiClassName Invalid action name '$apiAction' for '$pluginName' plugin."); diff --git a/plugins/Goals/Archiver.php b/plugins/Goals/Archiver.php index ae0cbf3b079..efb26854bc4 100644 --- a/plugins/Goals/Archiver.php +++ b/plugins/Goals/Archiver.php @@ -16,6 +16,7 @@ use Piwik\DataTable; use Piwik\DataArray; use Piwik\PluginsArchiver; +use Piwik\PluginsManager; use Piwik\Tracker\GoalManager; use Piwik\Plugins\Goals\Goals; @@ -333,8 +334,7 @@ protected function cleanupRowGetLabel(&$row, $currentField) } $label = "Value not defined"; // Product Name/Category not defined" - //TODOA : working? - if (class_exists('Piwik\Plugins\CustomVariables\CustomVariables')) { + if (PluginsManager::getInstance()->isPluginActivated('CustomVariables')) { $label = \Piwik\Plugins\CustomVariables\Archiver::LABEL_CUSTOM_VALUE_NOT_DEFINED; } } diff --git a/plugins/PleineLune/PleineLune.php b/plugins/PleineLune/PleineLune.php deleted file mode 100644 index c1189727ba7..00000000000 --- a/plugins/PleineLune/PleineLune.php +++ /dev/null @@ -1,32 +0,0 @@ - 'getCssFiles', - ); - } - - public function getCssFiles(&$cssFiles) - { - $cssFiles[] = "plugins/PleineLune/stylesheets/theme.less"; - } -} diff --git a/plugins/PleineLune/plugin.piwik.json b/plugins/PleineLune/plugin.piwik.json index d0718e1737d..b3ab4ac732b 100644 --- a/plugins/PleineLune/plugin.piwik.json +++ b/plugins/PleineLune/plugin.piwik.json @@ -1,5 +1,6 @@ { "name": "PleineLune", "description": "A dark theme for Piwik, ideal to view your analytics reports before sunrise.", - "theme": true + "theme": true, + "stylesheet": "stylesheets/theme.less" } \ No newline at end of file