diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c6720e9fc5a5f167e1b07e57e09bc6f5a7ce5e3..06cd5f970c05e60bf7e58f964e04477f0b154413 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API's, Plugins, Themes, etc will be listed here. +## Piwik 2.7.0 + +### Deprecations +* The `Piwik\Menu\MenuAbstract::add()` method is deprecated in favor of `addItem()`. Read more about this here: [#6140](https://github.com/piwik/piwik/issues/6140). We do not plan to remove the deprecated method before Piwik 3.0. + +### New APIs +* It is now easier to generate the URL for a menu item see [#6140](https://github.com/piwik/piwik/issues/6140), [urlForDefaultAction()](http://developer.piwik.org/api-reference/Piwik/Plugin/Menu#urlfordefaultaction), [urlForAction()](http://developer.piwik.org/api-reference/Piwik/Plugin/Menu#urlforaction), [urlForModuleAction()](http://developer.piwik.org/api-reference/Piwik/Plugin/Menu#urlformoduleaction) + +### New commands +* `core:clear-caches` Lets you easily delete all caches. This command can be useful for instance after updating Piwik files manually. + + ## Piwik 2.6.0 ### New features @@ -14,7 +26,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' * If an API returns an indexed array, it is now possible to use `filter_limit` and `filter_offset`. This was before only possible if an API returned a DataTable. * The Live API now returns only visitor information of activated plugins. So if for instance the Referrers plugin is deactivated a visitor won't contain any referrers related properties. This is a bugfix as the API was crashing before if some core plugins were deactivated. Affected methods are for instance `getLastVisitDetails` or `getVisitorProfile`. If all core plugins are enabled as by default there will be no change at all except the order of the properties within one visitor. -### New commmands +### New commands * `core:run-scheduled-tasks` Let's you run all scheduled tasks due to run at this time. Useful for instance when testing tasks. #### Internal change @@ -66,7 +78,7 @@ We are using `@since` annotations in case we are introducing new API's to make i * [MenuUser](http://developer.piwik.org/api-reference/Piwik/Menu/MenuUser) to add or modify user menu items * [Tasks](http://developer.piwik.org/api-reference/Piwik/Plugin/Tasks) to add scheduled tasks -### New commmands +### New commands * `generate:theme` Let's you easily generate a new theme and customize colors, see the [Theming guide](http://developer.piwik.org/guides/theming) * `generate:update` Let's you generate an update file * `generate:report` Let's you generate a report @@ -84,7 +96,7 @@ We are using `@since` annotations in case we are introducing new API's to make i ### Deprecations ### New features ### New APIs -### New commmands +### New commands ### New guides ### Internal change --> diff --git a/composer.lock b/composer.lock index 7a30ec861b6458872698f8e97f8dac4e48ba3599..e126a39a7f4169c50799e8cec5b9a1a0928a6f2e 100644 --- a/composer.lock +++ b/composer.lock @@ -96,16 +96,16 @@ }, { "name": "piwik/device-detector", - "version": "2.3.1", + "version": "2.4", "source": { "type": "git", "url": "https://github.com/piwik/device-detector.git", - "reference": "9cd0338be126aaf947f20fd08a6381c0c658dca5" + "reference": "64d91375aea2340b81e2cb46745dc3b2213d3231" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/piwik/device-detector/zipball/9cd0338be126aaf947f20fd08a6381c0c658dca5", - "reference": "9cd0338be126aaf947f20fd08a6381c0c658dca5", + "url": "https://api.github.com/repos/piwik/device-detector/zipball/64d91375aea2340b81e2cb46745dc3b2213d3231", + "reference": "64d91375aea2340b81e2cb46745dc3b2213d3231", "shasum": "" }, "require": { @@ -139,21 +139,21 @@ "parser", "useragent" ], - "time": "2014-08-11 20:21:18" + "time": "2014-08-29 18:24:04" }, { "name": "symfony/console", - "version": "v2.5.3", + "version": "v2.5.4", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "cd2d1e4bac2206b337326b0140ff475fe9ad5f63" + "reference": "748beed2a1e73179c3f5154d33fe6ae100c1aeb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/cd2d1e4bac2206b337326b0140ff475fe9ad5f63", - "reference": "cd2d1e4bac2206b337326b0140ff475fe9ad5f63", + "url": "https://api.github.com/repos/symfony/Console/zipball/748beed2a1e73179c3f5154d33fe6ae100c1aeb1", + "reference": "748beed2a1e73179c3f5154d33fe6ae100c1aeb1", "shasum": "" }, "require": { @@ -194,7 +194,7 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-08-05 09:00:40" + "time": "2014-08-14 16:10:54" }, { "name": "tedivm/jshrink", @@ -687,16 +687,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.2.4", + "version": "4.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f0c2d374ad06ec1e56c721f4ed87c59ff35f440e" + "reference": "c3abe5953d1e60a0bf23012b1bc8c4d07f4832d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f0c2d374ad06ec1e56c721f4ed87c59ff35f440e", - "reference": "f0c2d374ad06ec1e56c721f4ed87c59ff35f440e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c3abe5953d1e60a0bf23012b1bc8c4d07f4832d7", + "reference": "c3abe5953d1e60a0bf23012b1bc8c4d07f4832d7", "shasum": "" }, "require": { @@ -757,20 +757,20 @@ "testing", "xunit" ], - "time": "2014-08-31 06:46:49" + "time": "2014-09-06 18:38:27" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.2.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b" + "reference": "b241b18d87a47093f20fae8b0ba40379b00bd53a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/42e589e08bc86e3e9bdf20d385e948347788505b", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b241b18d87a47093f20fae8b0ba40379b00bd53a", + "reference": "b241b18d87a47093f20fae8b0ba40379b00bd53a", "shasum": "" }, "require": { @@ -779,7 +779,7 @@ "phpunit/php-text-template": "~1.2" }, "require-dev": { - "phpunit/phpunit": "4.2.*@dev" + "phpunit/phpunit": "~4.2" }, "suggest": { "ext-soap": "*" @@ -796,9 +796,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -815,7 +812,7 @@ "mock", "xunit" ], - "time": "2014-08-02 13:50:58" + "time": "2014-09-06 17:32:37" }, { "name": "sebastian/comparator", @@ -1086,17 +1083,17 @@ }, { "name": "symfony/yaml", - "version": "v2.5.3", + "version": "v2.5.4", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f" + "reference": "01a7695bcfb013d0a15c6757e15aae120342986f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/01a7695bcfb013d0a15c6757e15aae120342986f", + "reference": "01a7695bcfb013d0a15c6757e15aae120342986f", "shasum": "" }, "require": { @@ -1129,12 +1126,10 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-08-05 09:00:40" + "time": "2014-08-31 03:22:04" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", "stability-flags": { "facebook/xhprof": 20 @@ -1143,7 +1138,5 @@ "platform": { "php": ">=5.3.2" }, - "platform-dev": [ - - ] + "platform-dev": [] } diff --git a/core/Factory.php b/core/BaseFactory.php similarity index 96% rename from core/Factory.php rename to core/BaseFactory.php index 480f9313c17c80ae035044eb1eb9f7f45ba449f1..e24b6dfc02f337f10b384b64ec4e4b713b7c51c5 100644 --- a/core/Factory.php +++ b/core/BaseFactory.php @@ -20,13 +20,13 @@ use Exception; * Derived classes should override the **getClassNameFromClassId** and **getInvalidClassIdExceptionMessage** * static methods. */ -abstract class Factory +abstract class BaseFactory { /** * Creates a new instance of a class using a string ID. * * @param string $classId The ID of the class. - * @return Factory + * @return BaseFactory * @throws Exception if $classId is invalid. */ public static function factory($classId) diff --git a/core/DataTable/Renderer.php b/core/DataTable/Renderer.php index aea71e4da863ae42bd4f49912db0911cb9e8d8c9..e366cc2ec8534912d4da3da37ef4b0748d1ce96e 100644 --- a/core/DataTable/Renderer.php +++ b/core/DataTable/Renderer.php @@ -12,7 +12,7 @@ use Exception; use Piwik\DataTable; use Piwik\Metrics; use Piwik\Piwik; -use Piwik\Factory; +use Piwik\BaseFactory; /** * A DataTable Renderer can produce an output given a DataTable object. @@ -22,7 +22,7 @@ use Piwik\Factory; * $render->setTable($dataTable); * echo $render; */ -abstract class Renderer extends Factory +abstract class Renderer extends BaseFactory { protected $table; diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php index 2ccf6fda289e6f9809f0b0622541d355e52bc3be..1fe1152c98e38ffca391eee2601919fcb1299cfd 100644 --- a/core/Menu/MenuAbstract.php +++ b/core/Menu/MenuAbstract.php @@ -77,16 +77,32 @@ abstract class MenuAbstract extends Singleton * current user. If false, the entry will not be added. * @param int $order The order hint. * @param bool|string $tooltip An optional tooltip to display or false to display the tooltip. - * @api + * + * @deprecated since 2.7.0 Use {@link addItem() instead}. Method will be removed in Piwik 3.0 */ public function add($menuName, $subMenuName, $url, $displayedForCurrentUser = true, $order = 50, $tooltip = false) { if (!$displayedForCurrentUser) { - // TODO this parameter should be removed and instead menu items should be only added if it is supposed to be - // displayed. Won't do it now to stay backward compatible. For Piwik 3.0 we should do it. return; } + $this->addItem($menuName, $subMenuName, $url, $order, $tooltip); + } + + /** + * Adds a new entry to the menu. + * + * @param string $menuName The menu's category name. Can be a translation token. + * @param string $subMenuName The menu item's name. Can be a translation token. + * @param string|array $url The URL the admin menu entry should link to, or an array of query parameters + * that can be used to build the URL. + * @param int $order The order hint. + * @param bool|string $tooltip An optional tooltip to display or false to display the tooltip. + * @since 2.7.0 + * @api + */ + public function addItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false) + { // make sure the idSite value used is numeric (hack-y fix for #3426) if (!is_numeric(Common::getRequestVar('idSite', false))) { $idSites = API::getInstance()->getSitesIdWithAtLeastViewAccess(); diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php index 7b6298dfe7b3663736e34a4d9d649e006388a126..3ebad0f1eda42ee437889b0a9f702b61e7c4d796 100644 --- a/core/Plugin/Controller.php +++ b/core/Plugin/Controller.php @@ -252,13 +252,13 @@ abstract class Controller * Assigns the given variables to the template and renders it. * * Example: - * ``` - public function myControllerAction () { - return $this->renderTemplate('index', array( - 'answerToLife' => '42' - )); - } - ``` + * + * public function myControllerAction () { + * return $this->renderTemplate('index', array( + * 'answerToLife' => '42' + * )); + * } + * * This will render the 'index.twig' file within the plugin templates folder and assign the view variable * `answerToLife` to `42`. * @@ -278,7 +278,17 @@ abstract class Controller } $view = new View($template); - $this->setBasicVariablesView($view); + + // alternatively we could check whether the templates extends either admin.twig or dashboard.twig and based on + // that call the correct method. This will be needed once we unify Controller and ControllerAdmin see + // https://github.com/piwik/piwik/issues/6151 + if ($this instanceof ControllerAdmin) { + $this->setBasicVariablesView($view); + } elseif (empty($this->site) || empty($this->idSite)) { + $this->setBasicVariablesView($view); + } else { + $this->setGeneralVariablesView($view); + } foreach ($variables as $key => $value) { $view->$key = $value; diff --git a/core/Plugin/Menu.php b/core/Plugin/Menu.php index 9f7240b1f30be30de921caad56b4405c5aac0648..6d2bdefccd28908042c9da8ed2c7a72b82a37deb 100644 --- a/core/Plugin/Menu.php +++ b/core/Plugin/Menu.php @@ -8,10 +8,12 @@ */ namespace Piwik\Plugin; +use Piwik\Development; use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuReporting; use Piwik\Menu\MenuTop; use Piwik\Menu\MenuUser; +use Piwik\Plugin\Manager as PluginManager; /** * Base class of all plugin menu providers. Plugins that define their own menu items can extend this class to easily @@ -27,6 +29,106 @@ use Piwik\Menu\MenuUser; */ class Menu { + protected $module = ''; + + /** + * @ignore + */ + public function __construct() + { + $this->module = $this->getModule(); + } + + private function getModule() + { + $className = get_class($this); + $className = explode('\\', $className); + + return $className[2]; + } + + /** + * Generates a URL for the default action of the plugin controller. + * + * Example: + * ``` + * $menu->addItem('UI Framework', '', $this->urlForDefaultAction(), $orderId = 30); + * // will add a menu item that leads to the default action of the plugin controller when a user clicks on it. + * // The default action is usually the `index` action - meaning the `index()` method the controller - + * // but the default action can be customized within a controller + * ``` + * + * @param array $additionalParams Optional URL parameters that will be appended to the URL + * @return array + * + * @since 2.7.0 + * @api + */ + protected function urlForDefaultAction($additionalParams = array()) + { + $params = (array) $additionalParams; + $params['action'] = ''; + $params['module'] = $this->module; + + return $params; + } + + /** + * Generates a URL for the given action. In your plugin controller you have to create a method with the same name + * as this method will be executed when a user clicks on the menu item. If you want to generate a URL for the + * action of another module, meaning not your plugin, you should use the method {@link urlForModuleAction()}. + * + * @param string $controllerAction The name of the action that should be executed within your controller + * @param array $additionalParams Optional URL parameters that will be appended to the URL + * @return array + * + * @since 2.7.0 + * @api + */ + protected function urlForAction($controllerAction, $additionalParams = array()) + { + $this->checkisValidCallable($this->module, $controllerAction); + + $params = (array) $additionalParams; + $params['action'] = $controllerAction; + $params['module'] = $this->module; + + return $params; + } + + /** + * Generates a URL for the given action of the given module. We usually do not recommend to use this method as you + * should make sure the method of that module actually exists. If the plugin owner of that module changes the method + * in a future version your link might no longer work. If you want to link to an action of your controller use the + * method {@link urlForAction()}. Note: We will generate a link only if the given module is installed and activated. + * + * @param string $module The name of the module/plugin the action belongs to. The module name is case sensitive. + * @param string $controllerAction The name of the action that should be executed within your controller + * @param array $additionalParams Optional URL parameters that will be appended to the URL + * @return array|null Returns null if the given module is either not installed or not activated. Returns the URL + * to the given module action otherwise. + * + * @since 2.7.0 + * // not API for now + */ + protected function urlForModuleAction($module, $controllerAction, $additionalParams = array()) + { + $this->checkisValidCallable($module, $controllerAction); + + $pluginManager = PluginManager::getInstance(); + + if (!$pluginManager->isPluginLoaded($module) || + !$pluginManager->isPluginActivated($module)) { + return null; + } + + $params = (array) $additionalParams; + $params['action'] = $controllerAction; + $params['module'] = $module; + + return $params; + } + /** * Configures the reporting menu which should only contain links to reports of a specific site such as * "Search Engines", "Page Titles" or "Locations & Provider". @@ -59,4 +161,32 @@ class Menu { } + private function checkisValidCallable($module, $action) + { + if (!Development::isEnabled()) { + return; + } + + $prefix = 'Menu item added in ' . get_class($this) . ' will fail when being selected. '; + + if (!is_string($action)) { + Development::error($prefix . 'No valid action is specified. Make sure the defined action that should be executed is a string.'); + } + + $reportAction = lcfirst(substr($action, 4)); + if (Report::factory($module, $reportAction)) { + return; + } + + $controllerClass = '\\Piwik\\Plugins\\' . $module . '\\Controller'; + + if (!Development::methodExists($controllerClass, $action)) { + Development::error($prefix . 'The defined action "' . $action . '" does not exist in ' . $controllerClass . '". Make sure to define such a method.'); + } + + if (!Development::isCallableMethod($controllerClass, $action)) { + Development::error($prefix . 'The defined action "' . $action . '" is not callable on "' . $controllerClass . '". Make sure the method is public.'); + } + } + } diff --git a/core/ReportRenderer.php b/core/ReportRenderer.php index e6ccc530ed818679f956d8eda91ddccbed0caa17..9cf58448f73163dfd03a04afa963896002d9deba 100644 --- a/core/ReportRenderer.php +++ b/core/ReportRenderer.php @@ -14,13 +14,13 @@ use Piwik\DataTable\Row; use Piwik\DataTable\Simple; use Piwik\DataTable; use Piwik\Plugins\ImageGraph\API; -use Piwik\Factory; +use Piwik\BaseFactory; /** * A Report Renderer produces user friendly renderings of any given Piwik report. * All new Renderers must be copied in ReportRenderer and added to the $availableReportRenderers. */ -abstract class ReportRenderer extends Factory +abstract class ReportRenderer extends BaseFactory { const DEFAULT_REPORT_FONT = 'dejavusans'; const REPORT_TEXT_COLOR = "68,68,68"; diff --git a/core/Version.php b/core/Version.php index 7852698ba53629d5f317de465a5f289a44a62b35..a5effe147f9188d8a9b5fd85e7f6577756f6e2c9 100644 --- a/core/Version.php +++ b/core/Version.php @@ -21,5 +21,5 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '2.6.1-b1'; + const VERSION = '2.7.0-b1'; } diff --git a/core/View.php b/core/View.php index fe6494c87ea67e0f7f606ecb929f3c4316657f73..c62c0eed78f3bbb4647bcba63887b9e6c13cfe90 100644 --- a/core/View.php +++ b/core/View.php @@ -232,6 +232,8 @@ class View implements ViewInterface $user = APIUsersManager::getInstance()->getUser($this->userLogin); $this->userAlias = $user['alias']; } catch (Exception $e) { + Log::verbose($e); + // can fail, for example at installation (no plugin loaded yet) } @@ -253,7 +255,16 @@ class View implements ViewInterface protected function renderTwigTemplate() { - $output = $this->twig->render($this->getTemplateFile(), $this->getTemplateVars()); + try { + $output = $this->twig->render($this->getTemplateFile(), $this->getTemplateVars()); + } catch (Exception $ex) { + // twig does not rethrow exceptions, it wraps them so we log the cause if we can find it + $cause = $ex->getPrevious(); + Log::debug($cause === null ? $ex : $cause); + + throw $ex; + } + $output = $this->applyFilter_cacheBuster($output); $helper = new Theme; diff --git a/lang/cs.json b/lang/cs.json index 7fccf65c867de09e6585ce36b740ca1db68e8380..2aa35778cc55548ee7dfbaae44a033b1cdf6e788 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -10,12 +10,12 @@ "Add": "PÅ™idat", "AfterEntry": "Po vloženà dne", "All": "VÅ¡e", - "AllowPiwikArchivingToTriggerBrowser": "SpouÅ¡tÄ›t archovovánà když jsou hlášenà prohlÞena ve Web prohlÞeÄi", + "AllowPiwikArchivingToTriggerBrowser": "Povolit spouÅ¡tÄ›nà archivovánÃ, když jsou hlášenà prohlÞena ve Webovém prohlÞeÄi", "AllWebsitesDashboard": "NástÄ›nka pro vÅ¡echny weby", "And": "a", "API": "API", - "ApplyDateRange": "Aplikovat vybraný rozsah", - "ArchivingInlineHelp": "Pro web stránky se stÅ™ednÃ, nebo vysokou návÅ¡tÄ›vnostà je doporuÄeno zakázat archivovánà Piwiku z web prohlÞeÄe. MÃsto toho doporuÄujeme vytvoÅ™enà úlohy pro cron", + "ApplyDateRange": "PoužÃt vybraný rozsah", + "ArchivingInlineHelp": "Pro web stránky se stÅ™ednà nebo vysokou návÅ¡tÄ›vnostà je doporuÄeno zakázat archivovánà Piwiku z webového prohlÞeÄe. MÃsto toho doporuÄujeme vytvoÅ™enà úlohy pro cron", "ArchivingTriggerDescription": "DoporuÄeno pro vÄ›tÅ¡Ã instalace Piwiku, potÅ™ebujete %snastavit cron úlohu%s na automatické spracovánà hlášenÃ.", "AuthenticationMethodSmtp": "AutentizaÄnà metoda SMTP", "AverageOrderValue": "PrůmÄ›rná hodnota objednávky", @@ -23,12 +23,12 @@ "AverageQuantity": "PrůmÄ›rné množstvÃ", "BackToPiwik": "ZpÄ›t do Piwiku", "Broken": "Rozbité", - "BrokenDownReportDocumentation": "Je ÄlenÄ›n do různých hlášenÃ, která jsou zobrazena dolnà Äásti stránky. Vybraný graf můžete zvÄ›tÅ¡it tak, že na nÄ›j kliknete.", + "BrokenDownReportDocumentation": "Je ÄlenÄ›n do různých hlášenÃ, která jsou zobrazena v dolnà Äásti stránky. Vybraný graf můžete zvÄ›tÅ¡it tak, že na nÄ›j kliknete.", "Cancel": "ZruÅ¡it", "CannotUnzipFile": "Nelze rozbalit soubor %1$s: %2$s", "ChangePassword": "ZmÄ›nit heslo", - "ChangeTagCloudView": "VÅ¡imnÄ›te si, že můžete zobrazit hlášenà jinak, než jako tag cloud. Pro zmÄ›nu zobrazenà použÃjte ovládacà prvky pod nÃm.", - "ChooseDate": "Vyber datum", + "ChangeTagCloudView": "VÅ¡imnÄ›te si, že můžete zobrazit hlášenà jinak, než jako tag cloud. Pro zmÄ›nu zobrazenà použijte ovládacà prvky pod nÃm.", + "ChooseDate": "Zvolte datum", "ChooseLanguage": "Zvolte jazyk", "ChoosePeriod": "Zvolte obdobÃ", "ChooseWebsite": "Zvolte web", @@ -37,51 +37,51 @@ "ClickToChangePeriod": "Klikni znovu pro zmÄ›nu obdobÃ.", "Close": "ZavÅ™Ãt", "ColumnActionsPerVisit": "Akcà za návÅ¡tÄ›vu", - "ColumnActionsPerVisitDocumentation": "PrůmÄ›rnà poÄet akcà (zobrazenà stránek, staženà nebo externÃch odkazů) za návÅ¡tÄ›vu.", - "ColumnAverageGenerationTime": "PrůmÄ›rný generovaný Äas", + "ColumnActionsPerVisitDocumentation": "PrůmÄ›rný poÄet akcà (zobrazenà stránek, staženà nebo externÃch odkazů) za návÅ¡tÄ›vu.", + "ColumnAverageGenerationTime": "PrůmÄ›rný Äas generovánÃ", "ColumnAverageGenerationTimeDocumentation": "PrůmÄ›rný Äas, za který byla stránka vygenerována. Toto měřenà zahrnuje Äas, který potÅ™eboval server k vygenerovánà stránky plus Äas, který potÅ™eboval klient k jejÃmu staženÃ. KratÅ¡Ã průmÄ›rný Äas znamená rychlejÅ¡Ã stránku.", - "ColumnAverageTimeOnPage": "PřůmÄ›rnÄ› Äasu na stránce", - "ColumnAverageTimeOnPageDocumentation": "PrůmÄ›rný celkový Äas strávený na stránce (pouze konkrétnà stránky),", + "ColumnAverageTimeOnPage": "PrůmÄ›rný Äas na stránce", + "ColumnAverageTimeOnPageDocumentation": "PrůmÄ›rný celkový Äas strávený na stránce (pouze konkrétnà stránky, ne celý web).", "ColumnAvgTimeOnSite": "PrůmÄ›rnÄ› Äasu na stránkách", "ColumnAvgTimeOnSiteDocumentation": "PrůmÄ›rná doba jedné návÅ¡tÄ›vy", "ColumnBounceRate": "Odchozà frekvence", "ColumnBounceRateDocumentation": "Procento návÅ¡tÄ›v, které mÄ›ly jedno zobrazenÃ. To znamená návÅ¡tÄ›vnÃci, kteřà po zobrazenà stránky okamžitÄ› odeÅ¡li.", "ColumnBounceRateForPageDocumentation": "Procento návÅ¡tÄ›v, které zaÄaly a skonÄily touto stránkou", "ColumnBounces": "Ihned odchozÃ", - "ColumnBouncesDocumentation": "PoÄet návÅ¡tÄ›v, které zaÄaly a skonÄily na touto stránkou. To znamená, kteřà navÅ¡tÃvily jen tuto stránku.", + "ColumnBouncesDocumentation": "PoÄet návÅ¡tÄ›v, které zaÄaly a skonÄily na této stránce. To znamená, kteřà navÅ¡tÃvily jen tuto stránku.", "ColumnConversionRate": "Frekvence konverzÃ", - "ColumnConversionRateDocumentation": "Procento návÅ¡tÄ›v, které provedli konverzi CÃle,", + "ColumnConversionRateDocumentation": "Procento návÅ¡tÄ›v, které provedly konverzi CÃle.", "ColumnDestinationPage": "CÃlová stránka", "ColumnEntrances": "Vstupy", - "ColumnEntrancesDocumentation": "PoÄet návÅ¡tÄ›vnÃků, kteřà zapoÄali návÅ¡tÄ›vu touto stránkovu.", + "ColumnEntrancesDocumentation": "PoÄet návÅ¡tÄ›vnÃků, kteřà zapoÄali návÅ¡tÄ›vu touto stránkou.", "ColumnExitRate": "Frekvence odchodů", "ColumnExitRateDocumentation": "Procentuálnà vyjádÅ™enà tÄ›ch, kteřà opustili tuto stránku po jejÃm zobrazenÃ.", "ColumnExits": "Odchody", - "ColumnExitsDocumentation": "PoÄet návÅ¡tÄ›v, které skonÄily touto stránkovu.", + "ColumnExitsDocumentation": "PoÄet návÅ¡tÄ›v, které skonÄily touto stránkou.", "ColumnGenerationTime": "ÄŒas generovánÃ", "ColumnKeyword": "KlÃÄové slovo", "ColumnLabel": "Popisek", "ColumnMaxActions": "Maximálnà poÄet akcà pÅ™i jedné návÅ¡tÄ›vÄ›", "ColumnNbActions": "Akce", - "ColumnNbActionsDocumentation": "PoÄet akcà VaÅ¡ich návstÄ›vnÃků. Akcà se rozumà zobrazenà stránky, staženà a kliknutà na externà odkazy.", + "ColumnNbActionsDocumentation": "PoÄet akcà VaÅ¡ich návÅ¡tÄ›vnÃků. Akcà se rozumà zobrazenà stránky, staženà a kliknutà na externà odkazy.", "ColumnNbUniqVisitors": "JedineÄnà návÅ¡tÄ›vnÃci", "ColumnNbUniqVisitorsDocumentation": "PoÄet neduplicitnÃch návÅ¡tÄ›vnÃků, kteřà navÅ¡tÃvili vaÅ¡e stránky. Každý návÅ¡tÄ›vnÃk je poÄÃtán pouze jednou, ikdyž tÅ™eba pÅ™iÅ¡el nÄ›kolikrát za den.", "ColumnNbVisits": "NávÅ¡tÄ›v", - "ColumnNbVisitsDocumentation": "Pokud návÅ¡tÄ›vnÃk pÅ™ijde na vaÅ¡e stránky poprvé, nebo po tÅ™iceti minutách, je tato návÅ¡tÄ›va zapoÄÃtána jako nová.", + "ColumnNbVisitsDocumentation": "Pokud návÅ¡tÄ›vnÃk pÅ™ijde na vaÅ¡e stránky poprvé nebo po tÅ™iceti minutách, je tato návÅ¡tÄ›va zapoÄÃtána jako nová.", "ColumnPageBounceRateDocumentation": "Procento návÅ¡tÄ›v, které zaÄaly touto stránkou a ihned ji opustili.", "ColumnPageviews": "Zobrazenà stránek", - "ColumnPageviewsDocumentation": "PoÄet navÅ¡tÃvenà této stránky.", + "ColumnPageviewsDocumentation": "PoÄet návÅ¡tÄ›v této stránky.", "ColumnPercentageVisits": "% návÅ¡tÄ›v", "ColumnRevenue": "PÅ™Ãjem", "ColumnSumVisitLength": "Celkový Äas strávený návÅ¡tÄ›vnÃky (v sekundách)", "ColumnTotalPageviews": "Celkem zobrazených stránek", - "ColumnUniqueEntrances": "UnikátnÃch navÅ¡tÃvenà stránky", + "ColumnUniqueEntrances": "UnikátnÃch vstupů", "ColumnUniqueExits": "UnikátnÃch opuÅ¡tÄ›nà stránky", "ColumnUniquePageviews": "JedineÄná zobrazenà stránek", "ColumnUniquePageviewsDocumentation": "PoÄet návÅ¡tÄ›vnÃků, kteřà navÅ¡tÃvily tuto stránku. Pokud byla tato stránka navÅ¡tÃvena nÄ›kolikrát, návÅ¡tÄ›va je zapoÄÃtána jen jednou.", "ColumnValuePerVisit": "Hodnota za návÅ¡tÄ›vu", "ColumnViewedAfterSearch": "Kliknuto ve výsledcÃch vyhledávánÃ", - "ColumnViewedAfterSearchDocumentation": "ePoÄet návÅ¡tÄ›v této stránky poté, co návÅ¡tÄ›vnÃk provedl vyhledávánà a kliknul na tuto stránku.", + "ColumnViewedAfterSearchDocumentation": "PoÄet návÅ¡tÄ›v této stránky poté, co návÅ¡tÄ›vnÃk provedl vyhledávánà a kliknul na tuto stránku.", "ColumnVisitDuration": "Doba návÅ¡tÄ›vy (v sekundách)", "ColumnVisitsWithConversions": "NávÅ¡tÄ›vy s pÅ™echodem", "ConfigFileIsNotWritable": "KonfiguraÄnà soubor Piwiku %s nenà zapisovatelný, nÄ›které zmÄ›ny nebudou uloženy. %s ProsÃm upravte oprávnÄ›nà ke konfiguraÄnÃmu souboru", @@ -121,15 +121,15 @@ "Desktop": "Desktop", "Details": "Detaily", "Discount": "Sleva", - "DisplaySimpleTable": "Zobrazit jednotuchou tabulku", + "DisplaySimpleTable": "Zobrazit jednoduchou tabulku", "DisplayTableWithGoalMetrics": "Zobrazit tabulku s měřenÃm cÃlů", "DisplayTableWithMoreMetrics": "Zobrazit tabulku s vÃce měřenÃmi", "Documentation": "Dokumentace", "Donate": "PÅ™ispÄ›jte", "Done": "Hotovo", "Download": "Stáhnout", - "DownloadFail_FileExists": "Sobor %s již existuje!", - "DownloadFail_FileExistsContinue": "Pokus o pokraÄovánà stahovánà %s, ale celý stažený soubor už existuje!", + "DownloadFail_FileExists": "Soubor %s již existuje!", + "DownloadFail_FileExistsContinue": "Pokus o pokraÄovánà stahovánà %s, ale celý stažený soubor již existuje!", "DownloadFail_HttpRequestFail": "NepodaÅ™ilo se stáhnout soubor. NÄ›co může být v nepořádku se stránkou, z nÞ byl soubor stahován. Můžete to zkusit pozdÄ›ji nebo můžete soubor stáhnout sami.", "DownloadFullVersion": "%1$sStáhnout%2$s plnou verzi! PodÃvejte se na %3$s", "DownloadPleaseRemoveExisting": "Pokud to chcete nahradit, odstraňte stávajÃcà soubor.", @@ -138,7 +138,7 @@ "EcommerceVisitStatusDesc": "Stav elektronického obchodu na konci návÅ¡tÄ›vy", "EcommerceVisitStatusEg": "NapÅ™Ãklad pro výbÄ›r vÅ¡ech návÅ¡tÄ›v, které obsahujà elektronickou objednávku, API požadavek by byl %s", "Edit": "Upravit", - "EncryptedSmtpTransport": "Zadejte Å¡ifrovánà transportvnà vrsty vyžadované vaÅ¡Ãm SMTP serverem.", + "EncryptedSmtpTransport": "Zadejte Å¡ifrovánà transportnà vrstvy vyžadované vaÅ¡Ãm SMTP serverem.", "EnglishLanguageName": "Czech", "Error": "Chyba", "ErrorRequest": "Ajaj! PÅ™i požadavku doÅ¡lo k chybÄ›. Na serveru mohlo dojÃt k doÄasnému problému, nebo jste požádali o hlášenà s pÅ™ÃliÅ¡ mnoha daty. ProsÃm, zkuste to znovu. Pokud se bude problém opakovat, %skontaktujte svého administrátora Piwiku%s.", @@ -150,7 +150,7 @@ "ExceptionFileIntegrity": "Test integrity selhal: %s", "ExceptionFilesizeMismatch": "Nesouhlasà velikost souboru: %1$s (oÄekávaná délka: %2$s, nalezeno: %3$s)", "ExceptionIncompatibleClientServerVersions": "VaÅ¡e %1$s verze klienta je %2$s tato je ale nekompatibilnà se serverem %3$s.", - "ExceptionInvalidAggregateReportsFormat": "Agregovaný formát hlášený %s nenà platný. Zkuste mÃsto toho nÄ›jaký z %s.", + "ExceptionInvalidAggregateReportsFormat": "Agregovaný formát hlášenà %s nenà platný. Zkuste mÃsto toho nÄ›jaký z %s.", "ExceptionInvalidArchiveTimeToLive": "DneÅ¡nà doba života archivu musà být ÄÃslo vÄ›tÅ¡Ã než nula", "ExceptionInvalidDateFormat": "Formát data musà být: %s nebo klÃÄové slovo podporované funkcà %s (vÃce informacà viz %s)", "ExceptionInvalidDateRange": "Datum '%s' nenà v platném rozmezÃ. Může mÃt následujÃcà formát: %s.", @@ -233,7 +233,7 @@ "LongMonth_7": "ÄŒervenec", "LongMonth_8": "Srpen", "LongMonth_9": "ZářÃ", - "MainMetrics": "Vlastnà měřenÃ", + "MainMetrics": "Hlavnà metriky", "Matches": "Shody", "MediumToHighTrafficItIsRecommendedTo": "Pro weby se stÅ™ednÃm, nebo velkým provozem doporuÄujeme zpracovat dneÅ¡nà hlášenà každou půlhodinu (%s vteÅ™in), nebo každou hodinu (%s vteÅ™in)", "Metadata": "Meta data", @@ -314,14 +314,14 @@ "Plugins": "Zásuvné moduly", "PoweredBy": "Běžà na", "Previous": "PÅ™edchozÃ", - "PreviousDays": "pÅ™edeÅ¡lých %s dnà (kromÄ› dneÅ¡ka)", + "PreviousDays": "pÅ™edeÅ¡lých %s dnů (kromÄ› dneÅ¡ka)", "PreviousDaysShort": "PÅ™edchozÃch %s dnů", "Price": "Cena", "ProductConversionRate": "Konverznà pomÄ›r", "ProductRevenue": "Hodnota produktu", "PurchasedProducts": "Zakoupené produkty", "Quantity": "MnožstvÃ", - "RangeReports": "Upravit rozmezà dnÃ", + "RangeReports": "Vlastnà rozsahy dat", "ReadThisToLearnMore": "%1$sPokud se chcete dozvÄ›dÄ›t vÃce, pÅ™eÄtÄ›te si toto.%2$s", "Recommended": "(doporuÄuje se)", "RecordsToPlot": "Záznamy k vykreslenÃ", @@ -375,7 +375,7 @@ "ShortMonth_8": "Srp", "ShortMonth_9": "Zář", "Show": "zobrazit", - "SingleWebsitesDashboard": "NástÄ›nka jednÄ›ch stránek", + "SingleWebsitesDashboard": "NástÄ›nka pro jedny stránek", "SmallTrafficYouCanLeaveDefault": "Pro weby s malým provozem můžete ponechat výchozÃch %s sekund a uvidÃte vÅ¡echna hlášenà v reálném Äase", "SmtpEncryption": "SMTP Å¡ifrovánÃ", "SmtpPassword": "Heslo SMTP", @@ -411,9 +411,9 @@ "View": "Zobrazit", "ViewDocumentationFor": "Zobrazit dokumentaci pro %1$s", "Visit": "NávÅ¡tÄ›va", - "VisitConvertedGoal": "NávÅ¡tÄ›va, která pÅ™evedla alespoň jeden CÃl.", - "VisitConvertedGoalId": "NávÅ¡tÄ›va, která pÅ™evedla konkrétnà ID CÃl.", - "VisitConvertedNGoals": "NávstÄ›va pÅ™evedla %s CÃlů.", + "VisitConvertedGoal": "NávÅ¡tÄ›va, která provedla alespoň jednu konverzi CÃle.", + "VisitConvertedGoalId": "NávÅ¡tÄ›va, která provedla konverzi konkrétnÃho ID CÃle.", + "VisitConvertedNGoals": "NávÅ¡tÄ›va provedla %s konverzà CÃlůb.", "VisitDuration": "PrůmÄ›rná doba trvánà návÅ¡tÄ›v (v sekundách)", "Visitor": "NávÅ¡tÄ›vnÃk", "VisitorID": "ID návÅ¡tÄ›vnÃka", @@ -421,7 +421,7 @@ "Visitors": "NávÅ¡tÄ›vnÃci", "VisitsWith": "NávÅ¡tÄ›v s %s", "VisitType": "Typ návÅ¡tÄ›vnÃka", - "VisitTypeExample": "NapÅ™Ãklad pro výbÄ›r vÅ¡ech návÅ¡tÄ›vnÃků, kteřà se vrátili na stránky vÄetnÄ› tÄ›ch, co si v pÅ™edcchozÃch návÅ¡tÄ›vách nÄ›co koupili, API požadavek by obsahoval %s", + "VisitTypeExample": "NapÅ™Ãklad pro výbÄ›r vÅ¡ech návÅ¡tÄ›vnÃků, kteřà se vrátili na stránky vÄetnÄ› tÄ›ch, co si v pÅ™edcchozÃch návÅ¡tÄ›vách nÄ›co koupili, by API požadavek obsahoval %s", "Warning": "VarovánÃ", "WarningFileIntegrityNoManifest": "Test integrity nemůže být proveden z důvodů chybÄ›jÃcÃho souboru manifest.inc.php.", "WarningFileIntegrityNoManifestDeployingFromGit": "Pokud nasazujete Piwik z Gitu, pak je tato zpráva normálnÃ.", diff --git a/misc/composer/build-xhprof.sh b/misc/composer/build-xhprof.sh index 95057dc26e48382c1dc0cfff1859898a4c31e0fc..517d228d0bc3dfa2d54e8abedd99c5b061b95d98 100755 --- a/misc/composer/build-xhprof.sh +++ b/misc/composer/build-xhprof.sh @@ -11,6 +11,11 @@ if ! type make &> /dev/null; then exit fi +if ! [ -d "vendor/facebook/xhprof/extension" ]; then + echo "xhprof missing, skipping build" + exit +fi + mkdir -p tmp/xhprof-logs cd vendor/facebook/xhprof/extension diff --git a/misc/log-analytics/README.md b/misc/log-analytics/README.md index 7842da798a4f8bd4a869afe429f7510e40a65905..6c4aadf675220451366615d31a3278da007280b5 100644 --- a/misc/log-analytics/README.md +++ b/misc/log-analytics/README.md @@ -249,5 +249,19 @@ exec python /path/to/misc/log-analytics/import_logs.py \ --log-format-name=nginx_json - ``` +# regex example for syslog format (centralized logs) + +## log format exemple + +``` +Aug 31 23:59:59 tt-srv-name www.tt.com: 1.1.1.1 - - [31/Aug/2014:23:59:59 +0200] "GET /index.php HTTP/1.0" 200 3838 "http://www.tt.com/index.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0" 365020 www.tt.com +``` + +## Corresponding regex + +``` +--log-format-regex='.* ((?P<ip>\S+) \S+ \S+ \[(?P<date>.*?) (?P<timezone>.*?)\] "\S+ (?P<path>.*?) \S+" (?P<status>\S+) (?P<length>\S+) "(?P<referrer>.*?)" "(?P<user_agent>.*?)").*' +``` + And that's all ! diff --git a/plugins/API/Menu.php b/plugins/API/Menu.php index 0020ecf1c4cd897ab03371767b0ad57e771eea8c..b01c686ac0432ad6c5f142aaa553779ac2e70a9f 100644 --- a/plugins/API/Menu.php +++ b/plugins/API/Menu.php @@ -26,7 +26,7 @@ class Menu extends \Piwik\Plugin\Menu public function configureUserMenu(MenuUser $menu) { - $apiUrlParams = array('module' => 'API', 'action' => 'listAllAPI', 'segment' => false); + $apiUrlParams = $this->urlForAction('listAllAPI', array('segment' => false)); $tooltip = Piwik::translate('API_TopLinkTooltip'); $menu->addPlatformItem('General_API', $apiUrlParams, 6, $tooltip); @@ -45,8 +45,14 @@ class Menu extends \Piwik\Plugin\Menu $ua = new OperatingSystem($_SERVER['HTTP_USER_AGENT']); $ua->setCache(new DeviceDetectorCache('tracker', 86400)); $parsedOS = $ua->parse(); + if (!empty($parsedOS['short_name']) && in_array($parsedOS['short_name'], array(self::DD_SHORT_NAME_ANDROID, self::DD_SHORT_NAME_IOS))) { - $menu->add('Piwik Mobile App', null, array('module' => 'Proxy', 'action' => 'redirect', 'url' => 'http://piwik.org/mobile/'), true, 4); + + $url = $this->urlForModuleAction('Proxy', 'redirect', array('url' => 'http://piwik.org/mobile/')); + + if ($url) { + $menu->addItem('Piwik Mobile App', null, $url, 4); + } } } diff --git a/plugins/Actions/Menu.php b/plugins/Actions/Menu.php index 8804fabe0d0d55de3931951f9c0a05a64d916354..e9ce436b75a4ecf978b907c6e8fb1a421b6447f0 100644 --- a/plugins/Actions/Menu.php +++ b/plugins/Actions/Menu.php @@ -14,16 +14,11 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $urlParams = array( - 'module' => 'Actions', - 'action' => 'menuGetPageUrls' - ); - - $menu->addActionsItem('', $urlParams, 15); + $menu->addActionsItem('', $this->urlForAction('menuGetPageUrls'), 15); $actions = new Actions(); if ($actions->isSiteSearchEnabled()) { - $menu->addActionsItem('Actions_SubmenuSitesearch', array('module' => 'Actions', 'action' => 'indexSiteSearch'), 5); + $menu->addActionsItem('Actions_SubmenuSitesearch', $this->urlForAction('indexSiteSearch'), 5); } } diff --git a/plugins/Actions/lang/cs.json b/plugins/Actions/lang/cs.json index 49e5ab193d36c098ae8b52b2fbcf598e4b646282..4c07889cd43bfc9a31e57fe5299a4254501401d7 100644 --- a/plugins/Actions/lang/cs.json +++ b/plugins/Actions/lang/cs.json @@ -30,7 +30,7 @@ "EntryPageTitles": "Titulky vstupnÃch stránek", "EntryPageTitlesReportDocumentation": "Toto hlášenà obsahuje informace o titulcÃch vstupnÃch stránek, které byly použity v daném obdobÃ.", "ExitPagesReportDocumentation": "Toto hlášenà obsahuje informace o výstupnÃch stránkách, které se vyskytly v daném obdobÃ. Výstupnà stránka je poslednà stránkou, kterou uživatel zobrazà bÄ›hem své návÅ¡tÄ›vy. %s URL výstupnÃch stránek jsou zobrazeny jako strom složek.", - "ExitPageTitles": "Výstupnà titulky stránky", + "ExitPageTitles": "Titulky výstupnÃch stránek", "ExitPageTitlesReportDocumentation": "Toto hlášenà obsahuje informace o titulcÃch výstupnÃch stránek za dané obdobÃ.", "LearnMoreAboutSiteSearchLink": "ZjistÄ›te vÃce o sledovánà toho, jak návÅ¡tÄ›vnÃci použÃvaà váš vyhledávaÄ.", "OneSearch": "1 VyhledávánÃ", diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php index cbf36ae0940cbbee883658fb5e75327a77b5e1a4..6886b0d336e64e37cd3bcc4887ab4cc19709bc35 100644 --- a/plugins/CoreAdminHome/Controller.php +++ b/plugins/CoreAdminHome/Controller.php @@ -259,11 +259,14 @@ class Controller extends \Piwik\Plugin\ControllerAdmin ? $language : LanguagesManager::getLanguageCodeForCurrentUser(); - return $this->renderTemplate('optOut', array( - 'trackVisits' => $trackVisits, - 'nonce' => Nonce::getNonce('Piwik_OptOut', 3600), - 'language' => $lang - )); + // should not use self::renderTemplate since that uses setBasicVariablesView. this will cause + // an error when setBasicVariablesAdminView is called, and MenuTop is requested (the idSite query + // parameter is required) + $view = new View("@CoreAdminHome/optOut"); + $view->trackVisits = $trackVisits; + $view->nonce = Nonce::getNonce('Piwik_OptOut', 3600); + $view->language = $lang; + return $view->render(); } public function uploadCustomLogo() diff --git a/plugins/CoreAdminHome/Menu.php b/plugins/CoreAdminHome/Menu.php index 368a470fff5cd9e6ebc73214cacf9ed05fb162a3..7926ff9cf58dd1e91639153126d857c3d2f1209b 100644 --- a/plugins/CoreAdminHome/Menu.php +++ b/plugins/CoreAdminHome/Menu.php @@ -27,16 +27,16 @@ class Menu extends \Piwik\Plugin\Menu $menu->addDevelopmentItem(null, "", $order = 15); $menu->addSettingsItem('CoreAdminHome_MenuGeneralSettings', - array('module' => 'CoreAdminHome', 'action' => 'generalSettings'), + $this->urlForAction('generalSettings'), $order = 6); $menu->addManageItem('CoreAdminHome_TrackingCode', - array('module' => 'CoreAdminHome', 'action' => 'trackingCodeGenerator'), + $this->urlForAction('trackingCodeGenerator'), $order = 4); } if (SettingsManager::hasPluginsSettingsForCurrentUser()) { $menu->addSettingsItem('CoreAdminHome_PluginSettings', - array('module' => 'CoreAdminHome', 'action' => 'pluginSettings'), + $this->urlForAction('pluginSettings'), $order = 7); } } diff --git a/plugins/CoreConsole/Commands/ClearCaches.php b/plugins/CoreConsole/Commands/ClearCaches.php new file mode 100644 index 0000000000000000000000000000000000000000..35d96917066870442cb72e8cbc1e2952af41c741 --- /dev/null +++ b/plugins/CoreConsole/Commands/ClearCaches.php @@ -0,0 +1,37 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ + +namespace Piwik\Plugins\CoreConsole\Commands; + +use Piwik\Filesystem; +use Piwik\Plugin\ConsoleCommand; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + */ +class ClearCaches extends ConsoleCommand +{ + protected function configure() + { + $this->setName('core:clear-caches'); + $this->setDescription('Cleares all caches. This command can be useful for instance after updating Piwik files manually.'); + } + + /** + * Execute command like: ./console core:clear-caches + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + Filesystem::deleteAllCacheOnUpdate(); + + $this->writeSuccessMessage($output, array('Caches cleared')); + } +} diff --git a/plugins/CoreConsole/Commands/GeneratePlugin.php b/plugins/CoreConsole/Commands/GeneratePlugin.php index 1dddca9b6545ef1f8854891c40d1f165e2a1ca85..2c78036be205a78dd67d86ce739f16e4a9c15435 100644 --- a/plugins/CoreConsole/Commands/GeneratePlugin.php +++ b/plugins/CoreConsole/Commands/GeneratePlugin.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\CoreConsole\Commands; use Piwik\Filesystem; +use Piwik\Version; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -45,7 +46,8 @@ class GeneratePlugin extends GeneratePluginBase $replace = array( 'ExampleTheme' => $pluginName, 'ExampleDescription' => $description, - '0.1.0' => $version + '0.1.0' => $version, + 'PIWIK_VERSION' => Version::VERSION ); $whitelistFiles = array(); @@ -55,7 +57,8 @@ class GeneratePlugin extends GeneratePluginBase $replace = array( 'ExamplePlugin' => $pluginName, 'ExampleDescription' => $description, - '0.1.0' => $version + '0.1.0' => $version, + 'PIWIK_VERSION' => Version::VERSION ); $whitelistFiles = array( '/ExamplePlugin.php', diff --git a/plugins/CorePluginsAdmin/Menu.php b/plugins/CorePluginsAdmin/Menu.php index cd056720d5b3a59066b266bb06633563a72f6b1a..8279afcc73f7e5a9a22ef328bde94f3414c4b67c 100644 --- a/plugins/CorePluginsAdmin/Menu.php +++ b/plugins/CorePluginsAdmin/Menu.php @@ -46,16 +46,16 @@ class Menu extends \Piwik\Plugin\Menu if ($hasSuperUserAcess) { $menu->addPlatformItem(Piwik::translate('General_Plugins') . $pluginsUpdateMessage, - array('module' => 'CorePluginsAdmin', 'action' => 'plugins', 'activated' => ''), + $this->urlForAction('plugins', array('activated' => '')), $order = 1); $menu->addPlatformItem(Piwik::translate('CorePluginsAdmin_Themes') . $themesUpdateMessage, - array('module' => 'CorePluginsAdmin', 'action' => 'themes', 'activated' => ''), + $this->urlForAction('themes', array('activated' => '')), $order = 3); } if ($this->isAllowedToSeeMarketPlace()) { $menu->addPlatformItem('CorePluginsAdmin_Marketplace', - array('module' => 'CorePluginsAdmin', 'action' => 'extend', 'activated' => ''), + $this->urlForAction('extend', array('activated' => '')), $order = 5); } @@ -73,8 +73,8 @@ class Menu extends \Piwik\Plugin\Menu { if ($this->isAllowedToSeeMarketPlace()) { $menu->addPlatformItem('CorePluginsAdmin_Marketplace', - array('module' => 'CorePluginsAdmin', 'action' => 'browsePlugins', 'activated' => ''), - $order = 5); + $this->urlForAction('browsePlugins', array('activated' => '')), + $order = 5); } } } diff --git a/plugins/CoreUpdater/lang/cs.json b/plugins/CoreUpdater/lang/cs.json index 6a92dbd5117cf6e1165394a742f02536f27f4126..576d0cf93b83fafdb3c6768da48a0207a1800103 100644 --- a/plugins/CoreUpdater/lang/cs.json +++ b/plugins/CoreUpdater/lang/cs.json @@ -1,6 +1,6 @@ { "CoreUpdater": { - "ClickHereToViewSqlQueries": "KliknÄ›te zde, abyste vidÄ›li a zkopÃrovali SQL dotazy, které majà být spuÅ¡tÄ›ny", + "ClickHereToViewSqlQueries": "KliknÄ›te zde pro zobrazenà SQL dotazů s možnostà je zkopÃrovat, které majà být spuÅ¡tÄ›ny", "CreatingBackupOfConfigurationFile": "VytvářÃm zálohu konfiguraÄnÃho souboru v %s", "CriticalErrorDuringTheUpgradeProcess": "PÅ™i aktualizaci nastala kritická chyba:", "DatabaseUpgradeRequired": "Vyžadováno povýšenà databáze", @@ -20,13 +20,13 @@ "ExceptionArchiveIncompatible": "Nekompatibilnà archiv: %s", "ExceptionArchiveIncomplete": "Archiv je nekompletnÃ: nÄ›které soubory chybà (napÅ™.: %s).", "FeedbackRequest": "Zde můžete s týmem Piwiku sdÃlet nápady a návrhy:", - "HelpMessageContent": "Zkontrolujte %1$s Piwik FAQ %2$s , který vysvÄ›tluje nejÄastÄ›jsà chybi pÅ™i aktualizaci. %3$s Požádejte vaÅ¡eho systémového administrátora - může vám pomoct s chybou, která je nejÄastÄ›ji způsobena nastavenÃm serveru MySQL.", + "HelpMessageContent": "Zkontrolujte %1$s Piwik FAQ %2$s , kde jsou vysvÄ›tleny nejÄastÄ›jÅ¡Ã chybi pÅ™i aktualizaci. %3$s Požádejte vaÅ¡eho systémového administrátora - může vám pomoct s chybou, která je nejÄastÄ›ji způsobena nastavenÃm serveru MySQL.", "HelpMessageIntroductionWhenError": "NÞe je hlavnà chybová hláška. Pomůže vám zjistit pÅ™ÃÄinu, ale pokud budete potÅ™ebovat dalÅ¡Ã pomoc:", "HelpMessageIntroductionWhenWarning": "Aktualizace probÄ›hla v pořádku, ale byly zaznamenány problémy. ProsÃm pÅ™eÄtÄ›te si jejich popis výše. Pro dalÅ¡Ã pomoc:", "HighTrafficPiwikServerEnableMaintenance": "Pokud provozujete Piwik server s velkým provozem, doporuÄujeme %sna chvÃli zakázat sledovánà návÅ¡tÄ›vnÃků a pÅ™epnout uživatelské rozhranà do režimu údržby%s.", "IncompatbilePluginsWillBeDisabledInfo": "Poznámka: NÄ›které zásuvné moduly nejsou kompatibilnà s Piwikem %s. Budou zakázány pÅ™i aktualizaci:", "InstallingTheLatestVersion": "Instaluji poslednà verzi", - "MajorUpdateWarning1": "Toto je důležitá aktualizace! Zabere vÃce Äasu, než obvykle.", + "MajorUpdateWarning1": "Toto je velká aktualizace! Zabere vÃce Äasu, než obvykle.", "MajorUpdateWarning2": "NásledujÃcà doporuÄenà je pÅ™edevÅ¡Ãm důležité pro velké instalace.", "NoteForLargePiwikInstances": "Důležitá poznámka pro rozsáhlé instalace Piwiku", "NoteItIsExpectedThatQueriesFail": "Poznámka: Pokud budete SQL dotazy spouÅ¡tÄ›t ruÄnÄ›, nÄ›které z nich selžou. V tom pÅ™ÃpadÄ› chyby jednoduÅ¡e ignorujte a spusÅ¥te dalÅ¡Ã dotazy", @@ -47,8 +47,8 @@ "TheUpgradeProcessMayTakeAWhilePleaseBePatient": "Aktualizace databáze může chvÃli trvat, buÄte prosÃm trpÄ›livÃ.", "UnpackingTheUpdate": "Rozbaluji aktualizaci", "UpdateAutomatically": "Aktualizovat automaticky", - "UpdateHasBeenCancelledExplanation": "One Click aktualizace Piwiku byla stornována. Pokud nemůžete opravit chybu je doporuÄeno Piwik aktualizovat manuálnÄ›. %1$s ProsÃm zkontrolujte pro zaÄátek %2$sDokumentaci k aktualizaci%3$s!", - "UpdateTitle": "Piwik › Update", + "UpdateHasBeenCancelledExplanation": "One Click aktualizace Piwiku byla zruÅ¡ena. Pokud nemůžete opravit chybu je doporuÄeno Piwik aktualizovat manuálnÄ›. %1$s ProsÃm zkontrolujte nejdÅ™Ãve %2$sdokumentaci k aktualizaci%3$s!", + "UpdateTitle": "Aktualizovat", "UpgradeComplete": "Aktualizace je kompletnÃ!", "UpgradePiwik": "Aktualizovat Piwik", "VerifyingUnpackedFiles": "Ověřuji rozbalené soubory", @@ -57,6 +57,6 @@ "YouCanUpgradeAutomaticallyOrDownloadPackage": "Můžete aktualizovat na verzi %s automaticky, nebo si stáhnÄ›te balÃÄek a nainstalujte jej manuálnÄ›:", "YouCouldManuallyExecuteSqlQueries": "Pokud nemůžete použÃt aktualizaci z pÅ™Ãkazového řádku a Piwik nelze aktualizovat (dÃky vyprÅ¡enà Äasového limitu v databázi, prohlÞeÄi, nebo z jakéhokoliv jiného důvodu), můžete spustit SQL dotazy ruÄnÄ›", "YouMustDownloadPackageOrFixPermissions": "Piwik nemůže pÅ™epsat VaÅ¡i stávajÃcà instalaci. Můžete buÄ opravit oprávnÄ›nà k adresářům\/souborům, nebo stáhnout balÃÄek a nainstalovat verzi %s ruÄnÄ›", - "YourDatabaseIsOutOfDate": "VaÅ¡e databáze Piwiku je zastaralá a musà být aktualizována než budete pokraÄovat." + "YourDatabaseIsOutOfDate": "VaÅ¡e databáze Piwiku je zastaralá a musà být aktualizována, než budete pokraÄovat." } } \ No newline at end of file diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts index c467c059942e0c4331e79d547c4e3acb4bbd0fa1..825e948c4e3a7b5f8800639d3617998aea88e1e1 160000 --- a/plugins/CustomAlerts +++ b/plugins/CustomAlerts @@ -1 +1 @@ -Subproject commit c467c059942e0c4331e79d547c4e3acb4bbd0fa1 +Subproject commit 825e948c4e3a7b5f8800639d3617998aea88e1e1 diff --git a/plugins/DBStats/Menu.php b/plugins/DBStats/Menu.php index 50f7b8a047a19d3ee0ca8f4ffaa7d25171aaba48..a52b9bd2fd6b843cfae192bfeeb637c9d6bfed53 100644 --- a/plugins/DBStats/Menu.php +++ b/plugins/DBStats/Menu.php @@ -19,7 +19,7 @@ class Menu extends \Piwik\Plugin\Menu { if (Piwik::hasUserSuperUserAccess()) { $menu->addDiagnosticItem('DBStats_DatabaseUsage', - array('module' => 'DBStats', 'action' => 'index'), + $this->urlForAction('index'), $order = 6); } } diff --git a/plugins/DBStats/lang/cs.json b/plugins/DBStats/lang/cs.json index a74efdea5c75440af443ec5b669dad4fbd1b93d9..d6504b9f1fe9ea74e23d86eebc61f81ea9882460 100644 --- a/plugins/DBStats/lang/cs.json +++ b/plugins/DBStats/lang/cs.json @@ -7,9 +7,9 @@ "IndexSize": "Velikost indexu", "LearnMore": "Abyste lépe zjistili, jak Piwik zpracovává data a jak jej nastavit pro weby se stÅ™ednÃm a velkým provozem, podÃvejte se do dokumentace %s.", "MainDescription": "Piwik ukládá vÅ¡echny vaÅ¡e data webové analýzy v MySQL databázi. Nynà tabulky Piwiku využÃvajà %s.", - "MetricDataByYear": "Měřenà tabulek za rok", - "MetricTables": "Měřené tabulky", - "OtherTables": "Osttanà tabulky", + "MetricDataByYear": "Tabulky metrik za rok", + "MetricTables": "Tabulky metrik", + "OtherTables": "Ostatnà tabulky", "PluginDescription": "Tento zásuvný modul hlásà využità databáze MySQL tabulkami Piwiku", "ReportDataByYear": "Hlášenà tabulek za rok", "ReportTables": "Hlášenà tabulek", diff --git a/plugins/Dashboard/Menu.php b/plugins/Dashboard/Menu.php index 2549021fc748a2ae5ca2334160404fb36e2cc6f0..2ee0521623026145354bf34dc2f47ac26be6545c 100644 --- a/plugins/Dashboard/Menu.php +++ b/plugins/Dashboard/Menu.php @@ -21,7 +21,7 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->add('Dashboard_Dashboard', '', array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => 1), true, 5); + $menu->addItem('Dashboard_Dashboard', '', $this->urlForAction('embeddedIndex', array('idDashboard' => 1)), 5); if (!Piwik::isUserIsAnonymous()) { $login = Piwik::getCurrentUserLogin(); @@ -31,7 +31,7 @@ class Menu extends \Piwik\Plugin\Menu $pos = 0; foreach ($dashboards as $dashboard) { - $menu->add('Dashboard_Dashboard', $dashboard['name'], array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => $dashboard['iddashboard']), true, $pos); + $menu->addItem('Dashboard_Dashboard', $dashboard['name'], $this->urlForAction('embeddedIndex', array('idDashboard' => $dashboard['iddashboard'])), $pos); $pos++; } } @@ -44,13 +44,9 @@ class Menu extends \Piwik\Plugin\Menu $tooltip = Piwik::translate('Dashboard_TopLinkTooltip', Site::getNameFor($idSite)); - $urlParams = array( - 'module' => 'CoreHome', - 'action' => 'index', - 'idSite' => $idSite, - ); + $urlParams = $this->urlForModuleAction('CoreHome', 'index', array('idSite' => $idSite)) ; - $menu->add('Dashboard_Dashboard', null, $urlParams, true, 1, $tooltip); + $menu->addItem('Dashboard_Dashboard', null, $urlParams, 1, $tooltip); } } diff --git a/plugins/Dashboard/lang/cs.json b/plugins/Dashboard/lang/cs.json index deac55f05bae22dfd217064cc2b75a32017c1837..bbca664ea2c12d3adeec25d1e3bf8214923e7257 100644 --- a/plugins/Dashboard/lang/cs.json +++ b/plugins/Dashboard/lang/cs.json @@ -6,28 +6,28 @@ "CopyDashboardToUser": "ZkopÃrovat pÅ™ehled uživateli", "CreateNewDashboard": "VytvoÅ™it novou nástÄ›nku", "Dashboard": "NástÄ›nka", - "DashboardCopied": "PÅ™ehled byl úspěšnÄ› nakopÃrován vybranému uživateli.", + "DashboardCopied": "PÅ™ehled byl úspěšnÄ› zkopÃrován vybranému uživateli.", "DashboardEmptyNotification": "VaÅ¡e nástÄ›nka neobsahuje žádné widgety. NÄ›jaké pÅ™idejte, nebo obnovte výchozà výbÄ›r widgetů na nástÄ›nce.", "DashboardName": "Jméno nástÄ›nky:", "DashboardOf": "NástÄ›nka %s", "DefaultDashboard": "Výchozà nástÄ›nka - použÃváte výchozà rozvrženà nástÄ›nky", - "DeleteWidgetConfirm": "Jste si jistÃ, že chcete odstranit tento widget z nástÄ›nky?", + "DeleteWidgetConfirm": "Opravdu chcete odstranit tento widget z nástÄ›nky?", "EmptyDashboard": "Prázdná nástÄ›nka - vyberte si své oblÃbené widgety", "LoadingWidget": "NaÄÃtám widget, prosÃm Äekejte...", "ManageDashboard": "Správa nástÄ›nky", "Maximise": "Maximalizovat", "Minimise": "Minimalizovat", - "NotUndo": "Nemůžete vrátit zpÄ›t tuto operaci.", - "PluginDescription": "Váše nástÄ›nka analýzy Web stránek. Můžete si jà upravit: pÅ™idat nové widgety, zmÄ›nit jejich poÅ™adÃ. Každý uživatel pÅ™istupuje ke své vlastnà nástÄ›ncei", + "NotUndo": "Tuto operaci nemůžete vrátit zpÄ›t.", + "PluginDescription": "VaÅ¡e nástÄ›nka webové analýzy. Můžete si ji upravit: pÅ™idat nové widgety, zmÄ›nit jejich poÅ™adÃ. Každý uživatel pÅ™istupuje ke své vlastnà nástÄ›nce.", "RemoveDashboard": "Odstranit nástÄ›nku", "RemoveDashboardConfirm": "Opravdu chcete odstranit nástÄ›nku: %s?", "RenameDashboard": "PÅ™ejmenovat nástÄ›nku", "ResetDashboard": "Obnovit nástÄ›nku", "ResetDashboardConfirm": "Opravdu chcete obnovit nastavenà nástÄ›nky do továrnÃho stavu?", - "SelectDashboardLayout": "ProsÃm vyberte nové rozvrženà návÅ¡tÄ›nky", + "SelectDashboardLayout": "ProsÃm vyberte nové rozvrženà nástÄ›nky", "SelectWidget": "Zvolte widget pro pÅ™idánà na nástÄ›nku", "SetAsDefaultWidgets": "Nastavit výchozà výbÄ›r widgetů", - "SetAsDefaultWidgetsConfirm": "Opravdu chcete nastavit toto rozvrženà widgetů jako výchozà rozvrženÃ?", + "SetAsDefaultWidgetsConfirm": "Opravdu chcete nastavit toto rozvrženà widgetů jako výchozÃ?", "SetAsDefaultWidgetsConfirmHelp": "Tyto widgety a jejich rozvrženà budou použity vždy, když nÄ›kdo vytvořà novou nástÄ›nku nebo použije vlastnost %s.", "TopLinkTooltip": "Zobraz analytické hlášenà webu pro %s.", "WidgetNotFound": "Widget nenalezen", diff --git a/plugins/DevicesDetection/Menu.php b/plugins/DevicesDetection/Menu.php index e37c62e75f93894645e96242ba374ca4fedbe82d..797f9886249814b39b279cda157105e5f07f309c 100644 --- a/plugins/DevicesDetection/Menu.php +++ b/plugins/DevicesDetection/Menu.php @@ -20,13 +20,13 @@ class Menu extends \Piwik\Plugin\Menu { if (Piwik::isUserHasSomeAdminAccess()) { $menu->addDiagnosticItem('DevicesDetection_DeviceDetection', - array('module' => 'DevicesDetection', 'action' => 'deviceDetection'), + $this->urlForAction('deviceDetection'), $order = 40); } } public function configureReportingMenu(MenuReporting $menu) { - $menu->addVisitorsItem('DevicesDetection_submenu', array('module' => 'DevicesDetection', 'action' => 'index')); + $menu->addVisitorsItem('DevicesDetection_submenu', $this->urlForAction('index')); } } diff --git a/plugins/DevicesDetection/lang/cs.json b/plugins/DevicesDetection/lang/cs.json index 381ca725d2d5de9e916163bc891400e06ea40b3e..a15d7cac58a001f430356d318b9f8287e25ea858 100644 --- a/plugins/DevicesDetection/lang/cs.json +++ b/plugins/DevicesDetection/lang/cs.json @@ -5,7 +5,7 @@ "CarBrowser": "ProhlÞeÄ v autÄ›", "Console": "Konzole", "dataTableLabelBrands": "ZnaÄka", - "dataTableLabelBrowserFamily": "Rodina prohlÞeÄe", + "dataTableLabelBrowserFamily": "Rodina prohlÞeÄů", "dataTableLabelModels": "Model", "dataTableLabelSystemVersion": "Verze operaÄnÃho systému", "dataTableLabelTypes": "Typ", @@ -18,7 +18,7 @@ "FeaturePhone": "Ukázkový telefon", "OperatingSystemFamilies": "Rodiny operaÄnÃch systémů", "OperatingSystemVersions": "Verze operaÄnÃho systému", - "PluginDescription": "Tento zásuvný modul poskytuje rozÅ¡ÃÅ™ené informace o mobilnÃch iaÅ™ÃzenÃch, jako napÅ™. výrobce, model (verze zaÅ™ÃzenÃ), vylepÅ¡enou detekci typu zaÅ™Ãzenà (TV, konzole, Chytré telefony, PC) a dalÅ¡Ã. Tento zásuvný modul pÅ™idává nové hlášenà v sekci návÅ¡tÄ›vnÃci > zaÅ™ÃzenÃ.", + "PluginDescription": "Tento zásuvný modul poskytuje rozÅ¡ÃÅ™ené informace o mobilnÃch zaÅ™ÃzenÃch, jako napÅ™. výrobce, model (verze zaÅ™ÃzenÃ), vylepÅ¡enou detekci typu zaÅ™Ãzenà (TV, konzole, Chytré telefony, PC) a dalÅ¡Ã. Tento zásuvný modul pÅ™idává nové hlášenà v sekci návÅ¡tÄ›vnÃci > zaÅ™ÃzenÃ.", "SmartDisplay": "Chytrý displej", "Smartphone": "Chytrý telefon", "submenu": "ZaÅ™ÃzenÃ", diff --git a/plugins/Events/Menu.php b/plugins/Events/Menu.php index 01c60cabe6490b8b7ee96964a628cc243201e900..440a35978e1f9160686b289cf0f73ea6b3f22964 100644 --- a/plugins/Events/Menu.php +++ b/plugins/Events/Menu.php @@ -16,6 +16,6 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->addActionsItem('Events_Events', array('module' => 'Events', 'action' => 'index'), 30); + $menu->addActionsItem('Events_Events', $this->urlForAction('index'), 30); } } diff --git a/plugins/ExamplePlugin/Controller.php b/plugins/ExamplePlugin/Controller.php index 4a2c3507b934a5d6e189843cf83555d44dc696f9..a496e40ed91b0f2c0a3ed131bd0e124453977b25 100644 --- a/plugins/ExamplePlugin/Controller.php +++ b/plugins/ExamplePlugin/Controller.php @@ -11,17 +11,19 @@ namespace Piwik\Plugins\ExamplePlugin; use Piwik\View; /** - * + * A controller let's you for example create a page that can be added to a menu. For more information read our guide + * http://developer.piwik.org/guides/mvc-in-piwik or have a look at the our API references for controller and view: + * http://developer.piwik.org/api-reference/Piwik/Plugin/Controller and + * http://developer.piwik.org/api-reference/Piwik/View */ class Controller extends \Piwik\Plugin\Controller { public function index() { - $view = new View('@ExamplePlugin/index.twig'); - $this->setBasicVariablesView($view); - $view->answerToLife = '42'; - - return $view->render(); + // Render the Twig template templates/index.twig and assign the view variable answerToLife to the view. + return $this->renderTemplate('index', array( + 'answerToLife' => 42 + )); } } diff --git a/plugins/ExamplePlugin/Menu.php b/plugins/ExamplePlugin/Menu.php index 2a3ed266f2dcb15e3b71f3e54a1c60607a6c02a6..3fd347aee1cab817173aaab73487ac3f27128916 100644 --- a/plugins/ExamplePlugin/Menu.php +++ b/plugins/ExamplePlugin/Menu.php @@ -22,34 +22,37 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - // with custom category 'UI Framework' - // $menu->add('UI Framework', '', array('module' => 'ExamplePlugin', 'action' => ''), true, $orderId = 30); - // $menu->add('UI Framework', 'Report 1', array('module' => 'ExamplePlugin', 'action' => 'report1'), true, $orderId = 30); - // or reusing an existing category - // $menu->addVisitorsItem('Report 1', array('module' => 'ExamplePlugin', 'action' => 'report1'), $orderId = 30); - // $menu->addActionsItem('Report 1', array('module' => 'ExamplePlugin', 'action' => 'report1'), $orderId = 30); + // reuse an existing category. Execute the showList() method within the controller when menu item was clicked + // $menu->addVisitorsItem('Report 1', $this->urlForAction('showList'), $orderId = 30); + // $menu->addActionsItem('Report 1', $this->urlForAction('showList'), $orderId = 30); + + // or create a custom category 'UI Framework' + // $menu->addItem('UI Framework', '', $this->urlForDefaultAction(), $orderId = 30); + // $menu->addItem('UI Framework', 'Report 1', $this->urlForAction('showList'), $orderId = 30); } public function configureAdminMenu(MenuAdmin $menu) { - // with custom category - // $menu->add('General_Settings', 'My Admin Item', array('module' => 'ExamplePlugin', 'action' => ''), true, $orderId = 30); - // or reusing an existing category - // $menu->addSettingsItem('My Admin Item', array('module' => 'ExamplePlugin', 'action' => ''), $orderId = 30); - // $menu->addPlatformItem('My Admin Item', array('module' => 'ExamplePlugin', 'action' => ''), $orderId = 30); + // reuse an existing category + // $menu->addSettingsItem('My Admin Item', $this->urlForDefaultAction(), $orderId = 30); + // $menu->addPlatformItem('My Admin Item', $this->urlForDefaultAction(), $orderId = 30); + + // or create a custom category + // $menu->addItem('General_Settings', 'My Admin Item', $this->urlForDefaultAction(), $orderId = 30); } public function configureTopMenu(MenuTop $menu) { - // $menu->add('My Top Item', null, array('module' => 'ExamplePlugin', 'action' => ''), true, $orderId = 30); + // $menu->addItem('My Top Item', null, $this->urlForDefaultAction(), $orderId = 30); } public function configureUserMenu(MenuUser $menu) { - // with custom category - // $menu->add('CoreAdminHome_MenuManage', 'My User Item', array('module' => 'ExamplePlugin', 'action' => ''), true, $orderId = 30); - // or reusing an existing category - // $menu->addManageItem('My User Item', array('module' => 'ExamplePlugin', 'action' => ''), $orderId = 30); - // $menu->addPlatformItem('My User Item', array('module' => 'ExamplePlugin', 'action' => ''), $orderId = 30); + // reuse an existing category. Execute the showList() method within the controller when menu item was clicked + // $menu->addManageItem('My User Item', $this->urlForAction('showList'), $orderId = 30); + // $menu->addPlatformItem('My User Item', $this->urlForDefaultAction(), $orderId = 30); + + // or create a custom category + // $menu->addItem('CoreAdminHome_MenuManage', 'My User Item', $this->urlForDefaultAction(), $orderId = 30); } } diff --git a/plugins/ExamplePlugin/plugin.json b/plugins/ExamplePlugin/plugin.json index b6328199ce3acb4b815fecdc30052d283c8ed4e3..d3b8257e4d93df14e943058b34679f866b938dd9 100644 --- a/plugins/ExamplePlugin/plugin.json +++ b/plugins/ExamplePlugin/plugin.json @@ -3,6 +3,9 @@ "version": "0.1.0", "description": "ExampleDescription", "theme": false, + "require": { + "piwik": ">=PIWIK_VERSION" + }, "authors": [ { "name": "Piwik", diff --git a/plugins/ExamplePlugin/templates/index.twig b/plugins/ExamplePlugin/templates/index.twig index d8c940d0fcd2ae8226f851b6c05a143fa08462c6..c322e32785c692b3ec289926b533b44220ca1528 100644 --- a/plugins/ExamplePlugin/templates/index.twig +++ b/plugins/ExamplePlugin/templates/index.twig @@ -1,4 +1,8 @@ -<strong>Hello world!</strong> -<br/> +{% extends 'dashboard.twig' %} -The answer to life is {{ answerToLife }} \ No newline at end of file +{% block content %} + <strong>Hello world!</strong> + <br/> + + The answer to life is {{ answerToLife }} +{% endblock %} \ No newline at end of file diff --git a/plugins/ExampleUI/Menu.php b/plugins/ExampleUI/Menu.php index 8b5f1bcfea3cbe59010b73c3a9c6e6c1f69893a7..66a0b7041a2f42fce7fd2b577679e8ec1cb7324b 100644 --- a/plugins/ExampleUI/Menu.php +++ b/plugins/ExampleUI/Menu.php @@ -18,7 +18,7 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->add('UI Framework', '', array('module' => 'ExampleUI', 'action' => 'dataTables'), true, 30); + $menu->addItem('UI Framework', '', $this->urlForAction('dataTables'), 30); $this->addSubMenu($menu, 'Data tables', 'dataTables', 1); $this->addSubMenu($menu, 'Bar graph', 'barGraph', 2); @@ -34,12 +34,11 @@ class Menu extends \Piwik\Plugin\Menu public function configureUserMenu(MenuUser $menu) { - $urlParams = array('module' => 'ExampleUI', 'action' => 'notifications'); - $menu->addPlatformItem('UI Notifications', $urlParams, $order = 3); + $menu->addPlatformItem('UI Notifications', $this->urlForAction('notifications'), $order = 3); } private function addSubMenu(MenuReporting $menu, $subMenu, $action, $order) { - $menu->add('UI Framework', $subMenu, array('module' => 'ExampleUI', 'action' => $action), true, $order); + $menu->addItem('UI Framework', $subMenu, $this->urlForAction($action), $order); } } diff --git a/plugins/Feedback/Menu.php b/plugins/Feedback/Menu.php index aa1156bc520f0986ede76542ea39d19a485c4082..acfd55dab1c5f0184ee680ef7419b9d9cddcdd12 100644 --- a/plugins/Feedback/Menu.php +++ b/plugins/Feedback/Menu.php @@ -15,11 +15,10 @@ class Menu extends \Piwik\Plugin\Menu { public function configureUserMenu(MenuUser $menu) { - $menu->add( + $menu->addItem( 'General_Help', null, - array('module' => 'Feedback', 'action' => 'index', 'segment' => false), - true, + $this->urlForAction('index', array('segment' => false)), $order = 99, $tooltip = Piwik::translate('Feedback_TopLinkTooltip') ); diff --git a/plugins/Feedback/lang/cs.json b/plugins/Feedback/lang/cs.json index f1cf4788c10c2da8b1643ae860a3bda7b85b9de4..10e558ad3dc27e15a05c4e8519e90e9cc6056932 100644 --- a/plugins/Feedback/lang/cs.json +++ b/plugins/Feedback/lang/cs.json @@ -17,9 +17,9 @@ "SendFeedback": "Odeslat odezvu", "SpecialRequest": "Máte speciálnà požadavek na tým Piwiku?", "ThankYou": "DÄ›kujeme vám, že pomáháte Piwik dÄ›lat lepÅ¡Ãm!", - "TopLinkTooltip": "Řekni co si myslÃÅ¡, nebo pořádek pomoc profesionála.", + "TopLinkTooltip": "Řekni co si myslÃÅ¡, nebo požádej o pomoc profesionála.", "ViewAnswersToFAQ": "Zobrazit odpovÄ›di na %sÄasto kladené otázky%s", - "ViewUserGuides": "eNauÄte se jak konfigurovat Piwik a efektivnÄ› analyzovat data s naÅ¡imi %1$suživatelskými pÅ™ÃruÄkami%2$s", + "ViewUserGuides": "NauÄte se, jak konfigurovat Piwik a efektivnÄ› analyzovat data s naÅ¡imi %1$suživatelskými pÅ™ÃruÄkami%2$s", "VisitTheForums": "NavÅ¡tivte %s forum%s", "WantToThankConsiderDonating": "MyslÃte si, že je Piwik úžasný a chcete nám podÄ›kovat?" } diff --git a/plugins/Goals/Menu.php b/plugins/Goals/Menu.php index 62608d8729faed191c5deb41cc48f2ec8acbcb4a..46b394b06783398cf02aa02640d71f1b6f356ecf 100644 --- a/plugins/Goals/Menu.php +++ b/plugins/Goals/Menu.php @@ -29,41 +29,40 @@ class Menu extends \Piwik\Plugin\Menu $site = new Site($idSite); if (count($goals) == 0) { + $action = $site->isEcommerceEnabled() ? 'ecommerceReport' : 'addNewGoal'; + $url = $this->urlForAction($action, array( + 'idGoal' => ($site->isEcommerceEnabled() ? Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER : null + ))); - $menu->add($mainGoalMenu, '', array('module' => 'Goals', - 'action' => ($site->isEcommerceEnabled() ? 'ecommerceReport' : 'addNewGoal'), - 'idGoal' => ($site->isEcommerceEnabled() ? Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER : null)), - true, - 25); + $menu->addItem($mainGoalMenu, '', $url, 25); if ($site->isEcommerceEnabled()) { - $menu->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); + $menu->addItem($mainGoalMenu, 'Goals_Ecommerce', $this->urlForAction('ecommerceReport', array('idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER)), 1); } - $menu->add($mainGoalMenu, 'Goals_AddNewGoal', array('module' => 'Goals', 'action' => 'addNewGoal')); + $menu->addItem($mainGoalMenu, 'Goals_AddNewGoal', $this->urlForAction('addNewGoal')); } else { - $menu->add($mainGoalMenu, '', array('module' => 'Goals', - 'action' => ($site->isEcommerceEnabled() ? 'ecommerceReport' : 'index'), - 'idGoal' => ($site->isEcommerceEnabled() ? Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER : null)), - true, - 25); + $action = $site->isEcommerceEnabled() ? 'ecommerceReport' : 'index'; + $url = $this->urlForAction($action, array('idGoal' => ($site->isEcommerceEnabled() ? Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER : null))); + + $menu->addItem($mainGoalMenu, '', $url, 25); if ($site->isEcommerceEnabled()) { - $menu->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); + $menu->addItem($mainGoalMenu, 'Goals_Ecommerce', $this->urlForAction('ecommerceReport', array('idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER)), 1); } - $menu->add($mainGoalMenu, 'Goals_GoalsOverview', array('module' => 'Goals', 'action' => 'index'), true, 2); + $menu->addItem($mainGoalMenu, 'Goals_GoalsOverview', array('module' => 'Goals', 'action' => 'index'), 2); $group = new Group(); foreach ($goals as $goal) { $subMenuName = str_replace('%', '%%', Translate::clean($goal['name'])); - $params = array('module' => 'Goals', 'action' => 'goalReport', 'idGoal' => $goal['idgoal']); + $params = $this->urlForAction('goalReport', array('idGoal' => $goal['idgoal'])); $tooltip = sprintf('%s (id = %d)', $subMenuName, $goal['idgoal']); if (count($goals) <= 3) { - $menu->add($mainGoalMenu, $subMenuName, $params, true, 50, $tooltip); + $menu->addItem($mainGoalMenu, $subMenuName, $params, 50, $tooltip); } else { $group->add($subMenuName, $params, $tooltip); } diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php index b23e697dffb8f9941b87e7cddea8499a7e6ef420..d9aeeabe677d7925db7cdb155953296d949c3342 100644 --- a/plugins/ImageGraph/StaticGraph.php +++ b/plugins/ImageGraph/StaticGraph.php @@ -14,7 +14,7 @@ use pData; use pImage; use Piwik\Piwik; use Piwik\SettingsPiwik; -use Piwik\Factory; +use Piwik\BaseFactory; require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pDraw.class.php"; require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pImage.class.php"; @@ -24,7 +24,7 @@ require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pData.class.php"; * The StaticGraph abstract class is used as a base class for different types of static graphs. * */ -abstract class StaticGraph extends Factory +abstract class StaticGraph extends BaseFactory { const GRAPH_TYPE_BASIC_LINE = "evolution"; const GRAPH_TYPE_VERTICAL_BAR = "verticalBar"; diff --git a/plugins/Installation/Menu.php b/plugins/Installation/Menu.php index 7ae25c8d79fe4888089a4a549b41fa69b4212ce1..fd57fab75cc088d7db59ca3cea3eaf3a27e14e8a 100644 --- a/plugins/Installation/Menu.php +++ b/plugins/Installation/Menu.php @@ -17,7 +17,7 @@ class Menu extends \Piwik\Plugin\Menu { if (Piwik::hasUserSuperUserAccess()) { $menu->addSettingsItem('Installation_SystemCheck', - array('module' => 'Installation', 'action' => 'systemCheckPage'), + $this->urlForAction('systemCheckPage'), $order = 15); } } diff --git a/plugins/LanguagesManager/Menu.php b/plugins/LanguagesManager/Menu.php index 1b53892a941a67e013256aaf30ea36f39831ca08..a51250d944852fc8c86e7303857e2ca0ba390137 100644 --- a/plugins/LanguagesManager/Menu.php +++ b/plugins/LanguagesManager/Menu.php @@ -28,7 +28,7 @@ class Menu extends \Piwik\Plugin\Menu { if (Development::isEnabled() && Piwik::isUserHasSomeAdminAccess()) { $menu->addDevelopmentItem('LanguagesManager_TranslationSearch', - array('module' => 'LanguagesManager', 'action' => 'searchTranslation')); + $this->urlForAction('searchTranslation')); } } } diff --git a/plugins/Live/lang/cs.json b/plugins/Live/lang/cs.json index 539045b8f7f51ac26af7b2720f2632ee797ade12..90799cd357cee3ec43c67fa4384b8336896b6297 100644 --- a/plugins/Live/lang/cs.json +++ b/plugins/Live/lang/cs.json @@ -32,7 +32,7 @@ "VisitorLog": "Pohled na návÅ¡tÄ›vnÃky", "VisitorLogDocumentation": "Tato tabulka zobrazuje poslednà návÅ¡tÄ›vy v daném obdobÃ. NajetÃm na datum návÅ¡tÄ›vy zobrazÃte Äas, kdy tento návÅ¡tÄ›vnÃk navÅ¡tÃvil stránky naposledy. %s Pokud obdobà zahrnuje dneÅ¡ek, můžete vidÄ›t návÅ¡tÄ›vnÃky v reálném Äase! %s Zde zobrazovaná data jsou vždy živá bez ohledu na to, jak a kdy probÃhá archivaÄnà cron úloha.", "VisitorProfile": "Profil návÅ¡tÄ›vnÃka", - "VisitorsInRealTime": "NávstÄ›v v reálném Äase", + "VisitorsInRealTime": "NávÅ¡tÄ›vnÃci v reálném Äase", "VisitorsLastVisit": "K poslednà návÅ¡tÄ›vÄ› tohoto návÅ¡tÄ›vnÃka doÅ¡lo pÅ™ed %s dny.", "VisitsFrom": "%1$s%2$s návÅ¡tÄ›v%3$s z", "VisitSummary": "Strávil celkem %1$s%2$s na stránkách%3$s a %4$szobrazil %5$s stránek za %6$s návÅ¡tÄ›v.%7$s" diff --git a/plugins/MobileMessaging/Menu.php b/plugins/MobileMessaging/Menu.php index 4dea3c329d46ec38fc107a2a054817740cfffc3f..e810e997449663a654d421138f678296d302d445 100644 --- a/plugins/MobileMessaging/Menu.php +++ b/plugins/MobileMessaging/Menu.php @@ -14,10 +14,6 @@ class Menu extends \Piwik\Plugin\Menu { public function configureAdminMenu(MenuAdmin $menu) { - $menu->addSettingsItem( - 'MobileMessaging_SettingsMenu', - array('module' => 'MobileMessaging', 'action' => 'index'), - $order = 12 - ); + $menu->addSettingsItem('MobileMessaging_SettingsMenu', $this->urlForAction('index'), $order = 12); } } diff --git a/plugins/MobileMessaging/SMSProvider.php b/plugins/MobileMessaging/SMSProvider.php index 0019a1ad582084e0a86cd52b2ff669bbfc251b52..c9212971e271fffc87f4cacc6802d4e18cb52432 100644 --- a/plugins/MobileMessaging/SMSProvider.php +++ b/plugins/MobileMessaging/SMSProvider.php @@ -10,13 +10,13 @@ namespace Piwik\Plugins\MobileMessaging; use Exception; use Piwik\Piwik; -use Piwik\Factory; +use Piwik\BaseFactory; /** * The SMSProvider abstract class is used as a base class for SMS provider implementations. * */ -abstract class SMSProvider extends Factory +abstract class SMSProvider extends BaseFactory { const MAX_GSM_CHARS_IN_ONE_UNIQUE_SMS = 160; const MAX_GSM_CHARS_IN_ONE_CONCATENATED_SMS = 153; diff --git a/plugins/MultiSites/Menu.php b/plugins/MultiSites/Menu.php index 0cbee0d89b337de0fb72971f285e08b4f0508e86..5059cfc09dc2094a71a0bc4ce7d2763506ae5d8c 100644 --- a/plugins/MultiSites/Menu.php +++ b/plugins/MultiSites/Menu.php @@ -15,7 +15,7 @@ class Menu extends \Piwik\Plugin\Menu { public function configureTopMenu(MenuTop $menu) { - $urlParams = array('module' => 'MultiSites', 'action' => 'index', 'segment' => false); + $urlParams = $this->urlForAction('index', array('segment' => false)); $tooltip = Piwik::translate('MultiSites_TopLinkTooltip'); $menu->add('General_MultiSitesSummary', null, $urlParams, true, 3, $tooltip); diff --git a/plugins/PrivacyManager/Menu.php b/plugins/PrivacyManager/Menu.php index 5eee77622c53b5b5f60b9d50ca8614450694336e..33c7aa55a2c29a472600d1b2a9f08e6770d2dc03 100644 --- a/plugins/PrivacyManager/Menu.php +++ b/plugins/PrivacyManager/Menu.php @@ -17,7 +17,7 @@ class Menu extends \Piwik\Plugin\Menu { if (Piwik::isUserHasSomeAdminAccess()) { $menu->addSettingsItem('PrivacyManager_MenuPrivacySettings', - array('module' => 'PrivacyManager', 'action' => 'privacySettings'), + $this->urlForAction('privacySettings'), $order = 7); } } diff --git a/plugins/PrivacyManager/lang/cs.json b/plugins/PrivacyManager/lang/cs.json index 12f2d404b441e5354031db78bebc8afbc181c286..f5a1a6dd3cb1cfe037e7b5816ceadc02bce6c4d7 100644 --- a/plugins/PrivacyManager/lang/cs.json +++ b/plugins/PrivacyManager/lang/cs.json @@ -4,16 +4,16 @@ "AnonymizeIpInlineHelp": "Skryje poslednà byte IP adresy návÅ¡tÄ›vnÃka, aby souhlasila se zákony vaÅ¡Ã zemÄ›.", "AnonymizeIpMaskLengtDescription": "Zvolte, kolik bitů z návÅ¡tÄ›vnÃkovy IP adresy má být maskováno.", "AnonymizeIpMaskLength": "%s bitů - napÅ™. %s", - "CannotLockSoDeleteLogActions": "Tabulka log_action nebude vyprázdnÄ›n: adejte Mysql uživateli %s privilegium LOCK TABLES.", + "CannotLockSoDeleteLogActions": "Tabulka log_action nebude vyprázdnÄ›na: dejte Mysql uživateli %s privilegium LOCK TABLES.", "ClickHereSettings": "Pro pÅ™Ãstup k nastavenà %s kliknÄ›te zde.", "CurrentDBSize": "Aktuálnà velikost databáze", "DBPurged": "Databáze vyprázdnÄ›na.", "DeleteBothConfirm": "Chystáte se povolit mazánà dat logů i mazánà dat hlášenÃ. Tato operace trvale odstranà stará data. Opravdu to chcete provést?", - "DeleteDataDescription": "Můžete Piwik nastavit tak, aby po urÄitém Äase mazal data rá stalogů nebo zpracovaná data hlášenÃ. To pomáhá udržet malou databázi.", - "DeleteDataDescription2": "Pokud si to pÅ™ejete, zpracovaných hlášenà mohou zůstat a budou odstranÄ›najen data logů (zobrazenà stránek, návÅ¡tÄ›vy a konverze) budou smazána. Nebo mohou být smazána hlášenà a data logů mohou být zachována.", + "DeleteDataDescription": "Můžete Piwik nastavit tak, aby po urÄitém Äase mazal stará data logů nebo zpracovaná data hlášenÃ. To pomáhá udržet malou databázi.", + "DeleteDataDescription2": "Pokud si to pÅ™ejete, zpracovaná hlášenà mohou zůstat a budou odstranÄ›na jen data logů (zobrazenà stránek (návÅ¡tÄ›vy a konverze). Nebo mohou být smazána hlášenà a data logů mohou být zachována.", "DeleteDataInterval": "Smazat stará data každých", "DeleteDataSettings": "Smazat staré logy návÅ¡tÄ›vnÃků a hlášenÃ", - "DeleteLogDescription2": "Pokud povolÃte automatické mazánà logů, musÃte zajistit, že jsou zpracovány vÅ¡echna dennà hlášenÃ, aby nedoÅ¡lo ke ztrátÄ› dat.", + "DeleteLogDescription2": "Pokud povolÃte automatické mazánà logů, musÃte zajistit, že jsou zpracována vÅ¡echna dennà hlášenÃ, aby nedoÅ¡lo ke ztrátÄ› dat.", "DeleteLogInfo": "Logy z následujÃcÃch tabulek budou smazány: %s", "DeleteLogsConfirm": "Chystáte se povolit mazánà dat logů. Pokud budou odstranÄ›na stará data logů a nebyla vytvoÅ™ena historická hlášenÃ, nebudete schopen zobrazit stará analytická data. Oprav", "DeleteLogsOlderThan": "Vymazat logy starÅ¡Ã než", @@ -28,7 +28,7 @@ "DeleteSchedulingSettings": "Nastavenà plánovánÃ", "DoNotTrack_Description": "Do not track je návrh technologie a politiky, která umožňuje uživatelům indikovat, že si nepÅ™ejà být stránkami, které navÅ¡tÄ›vujà a to vÄetnÄ› služeb webové analýzi, reklamnÃch služeb a sociálnÃch platforem.", "DoNotTrack_Disable": "Zakázat podporu Do not track", - "DoNotTrack_Disabled": "Pivik sleduje vÅ¡echny návÅ¡tÄ›vnÃky vÄetnÄ› tÄ›ch, kteřà v možnostech svého webového prohlÞeÄe nastavili, že si nepÅ™ejà být sledováni.", + "DoNotTrack_Disabled": "Piwik sleduje vÅ¡echny návÅ¡tÄ›vnÃky vÄetnÄ› tÄ›ch, kteřà v možnostech svého webového prohlÞeÄe nastavili, že si nepÅ™ejà být sledováni.", "DoNotTrack_DisabledMoreInfo": "DoporuÄujeme respektovat soukromà vaÅ¡ich návÅ¡tÄ›vnÃků a podporu Do not track povolit.", "DoNotTrack_Enable": "Povolit podporu Do not track", "DoNotTrack_Enabled": "AktuálnÄ› respektujete soukromà vaÅ¡ich návÅ¡tÄ›vnÃků, vÃbornÄ›!", @@ -38,7 +38,7 @@ "EstimatedSpaceSaved": "Odhadované uÅ¡etÅ™ené mÃsto", "GeolocationAnonymizeIpNote": "Poznámka: Geolokace bude mÃt pÅ™ibližnÄ› stejnou pÅ™esnost, když je anonymizován 1 bit. Pokud jsou anonymizovány 2 bity a vÃce, geolokace bude nepÅ™esná.", "GetPurgeEstimate": "ZÃskat odhad po vyprázdnÄ›nÃ", - "KeepBasicMetrics": "Uchovat základnà měřenà (návÅ¡tÄ›vy, zobrazenà stránek, odchody, cÃle, atd.)", + "KeepBasicMetrics": "Uchovat základnà metriky (návÅ¡tÄ›vy, zobrazenà stránek, odchody, cÃle, atd.)", "KeepDataFor": "Uchovávat vÅ¡echna data po", "KeepReportSegments": "Pro výše uchovávaná data také zachovat segmentovaná hlášenÃ", "LastDelete": "Poslednà mazánà bylo v", diff --git a/plugins/Referrers/Menu.php b/plugins/Referrers/Menu.php index 60768d7c2f8c8901de100cf8e80c8ae65ecd401e..835ae15f785b17ed0ea3354fa1472f2672c8a72b 100644 --- a/plugins/Referrers/Menu.php +++ b/plugins/Referrers/Menu.php @@ -14,9 +14,9 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->addReferrersItem('', array('module' => 'Referrers', 'action' => 'index'), 20); - $menu->addReferrersItem('General_Overview', array('module' => 'Referrers', 'action' => 'index'), 1); - $menu->addReferrersItem('Referrers_SubmenuSearchEngines', array('module' => 'Referrers', 'action' => 'getSearchEnginesAndKeywords'), 2); - $menu->addReferrersItem('Referrers_SubmenuWebsites', array('module' => 'Referrers', 'action' => 'indexWebsites'), 3); + $menu->addReferrersItem('', $this->urlForAction('index'), 20); + $menu->addReferrersItem('General_Overview', $this->urlForAction('index'), 1); + $menu->addReferrersItem('Referrers_SubmenuSearchEngines', $this->urlForAction('getSearchEnginesAndKeywords'), 2); + $menu->addReferrersItem('Referrers_SubmenuWebsites', $this->urlForAction('indexWebsites'), 3); } } diff --git a/plugins/ScheduledReports/Menu.php b/plugins/ScheduledReports/Menu.php index 26aafad2ad121845adf898676474a1fd0ebd524d..6c0111ff235101b6a0d460b61a6ad6ca40cd3474 100644 --- a/plugins/ScheduledReports/Menu.php +++ b/plugins/ScheduledReports/Menu.php @@ -24,10 +24,10 @@ class Menu extends \Piwik\Plugin\Menu \Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging') ? 'MobileMessaging_TopLinkTooltip' : 'ScheduledReports_TopLinkTooltip'); - $menu->addManageItem(null, array('module' => '', 'action' => '', 'segment' => false), 10); + $menu->addManageItem(null, $this->urlForDefaultAction(array('segment' => false)), 10); $menu->addManageItem( $this->getTopMenuTranslationKey(), - array('module' => 'ScheduledReports', 'action' => 'index', 'segment' => false), + $this->urlForAction('index', array('segment' => false)), 13, $tooltip ); diff --git a/plugins/SitesManager/Menu.php b/plugins/SitesManager/Menu.php index 017690f442727b1e49e6c29a68742b350dabd796..3f4d1b02adf3f97a871bc04c6b773f3cdc1fc151 100644 --- a/plugins/SitesManager/Menu.php +++ b/plugins/SitesManager/Menu.php @@ -17,7 +17,7 @@ class Menu extends \Piwik\Plugin\Menu { if (Piwik::isUserHasSomeAdminAccess()) { $menu->addManageItem('SitesManager_Sites', - array('module' => 'SitesManager', 'action' => 'index'), + $this->urlForAction('index'), $order = 1); } } diff --git a/plugins/UserCountry/Menu.php b/plugins/UserCountry/Menu.php index 41e259a618b1ec1aa38a5425e2ef0671f5b46c22..9305ab23fabb4a946e1c78a18365d64ada5ba81f 100644 --- a/plugins/UserCountry/Menu.php +++ b/plugins/UserCountry/Menu.php @@ -18,13 +18,13 @@ class Menu extends \Piwik\Plugin\Menu { if (UserCountry::isGeoLocationAdminEnabled() && Piwik::hasUserSuperUserAccess()) { $menu->addSettingsItem('UserCountry_Geolocation', - array('module' => 'UserCountry', 'action' => 'adminIndex'), + $this->urlForAction('adminIndex'), $order = 8); } } public function configureReportingMenu(MenuReporting $menu) { - $menu->addVisitorsItem('UserCountry_SubmenuLocations', array('module' => 'UserCountry', 'action' => 'index')); + $menu->addVisitorsItem('UserCountry_SubmenuLocations', $this->urlForAction('index')); } } diff --git a/plugins/UserCountry/lang/cs.json b/plugins/UserCountry/lang/cs.json index db4bd145a55cb59e3e93cdab1b43e071f494745d..37cc8685b74af1b0316ea6b39161f92ae74d79cc 100644 --- a/plugins/UserCountry/lang/cs.json +++ b/plugins/UserCountry/lang/cs.json @@ -12,7 +12,7 @@ "CityAndCountry": "%1$s, %2$s", "Continent": "Kontinent", "continent_afr": "Afrika", - "continent_amc": "StÅ™edná Amerika", + "continent_amc": "StÅ™ednà Amerika", "continent_amn": "Jižnà Amerika", "continent_ams": "Severnà a stÅ™ednà Amerika", "continent_ant": "Antarktida", @@ -21,7 +21,7 @@ "continent_oce": "Oceanie", "Country": "Státy", "country_a1": "Anonymnà proxy", - "country_a2": "Staelitnà poskytovatel", + "country_a2": "Satelitnà poskytovatel", "country_ac": "Ascension Islands", "country_ad": "Andorra", "country_ae": "United Arab Emirates", diff --git a/plugins/UserCountryMap/Menu.php b/plugins/UserCountryMap/Menu.php index fa32a8f9b7940ee968e19da319e75dd9e08f6632..88108e3f4d37bb61155895e787c5baab9a4aa0da 100644 --- a/plugins/UserCountryMap/Menu.php +++ b/plugins/UserCountryMap/Menu.php @@ -17,7 +17,7 @@ class Menu extends \Piwik\Plugin\Menu { if (PluginManager::getInstance()->isPluginActivated('UserCountry')) { $menu->addVisitorsItem('UserCountryMap_RealTimeMap', - array('module' => 'UserCountryMap', 'action' => 'realtimeWorldMap'), + $this->urlForAction('realtimeWorldMap'), $order = 70); } } diff --git a/plugins/UserSettings/Menu.php b/plugins/UserSettings/Menu.php index 5b442e5e09a5b11911d4ae30f8e776d478d3950c..c194ea20fba1dd2ea3fab0b829400942895bbd89 100644 --- a/plugins/UserSettings/Menu.php +++ b/plugins/UserSettings/Menu.php @@ -14,6 +14,6 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->addVisitorsItem('General_Settings', array('module' => 'UserSettings', 'action' => 'index')); + $menu->addVisitorsItem('General_Settings', $this->urlForAction('index')); } } diff --git a/plugins/UsersManager/Menu.php b/plugins/UsersManager/Menu.php index 494d09542c2ef21a518af4bee6f04abfc4c52843..8335d97305c1fcd09fa189a1e821450db2b16a80 100644 --- a/plugins/UsersManager/Menu.php +++ b/plugins/UsersManager/Menu.php @@ -16,12 +16,8 @@ class Menu extends \Piwik\Plugin\Menu public function configureAdminMenu(MenuAdmin $menu) { if (Piwik::isUserHasSomeAdminAccess()) { - $menu->addManageItem('UsersManager_MenuUsers', - array('module' => 'UsersManager', 'action' => 'index'), - $order = 2); - $menu->addManageItem('UsersManager_MenuUserSettings', - array('module' => 'UsersManager', 'action' => 'userSettings'), - $order = 3); + $menu->addManageItem('UsersManager_MenuUsers', $this->urlForAction('index'), $order = 2); + $menu->addManageItem('UsersManager_MenuUserSettings', $this->urlForAction('userSettings'), $order = 3); } } } diff --git a/plugins/VisitFrequency/Menu.php b/plugins/VisitFrequency/Menu.php index 8759cf751d8202cc485e445e1d24fb94ef915e90..e858bd2f765959b22f28da543a1110b9d8826eb1 100644 --- a/plugins/VisitFrequency/Menu.php +++ b/plugins/VisitFrequency/Menu.php @@ -14,7 +14,6 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->addVisitorsItem('VisitFrequency_SubmenuFrequency', - array('module' => 'VisitFrequency', 'action' => 'index'), $order = 55); + $menu->addVisitorsItem('VisitFrequency_SubmenuFrequency', $this->urlForAction('index'), $order = 55); } } diff --git a/plugins/VisitTime/Menu.php b/plugins/VisitTime/Menu.php index db221a4eda3025014b37250964eb8255460d132c..ffa3a5b015d1290584913765cc670ce4ad4ebae9 100644 --- a/plugins/VisitTime/Menu.php +++ b/plugins/VisitTime/Menu.php @@ -14,7 +14,6 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->addVisitorsItem('VisitTime_SubmenuTimes', - array('module' => 'VisitTime', 'action' => 'index'), $order = 65); + $menu->addVisitorsItem('VisitTime_SubmenuTimes', $this->urlForAction('index'), $order = 65); } } diff --git a/plugins/VisitsSummary/lang/cs.json b/plugins/VisitsSummary/lang/cs.json index d4cd9aa258f2cc3727cb5de52be7c977e55c8bdc..6c191f1c2b7eda976f527448cf7c1fda580a0ca8 100644 --- a/plugins/VisitsSummary/lang/cs.json +++ b/plugins/VisitsSummary/lang/cs.json @@ -12,7 +12,7 @@ "NbOutlinksDescription": "%s externÃch odkazů", "NbPageviewsDescription": "%s zobrazenÃ", "NbSearchesDescription": "Celkem %s vyhledávánà na vaÅ¡ich stránkách", - "NbUniqueDownloadsDescription": "%s unikátnÃch straženÃ", + "NbUniqueDownloadsDescription": "%s unikátnÃch staženÃ", "NbUniqueOutlinksDescription": "%s unikátnÃch externÃch odkazů", "NbUniquePageviewsDescription": "%s unikátnÃch zobrazenÃ", "NbUniqueVisitors": "%s unikátnÃch návÅ¡tÄ›vnÃků", diff --git a/plugins/Widgetize/Menu.php b/plugins/Widgetize/Menu.php index 954df309e5fa571ca71928c9f2047e07ba54b429..f796faf57e1bc1b8d264b573849b64b346ef2225 100644 --- a/plugins/Widgetize/Menu.php +++ b/plugins/Widgetize/Menu.php @@ -16,7 +16,7 @@ class Menu extends \Piwik\Plugin\Menu public function configureUserMenu(MenuUser $menu) { $tooltip = Piwik::translate('Widgetize_TopLinkTooltip'); - $urlParams = array('module' => 'Widgetize', 'action' => 'index', 'segment' => false); + $urlParams = $this->urlForAction('index', array('segment' => false)); $menu->addPlatformItem(null, $urlParams, 50, $tooltip); $menu->addPlatformItem('General_Widgets', $urlParams, 5, $tooltip); diff --git a/tests/PHPUnit/Core/DeprecatedMethodsTest.php b/tests/PHPUnit/Core/DeprecatedMethodsTest.php index ce496684ba0c40f0fb6a31953fc1d9fd2557153a..47bbddb2d26e63383f28e7e026be79978b122b91 100644 --- a/tests/PHPUnit/Core/DeprecatedMethodsTest.php +++ b/tests/PHPUnit/Core/DeprecatedMethodsTest.php @@ -29,6 +29,8 @@ class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase $validTill = '2014-10-15'; $this->assertDeprecatedMethodIsRemoved('\Piwik\SettingsPiwik', 'rewriteTmpPathWithHostname', $validTill); + + $this->assertDeprecatedMethodIsRemovedInPiwik3('\Piwik\Menu\MenuAbstract', 'add'); } private function assertDeprecatedMethodIsRemoved($className, $method, $removalDate) @@ -49,4 +51,22 @@ class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase $errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.'; $this->assertFalse($methodExists, $errorMessage); } + + private function assertDeprecatedMethodIsRemovedInPiwik3($className, $method) + { + $version = \Piwik\Version::VERSION; + + $class = new ReflectionClass($className); + $methodExists = $class->hasMethod($method); + + if (-1 === version_compare($version, '3.0.0')) { + + $errorMessage = $className . '::' . $method . ' should still exists until 3.0 although it is deprecated.'; + $this->assertTrue($methodExists, $errorMessage); + return; + } + + $errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.'; + $this->assertFalse($methodExists, $errorMessage); + } } \ No newline at end of file diff --git a/tests/PHPUnit/Core/FactoryTest.php b/tests/PHPUnit/Core/FactoryTest.php index dfa6cbdb7a6c083abce3611b3b2a2e75910c7525..d85efcc2cecfbb24569a4c284e4726b187396e9c 100644 --- a/tests/PHPUnit/Core/FactoryTest.php +++ b/tests/PHPUnit/Core/FactoryTest.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -use Piwik\Factory; +use Piwik\BaseFactory; /** * @group Core @@ -16,7 +16,7 @@ class FactoryTest extends PHPUnit_Framework_TestCase { public function testCreatingExistingClassSucceeds() { - $instance = Factory::factory("Piwik\\Timer"); + $instance = BaseFactory::factory("Piwik\\Timer"); $this->assertNotNull($instance); $this->assertInstanceOf("Piwik\\Timer", $instance); @@ -28,6 +28,6 @@ class FactoryTest extends PHPUnit_Framework_TestCase */ public function testCreatingInvalidClassThrows() { - Factory::factory("This\\Class\\Does\\Not\\Exist"); + BaseFactory::factory("This\\Class\\Does\\Not\\Exist"); } } \ No newline at end of file diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 319cf3e20c8f280fb2a4662eaf64bc90ad44f5ec..b719a0aa77b2223a4a54ecc46ba693a38d85f59a 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 319cf3e20c8f280fb2a4662eaf64bc90ad44f5ec +Subproject commit b719a0aa77b2223a4a54ecc46ba693a38d85f59a