diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2016-04-04 03:10:40 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2016-04-06 13:17:27 +0300 |
commit | 3a6d626c2474b83ea5c4125fd33dfe12b9e0bf8a (patch) | |
tree | 9de2cd1d85e1f8a7211f0514f8deae2b152faa89 | |
parent | 780c09b144e048cc748429bc06d016354d44746e (diff) |
refs #9354 merge user and admin menu to one single menu
50 files changed, 121 insertions, 372 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a85c7e5a16..cbe224bc10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' * The `core:plugin` console command has been removed in favor of the new `plugin:list`, `plugin:activate` and `plugin:deactivate` commands as anounced in Piwik 2.11 * The visibility of private properties and methods in `Piwik\Plugins\Login\Controller` were changed to `protected` * Controller actions are now case sensitive. This means the URL and events have to use the same case as the name of the action defined in a controller. +* The "User Menu" was removed and should be replaced by "Admin Menu". Change `configureUserMenu(MenuUser $menu)` to `configureAdminMenu(MenuAdmin $menu)` in your `Menu.php`. +* The method `Piwik\Menu\MenuAdmin::addSettingsItem()` was removed, use `Piwik\Menu\MenuAdmin::addManageItem()` instead. ### New APIs * Multiple widgets for one report can now be created via the `Report::configureWidgets()` method via the new classes `Piwik\Widget\ReportWidgetFactory` and `Piwik\Widget\ReportWidgetConfig` diff --git a/core/Menu/MenuAdmin.php b/core/Menu/MenuAdmin.php index 9c05734e5f..c8273ed16b 100644 --- a/core/Menu/MenuAdmin.php +++ b/core/Menu/MenuAdmin.php @@ -8,6 +8,7 @@ */ namespace Piwik\Menu; +use Piwik\Development; use Piwik\Piwik; /** @@ -33,7 +34,7 @@ use Piwik\Piwik; class MenuAdmin extends MenuAbstract { /** - * See {@link add()}. Adds a new menu item to the development section of the admin menu. + * See {@link add()}. Adds a new menu item to the manage section of the user menu. * @param string $menuName * @param array $url * @param int $order @@ -41,13 +42,13 @@ class MenuAdmin extends MenuAbstract * @api * @since 2.5.0 */ - public function addDevelopmentItem($menuName, $url, $order = 50, $tooltip = false) + public function addPersonalItem($menuName, $url, $order = 50, $tooltip = false) { - $this->addItem('CoreAdminHome_MenuDevelopment', $menuName, $url, $order, $tooltip); + $this->addItem('UsersManager_MenuPersonal', $menuName, $url, $order, $tooltip); } /** - * See {@link add()}. Adds a new menu item to the diagnostic section of the admin menu. + * See {@link add()}. Adds a new menu item to the development section of the admin menu. * @param string $menuName * @param array $url * @param int $order @@ -55,13 +56,15 @@ class MenuAdmin extends MenuAbstract * @api * @since 2.5.0 */ - public function addDiagnosticItem($menuName, $url, $order = 50, $tooltip = false) + public function addDevelopmentItem($menuName, $url, $order = 50, $tooltip = false) { - $this->addItem('CoreAdminHome_MenuDiagnostic', $menuName, $url, $order, $tooltip); + if (Development::isEnabled()) { + $this->addItem('CoreAdminHome_MenuDevelopment', $menuName, $url, $order, $tooltip); + } } /** - * See {@link add()}. Adds a new menu item to the platform section of the admin menu. + * See {@link add()}. Adds a new menu item to the diagnostic section of the admin menu. * @param string $menuName * @param array $url * @param int $order @@ -69,13 +72,13 @@ class MenuAdmin extends MenuAbstract * @api * @since 2.5.0 */ - public function addPlatformItem($menuName, $url, $order = 50, $tooltip = false) + public function addDiagnosticItem($menuName, $url, $order = 50, $tooltip = false) { - $this->addItem('CorePluginsAdmin_MenuPlatform', $menuName, $url, $order, $tooltip); + $this->addItem('CoreAdminHome_MenuDiagnostic', $menuName, $url, $order, $tooltip); } /** - * See {@link add()}. Adds a new menu item to the settings section of the admin menu. + * See {@link add()}. Adds a new menu item to the platform section of the admin menu. * @param string $menuName * @param array $url * @param int $order @@ -83,9 +86,9 @@ class MenuAdmin extends MenuAbstract * @api * @since 2.5.0 */ - public function addSettingsItem($menuName, $url, $order = 50, $tooltip = false) + public function addPlatformItem($menuName, $url, $order = 50, $tooltip = false) { - $this->addItem('General_Settings', $menuName, $url, $order, $tooltip); + $this->addItem('CorePluginsAdmin_MenuPlatform', $menuName, $url, $order, $tooltip); } /** @@ -99,7 +102,7 @@ class MenuAdmin extends MenuAbstract */ public function addManageItem($menuName, $url, $order = 50, $tooltip = false) { - $this->addItem('CoreAdminHome_Administration', $menuName, $url, $order, $tooltip); + $this->addItem('CoreAdminHome_MenuManage', $menuName, $url, $order, $tooltip); } /** diff --git a/core/Menu/MenuUser.php b/core/Menu/MenuUser.php deleted file mode 100755 index ac3bc295ab..0000000000 --- a/core/Menu/MenuUser.php +++ /dev/null @@ -1,91 +0,0 @@ -<?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\Menu; - -/** - * Contains menu entries for the User menu (the menu at the very top of the page). - * Plugins can implement the `configureUserMenu()` method of the `Menu` plugin class to add, rename of remove - * items. If your plugin does not have a `Menu` class yet you can create one using `./console generate:menu`. - * - * **Example** - * - * public function configureUserMenu(MenuUser $menu) - * { - * $menu->add( - * 'MyPlugin_MyTranslatedMenuCategory', - * 'MyPlugin_MyTranslatedMenuName', - * array('module' => 'MyPlugin', 'action' => 'index'), - * Piwik::isUserHasSomeAdminAccess(), - * $order = 2 - * ); - * } - * - * @method static MenuUser getInstance() - */ -class MenuUser extends MenuAbstract -{ - - /** - * See {@link add()}. Adds a new menu item to the manage section of the user menu. - * @param string $menuName - * @param array $url - * @param int $order - * @param bool|string $tooltip - * @api - * @since 2.5.0 - */ - public function addPersonalItem($menuName, $url, $order = 50, $tooltip = false) - { - $this->addItem('UsersManager_MenuPersonal', $menuName, $url, $order, $tooltip); - } - - /** - * See {@link add()}. Adds a new menu item to the manage section of the user menu. - * @param string $menuName - * @param array $url - * @param int $order - * @param bool|string $tooltip - * @api - * @since 2.5.0 - */ - public function addManageItem($menuName, $url, $order = 50, $tooltip = false) - { - $this->addItem('CoreAdminHome_MenuManage', $menuName, $url, $order, $tooltip); - } - - /** - * See {@link add()}. Adds a new menu item to the platform section of the user menu. - * @param string $menuName - * @param array $url - * @param int $order - * @param bool|string $tooltip - * @api - * @since 2.5.0 - */ - public function addPlatformItem($menuName, $url, $order = 50, $tooltip = false) - { - $this->addItem('CorePluginsAdmin_MenuPlatform', $menuName, $url, $order, $tooltip); - } - - /** - * Triggers the Menu.User.addItems hook and returns the menu. - * - * @return Array - */ - public function getMenu() - { - if (!$this->menu) { - foreach ($this->getAllMenus() as $menu) { - $menu->configureUserMenu($this); - } - } - - return parent::getMenu(); - } -} diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php index 636303e929..74691e577c 100644 --- a/core/Plugin/Controller.php +++ b/core/Plugin/Controller.php @@ -20,8 +20,8 @@ use Piwik\Date; use Piwik\Exception\NoPrivilegesException; use Piwik\Exception\NoWebsiteFoundException; use Piwik\FrontController; +use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\NoAccessException; use Piwik\Notification\Manager as NotificationManager; use Piwik\NumberFormatter; @@ -640,8 +640,8 @@ abstract class Controller $this->setBasicVariablesView($view); - $view->topMenu = MenuTop::getInstance()->getMenu(); - $view->userMenu = MenuUser::getInstance()->getMenu(); + $view->topMenu = MenuTop::getInstance()->getMenu(); + $view->adminMenu = MenuAdmin::getInstance()->getMenu(); $notifications = $view->notifications; if (empty($notifications)) { diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index a0658c4142..51ff540b98 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -13,7 +13,6 @@ use Piwik\Config; use Piwik\Development; use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\Notification; use Piwik\Notification\Manager as NotificationManager; use Piwik\Piwik; @@ -218,8 +217,7 @@ abstract class ControllerAdmin extends Controller self::notifyIfEAcceleratorIsUsed(); self::notifyIfURLIsNotSecure(); - $view->topMenu = MenuTop::getInstance()->getMenu(); - $view->userMenu = MenuUser::getInstance()->getMenu(); + $view->topMenu = MenuTop::getInstance()->getMenu(); $view->isDataPurgeSettingsEnabled = self::isDataPurgeSettingsEnabled(); $enableFrames = PiwikConfig::getInstance()->General['enable_framed_settings']; @@ -239,8 +237,7 @@ abstract class ControllerAdmin extends Controller self::notifyWhenDebugOnDemandIsEnabled('debug'); self::notifyWhenDebugOnDemandIsEnabled('debug_on_demand'); - $adminMenu = MenuAdmin::getInstance()->getMenu(); - $view->adminMenu = $adminMenu; + $view->adminMenu = MenuAdmin::getInstance()->getMenu(); $notifications = $view->notifications; diff --git a/core/Plugin/Menu.php b/core/Plugin/Menu.php index c90e6d851f..384c3a199a 100644 --- a/core/Plugin/Menu.php +++ b/core/Plugin/Menu.php @@ -12,10 +12,8 @@ use Piwik\Common; use Piwik\Development; use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\Plugin\Manager as PluginManager; use Piwik\Plugins\UsersManager\UserPreferences; -use Piwik\Plugin\Reports; /** * Base class of all plugin menu providers. Plugins that define their own menu items can extend this class to easily @@ -218,16 +216,8 @@ class Menu } /** - * Configures the user menu which is supposed to contain user and help related items such as - * "User settings", "Alerts" or "Email Reports". - */ - public function configureUserMenu(MenuUser $menu) - { - } - - /** * Configures the admin menu which is supposed to contain only administration related items such as - * "Websites", "Users" or "Plugin settings". + * "Websites", "Users" or "Settings". */ public function configureAdminMenu(MenuAdmin $menu) { diff --git a/lang/en.json b/lang/en.json index 810c4bc81b..0e83886028 100644 --- a/lang/en.json +++ b/lang/en.json @@ -182,7 +182,7 @@ "Forums": "Forums", "FromReferrer": "from", "GeneralInformation": "General Information", - "General": "General", + "GeneralSettings": "General settings", "GetStarted": "Get started", "GiveUsYourFeedback": "Give us Feedback!", "Goal": "Goal", diff --git a/plugins/API/Menu.php b/plugins/API/Menu.php index 9d17b81545..12995fcb99 100644 --- a/plugins/API/Menu.php +++ b/plugins/API/Menu.php @@ -9,8 +9,8 @@ namespace Piwik\Plugins\API; use Piwik\DeviceDetectorCache; +use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\Piwik; use DeviceDetector\Parser\OperatingSystem; @@ -24,7 +24,7 @@ class Menu extends \Piwik\Plugin\Menu $this->addTopMenuMobileApp($menu); } - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $menu->addPlatformItem('General_API', $this->urlForAction('listAllAPI', array('segment' => false)), diff --git a/plugins/API/templates/glossary.twig b/plugins/API/templates/glossary.twig index 623c8ef126..fc593742c9 100644 --- a/plugins/API/templates/glossary.twig +++ b/plugins/API/templates/glossary.twig @@ -1,4 +1,4 @@ -{% extends isWidget ? 'empty.twig' : 'user.twig' %} +{% extends isWidget ? 'empty.twig' : 'admin.twig' %} {% set title %}{{ 'API_Glossary'|translate }}{% endset %} diff --git a/plugins/API/templates/listAllAPI.twig b/plugins/API/templates/listAllAPI.twig index d3c551c997..c42d313fcf 100644 --- a/plugins/API/templates/listAllAPI.twig +++ b/plugins/API/templates/listAllAPI.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% set title %}{{ 'API_ReportingApiReference'|translate }}{% endset %} diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php index 7fa434b21f..19e0f1c9c1 100644 --- a/plugins/CoreAdminHome/Controller.php +++ b/plugins/CoreAdminHome/Controller.php @@ -16,7 +16,6 @@ use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\DataTable\Renderer\Json; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\Nonce; use Piwik\Piwik; use Piwik\Plugin\ControllerAdmin; @@ -287,7 +286,6 @@ class Controller extends ControllerAdmin $view = new View('@CoreAdminHome/trackingCodeGenerator'); $this->setBasicVariablesView($view); $view->topMenu = MenuTop::getInstance()->getMenu(); - $view->userMenu = MenuUser::getInstance()->getMenu(); $viewableIdSites = APISitesManager::getInstance()->getSitesIdWithAtLeastViewAccess(); diff --git a/plugins/CoreAdminHome/Menu.php b/plugins/CoreAdminHome/Menu.php index a149baa399..b0dd0ee258 100644 --- a/plugins/CoreAdminHome/Menu.php +++ b/plugins/CoreAdminHome/Menu.php @@ -11,57 +11,50 @@ namespace Piwik\Plugins\CoreAdminHome; use Piwik\Db; use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\Piwik; +use Piwik\Plugin; use Piwik\Settings\Manager as SettingsManager; class Menu extends \Piwik\Plugin\Menu { - - public function configureAdminMenu(MenuAdmin $menu) + public function configureTopMenu(MenuTop $menu) { - $hasAdminAccess = Piwik::isUserHasSomeAdminAccess(); - - if ($hasAdminAccess) { - $menu->addManageItem(null, array(), $order = 1); - $menu->addSettingsItem(null, array(), $order = 5); - $menu->addDiagnosticItem(null, array(), $order = 10); - $menu->addDevelopmentItem(null, array(), $order = 15); - - if (Piwik::hasUserSuperUserAccess()) { - $menu->addSettingsItem('General_General', - $this->urlForAction('generalSettings'), - $order = 6); + if (Piwik::isUserIsAnonymous()) { + if (Plugin\Manager::getInstance()->isPluginActivated('ScheduledReports')) { + $url = $this->urlForModuleAction('ScheduledReports', 'index'); + } else { + $url = $this->urlForModuleAction('API', 'listAllAPI'); } + } else { + $url = $this->urlForModuleAction('UsersManager', 'userSettings'); } - if (Piwik::hasUserSuperUserAccess() && SettingsManager::hasSystemPluginsSettingsForCurrentUser()) { - $menu->addSettingsItem('CoreAdminHome_PluginSettings', - $this->urlForAction('adminPluginSettings'), - $order = 7); - } + $menu->registerMenuIcon('CoreAdminHome_Administration', 'icon-configure'); + $menu->addItem('CoreAdminHome_Administration', null, $url, 980, Piwik::translate('CoreAdminHome_Administration')); } - public function configureTopMenu(MenuTop $menu) + public function configureAdminMenu(MenuAdmin $menu) { - if (Piwik::isUserHasSomeAdminAccess()) { - $url = $this->urlForModuleAction('SitesManager', 'index'); + $menu->addDevelopmentItem(null, array(), $order = 40); + $menu->addManageItem(null, array(), $order = 1); + $menu->addDiagnosticItem(null, array(), $order = 5); - if (Piwik::hasUserSuperUserAccess()) { - $url = $this->urlForAction('generalSettings'); - } + if (Piwik::hasUserSuperUserAccess()) { + $menu->addManageItem('General_GeneralSettings', + $this->urlForAction('generalSettings'), + $order = 6); - $menu->registerMenuIcon('CoreAdminHome_Administration', 'icon-configure'); - $menu->addItem('CoreAdminHome_Administration', null, $url, 980, Piwik::translate('CoreAdminHome_Administration')); + if (SettingsManager::hasSystemPluginsSettingsForCurrentUser()) { + $menu->addManageItem('CoreAdminHome_PluginSettings', + $this->urlForAction('adminPluginSettings'), + $order = 7); + } } - } - public function configureUserMenu(MenuUser $menu) - { if (!Piwik::isUserIsAnonymous()) { $menu->addManageItem('CoreAdminHome_TrackingCode', $this->urlForAction('trackingCodeGenerator'), - $order = 20); + $order = 25); if (SettingsManager::hasUserPluginsSettingsForCurrentUser()) { $menu->addPersonalItem('CoreAdminHome_PluginSettings', diff --git a/plugins/CoreAdminHome/templates/pluginSettings.twig b/plugins/CoreAdminHome/templates/pluginSettings.twig index dd55ab3048..b160fe847e 100644 --- a/plugins/CoreAdminHome/templates/pluginSettings.twig +++ b/plugins/CoreAdminHome/templates/pluginSettings.twig @@ -1,5 +1,5 @@ -{% extends mode == 'user' ? "user.twig" : "admin.twig" %} +{% extends "admin.twig" %} {% set title %} {% if mode == 'user' -%} diff --git a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig index 1011afa8cb..535401dff3 100644 --- a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig +++ b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% block head %} {{ parent() }} diff --git a/plugins/CoreHome/Menu.php b/plugins/CoreHome/Menu.php index 7009217833..cab21179a9 100644 --- a/plugins/CoreHome/Menu.php +++ b/plugins/CoreHome/Menu.php @@ -9,41 +9,15 @@ namespace Piwik\Plugins\CoreHome; use Piwik\Db; +use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\Piwik; use Piwik\Plugin; -use Piwik\Plugins\UsersManager\API as APIUsersManager; class Menu extends \Piwik\Plugin\Menu { public function configureTopMenu(MenuTop $menu) { - $login = Piwik::getCurrentUserLogin(); - $user = APIUsersManager::getInstance()->getUser($login); - - if (!empty($user['alias'])) { - $login = $user['alias']; - } - - if (Plugin\Manager::getInstance()->isPluginActivated('Feedback')) { - $menu->registerMenuIcon('General_Help', 'icon-help'); - $menu->addItem('General_Help', null, array('module' => 'Feedback', 'action' => 'index'), $order = 990, Piwik::translate('General_Help')); - } - - $menu->registerMenuIcon($login, 'icon-user'); - - if (Piwik::isUserIsAnonymous()) { - if (Plugin\Manager::getInstance()->isPluginActivated('ScheduledReports')) { - $menu->addItem($login, null, array('module' => 'ScheduledReports', 'action' => 'index'), 970, Piwik::translate('UsersManager_PersonalSettings')); - } else { - $menu->addItem($login, null, array('module' => 'API', 'action' => 'listAllAPI'), 970, Piwik::translate('API_ReportingApiReference')); - } - } else { - $tooltip = sprintf('%s: %s', Piwik::translate('UsersManager_PersonalSettings'), $login); - $menu->addItem($login, null, array('module' => 'UsersManager', 'action' => 'userSettings'), 970, $tooltip); - } - $module = $this->getLoginModule(); if (Piwik::isUserIsAnonymous()) { $menu->registerMenuIcon('Login_LogIn', 'icon-sign-in'); @@ -54,7 +28,7 @@ class Menu extends \Piwik\Plugin\Menu } } - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $menu->addPersonalItem(null, array(), 1, false); $menu->addManageItem(null, array(), 2, false); diff --git a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js index e57d1b01b0..619fedfc2b 100644 --- a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js +++ b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js @@ -74,11 +74,6 @@ $rootElement.find('#topRightBar .navbar-right li > a').each(function (index, element) { var $element = $(element); - if ($element.is('#topmenu-usersmanager')) { - // ignore languages manager - return; - } - var text = trim($element.text()); if (!text) { diff --git a/plugins/CoreHome/stylesheets/coreHome.less b/plugins/CoreHome/stylesheets/coreHome.less index ab4b749b02..00cd0652fe 100644 --- a/plugins/CoreHome/stylesheets/coreHome.less +++ b/plugins/CoreHome/stylesheets/coreHome.less @@ -212,11 +212,6 @@ a.Piwik_Popover_Error_Back { } } -#userMenu .items { - margin-left: -117px; - width: 160px; -} - /* Used to link within content text, without adding visual clutter */ .linkContent { color:#333; text-decoration:none} .linkContent:hover { text-decoration:underline;} diff --git a/plugins/CoreHome/templates/_headerMessage.twig b/plugins/CoreHome/templates/_headerMessage.twig index bb4f8e7607..5fbd78125d 100644 --- a/plugins/CoreHome/templates/_headerMessage.twig +++ b/plugins/CoreHome/templates/_headerMessage.twig @@ -10,7 +10,7 @@ </span> {% endset %} -{% if isPiwikDemo or (latest_version_available and hasSomeViewAccess and not isUserIsAnonymous) or (isSuperUser and adminMenu is defined and adminMenu) %} +{% if isPiwikDemo or (latest_version_available and hasSomeViewAccess and not isUserIsAnonymous) or (isSuperUser and isAdminArea is defined and isAdminArea) %} <div piwik-expand-on-hover id="header_message" class="piwikSelector borderedControl {% if isPiwikDemo or not latest_version_available %}header_info{% else %}{% endif %} {% if isPiwikDemo %}isPiwikDemo{% else %}piwikTopControl{% endif %} {% if latest_version_available %}update_available{% endif %}" @@ -22,7 +22,7 @@ {% elseif latest_version_available %} {{ 'General_NewUpdatePiwikX'|translate(latest_version_available) }} <span class="icon-warning"></span> - {% elseif isSuperUser and adminMenu is defined and adminMenu %} + {% elseif isSuperUser and isAdminArea is defined and isAdminArea %} {{ updateCheck|raw }} {% endif %} </a> @@ -31,7 +31,7 @@ {% if isPiwikDemo %} {{ 'General_DownloadFullVersion'|translate("<a href='http://piwik.org/'>","</a>","<a href='http://piwik.org'>piwik.org</a>")|raw }} <br/> - {% if isSuperUser and adminMenu is defined and adminMenu %} + {% if isSuperUser and isAdminArea is defined and isAdminArea %} <br/> {% endif %} {% endif %} @@ -44,7 +44,7 @@ <br /> {% endif %} - {% if isPiwikDemo and isSuperUser and adminMenu is defined and adminMenu %} + {% if isPiwikDemo and isSuperUser and isAdminArea is defined and isAdminArea %} <br/> {{ updateCheck|raw }} <br/> diff --git a/plugins/CoreHome/templates/_topBar.twig b/plugins/CoreHome/templates/_topBar.twig index bc5261b70f..1d45c7282e 100644 --- a/plugins/CoreHome/templates/_topBar.twig +++ b/plugins/CoreHome/templates/_topBar.twig @@ -1,4 +1,4 @@ -{{ postEvent("Template.beforeTopBar", userAlias, userLogin, topMenu, userMenu) }} +{{ postEvent("Template.beforeTopBar", userAlias, userLogin, topMenu) }} <ul role="menubar" class="navbar-right"> {% macro menuItemLabel(label, icon) %} diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index c9b4a48a7c..f4e171c158 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -57,10 +57,6 @@ class Controller extends Plugin\ControllerAdmin if (!in_array($sort, $this->validSortMethods)) { $sort = $this->defaultSortMethod; } - $mode = Common::getRequestVar('mode', 'admin', 'string'); - if (!in_array($mode, array('user', 'admin'))) { - $mode = 'admin'; - } $view = $this->configureView('@CorePluginsAdmin/marketplace'); @@ -69,7 +65,6 @@ class Controller extends Plugin\ControllerAdmin $showThemes = ($show === 'themes'); $view->plugins = $marketplace->searchPlugins($query, $sort, $showThemes); $view->showThemes = $showThemes; - $view->mode = $mode; $view->query = $query; $view->sort = $sort; $view->installNonce = Nonce::getNonce(static::INSTALL_NONCE); diff --git a/plugins/CorePluginsAdmin/Menu.php b/plugins/CorePluginsAdmin/Menu.php index 415ace73a6..fe3be3d841 100644 --- a/plugins/CorePluginsAdmin/Menu.php +++ b/plugins/CorePluginsAdmin/Menu.php @@ -10,7 +10,6 @@ namespace Piwik\Plugins\CorePluginsAdmin; use Piwik\Db; use Piwik\Menu\MenuAdmin; -use Piwik\Menu\MenuUser; use Piwik\Piwik; /** @@ -46,11 +45,10 @@ class Menu extends \Piwik\Plugin\Menu $order = 4); } - - if (Piwik::hasUserSuperUserAccess() && CorePluginsAdmin::isMarketplaceEnabled()) { - $menu->addManageItem('CorePluginsAdmin_Marketplace', - $this->urlForAction('marketplace', array('activated' => '', 'mode' => 'admin')), - $order = 12); + if ($this->isAllowedToSeeMarketPlace()) { + $menu->addPlatformItem('CorePluginsAdmin_Marketplace', + $this->urlForAction('marketplace', array('activated' => '', 'mode' => 'user')), + $order = 5); } } @@ -62,12 +60,4 @@ class Menu extends \Piwik\Plugin\Menu return $isMarketplaceEnabled && !$isAnonymous; } - public function configureUserMenu(MenuUser $menu) - { - if ($this->isAllowedToSeeMarketPlace()) { - $menu->addPlatformItem('CorePluginsAdmin_Marketplace', - $this->urlForAction('marketplace', array('activated' => '', 'mode' => 'user')), - $order = 5); - } - } } diff --git a/plugins/CorePluginsAdmin/templates/marketplace.twig b/plugins/CorePluginsAdmin/templates/marketplace.twig index a42b57682c..439d49b005 100644 --- a/plugins/CorePluginsAdmin/templates/marketplace.twig +++ b/plugins/CorePluginsAdmin/templates/marketplace.twig @@ -1,4 +1,4 @@ -{% extends mode is defined and mode == 'user' ? "user.twig" : "admin.twig" %} +{% extends "admin.twig" %} {% import '@CorePluginsAdmin/macros.twig' as pluginsMacro %} {% set title %}{{ 'CorePluginsAdmin_Marketplace'|translate }}{% endset %} diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts -Subproject e3b349bb7d75269962b31695d99f1e8ec7e44b3 +Subproject dd33d73ee4117d3c3e7f342e135e8fcd1da8dba diff --git a/plugins/CustomDimensions b/plugins/CustomDimensions -Subproject 212a703c5884c644cff37eea714a1be4494715c +Subproject d18b214313b8fde350f7092659af3e92de5a11a diff --git a/plugins/CustomVariables/Menu.php b/plugins/CustomVariables/Menu.php index b97aa1bb01..25b73712c5 100644 --- a/plugins/CustomVariables/Menu.php +++ b/plugins/CustomVariables/Menu.php @@ -9,7 +9,7 @@ namespace Piwik\Plugins\CustomVariables; use Piwik\Common; -use Piwik\Menu\MenuUser; +use Piwik\Menu\MenuAdmin; use Piwik\Piwik; use Piwik\Plugins\UsersManager\UserPreferences; @@ -20,14 +20,14 @@ use Piwik\Plugins\UsersManager\UserPreferences; */ class Menu extends \Piwik\Plugin\Menu { - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $userPreferences = new UserPreferences(); $default = $userPreferences->getDefaultWebsiteId(); $idSite = Common::getRequestVar('idSite', $default, 'int'); if (Piwik::isUserHasAdminAccess($idSite)) { - $menu->addManageItem('Custom Variables', $this->urlForAction('manage'), $orderId = 15); + $menu->addDiagnosticItem('Custom Variables', $this->urlForAction('manage'), $orderId = 20); } } } diff --git a/plugins/CustomVariables/templates/manage.twig b/plugins/CustomVariables/templates/manage.twig index dc170ff2c9..e10e1ee047 100644 --- a/plugins/CustomVariables/templates/manage.twig +++ b/plugins/CustomVariables/templates/manage.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% block topcontrols %} <div class="top_bar_sites_selector piwikTopControl"> diff --git a/plugins/CustomVariables/tests/UI/CustomVariables_spec.js b/plugins/CustomVariables/tests/UI/CustomVariables_spec.js index 1e247fca56..b6b036c87e 100644 --- a/plugins/CustomVariables/tests/UI/CustomVariables_spec.js +++ b/plugins/CustomVariables/tests/UI/CustomVariables_spec.js @@ -19,7 +19,7 @@ describe("CustomVariables", function () { }); it('should be visible in the menu', function (done) { - expect.screenshot('link_in_menu').to.be.captureSelector('li:contains(Manage)', function (page) { + expect.screenshot('link_in_menu').to.be.captureSelector('li:contains(Diagnostic)', function (page) { }, done); }); });
\ No newline at end of file diff --git a/plugins/ExamplePlugin/Menu.php b/plugins/ExamplePlugin/Menu.php index 7c9acb90f6..38ac0d4af8 100644 --- a/plugins/ExamplePlugin/Menu.php +++ b/plugins/ExamplePlugin/Menu.php @@ -10,7 +10,6 @@ namespace Piwik\Plugins\ExamplePlugin; use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; /** * This class allows you to add, remove or rename menu items. @@ -20,22 +19,12 @@ use Piwik\Menu\MenuUser; class Menu extends \Piwik\Plugin\Menu { - public function configureAdminMenu(MenuAdmin $menu) - { - // 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->addItem('My Top Item', null, $this->urlForDefaultAction(), $orderId = 30); } - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { // 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); diff --git a/plugins/ExampleUI/Menu.php b/plugins/ExampleUI/Menu.php index 35cf0d70b5..a99cca552c 100644 --- a/plugins/ExampleUI/Menu.php +++ b/plugins/ExampleUI/Menu.php @@ -8,11 +8,11 @@ */ namespace Piwik\Plugins\ExampleUI; -use Piwik\Menu\MenuUser; +use Piwik\Menu\MenuAdmin; class Menu extends \Piwik\Plugin\Menu { - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $menu->addPlatformItem('UI Notifications', $this->urlForAction('notifications'), $order = 10); } diff --git a/plugins/ExampleUI/templates/notifications.twig b/plugins/ExampleUI/templates/notifications.twig index ca69fcd8de..f47be46a0f 100644 --- a/plugins/ExampleUI/templates/notifications.twig +++ b/plugins/ExampleUI/templates/notifications.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% set title %}UI Notification demo{% endset %} diff --git a/plugins/Feedback/Menu.php b/plugins/Feedback/Menu.php index 19d3f62db5..63ec2b5033 100644 --- a/plugins/Feedback/Menu.php +++ b/plugins/Feedback/Menu.php @@ -8,18 +8,14 @@ */ namespace Piwik\Plugins\Feedback; -use Piwik\Menu\MenuUser; +use Piwik\Menu\MenuTop; use Piwik\Piwik; class Menu extends \Piwik\Plugin\Menu { - public function configureUserMenu(MenuUser $menu) + public function configureTopMenu(MenuTop $menu) { - $menu->addPlatformItem( - 'General_Help', - $this->urlForAction('index', array('segment' => false)), - $order = 99, - $tooltip = Piwik::translate('Feedback_TopLinkTooltip') - ); + $menu->registerMenuIcon('General_Help', 'icon-help'); + $menu->addItem('General_Help', null, array('module' => 'Feedback', 'action' => 'index'), $order = 990, Piwik::translate('General_Help')); } } diff --git a/plugins/Feedback/stylesheets/feedback.less b/plugins/Feedback/stylesheets/feedback.less index 187b07a020..80b98101cc 100644 --- a/plugins/Feedback/stylesheets/feedback.less +++ b/plugins/Feedback/stylesheets/feedback.less @@ -3,7 +3,7 @@ ul { list-style: none; padding: 0 0 0 20px; - font-size: 12px; + font-size: 13px; line-height: 18px; } @@ -13,6 +13,11 @@ p { line-height: 1.7em; + font-size: 13px; + } + + div { + max-width: 850px; } .piwik-donate-call { diff --git a/plugins/Feedback/templates/index.twig b/plugins/Feedback/templates/index.twig index 31e1ec83fc..214c883647 100644 --- a/plugins/Feedback/templates/index.twig +++ b/plugins/Feedback/templates/index.twig @@ -1,16 +1,16 @@ -{% extends 'user.twig' %} +{% extends 'dashboard.twig' %} {% set test_piwikUrl='http://demo.piwik.org/' %} {% set isPiwikDemo %}{{ piwikUrl == 'http://demo.piwik.org/' or piwikUrl == 'https://demo.piwik.org/'}}{% endset %} -{% set title %}{{ 'General_AboutPiwikX'|translate(piwikVersion) }}{% endset %} +{% set headline %}{{ 'General_AboutPiwikX'|translate(piwikVersion) }}{% endset %} {% block content %} <div id="feedback-faq" class="admin"> <h2 piwik-enriched-headline feature-name="{{ 'General_Help'|translate }}" - >{{ title }}</h2> + >{{ headline }}</h2> <div class="header_full"> <p>{{ 'General_PiwikIsACollaborativeProjectYouCanContributeAndDonate'|translate( diff --git a/plugins/Goals/Menu.php b/plugins/Goals/Menu.php index 258a0677e2..4d5f60a937 100644 --- a/plugins/Goals/Menu.php +++ b/plugins/Goals/Menu.php @@ -9,19 +9,19 @@ namespace Piwik\Plugins\Goals; use Piwik\Common; -use Piwik\Menu\MenuUser; +use Piwik\Menu\MenuAdmin; use Piwik\Piwik; use Piwik\Plugins\UsersManager\UserPreferences; class Menu extends \Piwik\Plugin\Menu { - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $userPreferences = new UserPreferences(); $idSite = $this->getIdSite($userPreferences->getDefaultWebsiteId()); if (Piwik::isUserHasAdminAccess($idSite)) { - $menu->addManageItem('Goals_Goals', $this->urlForAction('manage', array('idSite' => $idSite)), 1); + $menu->addManageItem('Goals_Goals', $this->urlForAction('manage', array('idSite' => $idSite)), 15); } } diff --git a/plugins/Goals/templates/manageGoals.twig b/plugins/Goals/templates/manageGoals.twig index 72124faf72..0b83540317 100644 --- a/plugins/Goals/templates/manageGoals.twig +++ b/plugins/Goals/templates/manageGoals.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% set title %}{{ 'Goals_ManageGoals'|translate }}{% endset %} diff --git a/plugins/MobileMessaging/Menu.php b/plugins/MobileMessaging/Menu.php index 8a17e42517..503f143cb4 100644 --- a/plugins/MobileMessaging/Menu.php +++ b/plugins/MobileMessaging/Menu.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\MobileMessaging; use Piwik\Menu\MenuAdmin; -use Piwik\Menu\MenuUser; use Piwik\Piwik; class Menu extends \Piwik\Plugin\Menu @@ -17,12 +16,9 @@ class Menu extends \Piwik\Plugin\Menu public function configureAdminMenu(MenuAdmin $menu) { if (Piwik::hasUserSuperUserAccess()) { - $menu->addSettingsItem('MobileMessaging_SettingsMenu', $this->urlForAction('index'), $order = 12); + $menu->addManageItem('MobileMessaging_SettingsMenu', $this->urlForAction('index'), $order = 12); } - } - public function configureUserMenu(MenuUser $menu) - { if (!Piwik::isUserIsAnonymous()) { $menu->addPersonalItem('MobileMessaging_SettingsMenu', $this->urlForAction('userSettings'), $order = 12); } diff --git a/plugins/MobileMessaging/templates/userSettings.twig b/plugins/MobileMessaging/templates/userSettings.twig index c4a4417a77..0bb2200979 100644 --- a/plugins/MobileMessaging/templates/userSettings.twig +++ b/plugins/MobileMessaging/templates/userSettings.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% set title %}{{ 'MobileMessaging_Settings_SMSProvider'|translate }}{% endset %} diff --git a/plugins/Morpheus/Menu.php b/plugins/Morpheus/Menu.php index c2bd081cdf..5fc5f5c6ed 100644 --- a/plugins/Morpheus/Menu.php +++ b/plugins/Morpheus/Menu.php @@ -10,7 +10,6 @@ namespace Piwik\Plugins\Morpheus; use Piwik\Development; use Piwik\Menu\MenuAdmin; -use Piwik\Menu\MenuUser; use Piwik\Piwik; class Menu extends \Piwik\Plugin\Menu @@ -22,17 +21,13 @@ class Menu extends \Piwik\Plugin\Menu $menu->registerMenuIcon('CorePluginsAdmin_MenuPlatform', 'icon-admin-platform'); $menu->registerMenuIcon('General_Settings', 'icon-admin-settings'); $menu->registerMenuIcon('CoreAdminHome_Administration', 'icon-admin-administration'); + $menu->registerMenuIcon('UsersManager_MenuPersonal', 'icon-user-personal'); + $menu->registerMenuIcon('CoreAdminHome_MenuManage', 'icon-user-manage'); + $menu->registerMenuIcon('CorePluginsAdmin_MenuPlatform', 'icon-user-platform'); if (Development::isEnabled() && Piwik::isUserHasSomeAdminAccess()) { $menu->addDevelopmentItem('UI Demo', $this->urlForAction('demo')); } - } - - public function configureUserMenu(MenuUser $menu) - { - $menu->registerMenuIcon('UsersManager_MenuPersonal', 'icon-user-personal'); - $menu->registerMenuIcon('CoreAdminHome_MenuManage', 'icon-user-manage'); - $menu->registerMenuIcon('CorePluginsAdmin_MenuPlatform', 'icon-user-platform'); if (Development::isEnabled() && Piwik::isUserHasSomeAdminAccess()) { $menu->addPlatformItem('UI Demo', $this->urlForAction('demo'), $order = 15); diff --git a/plugins/Morpheus/templates/admin.twig b/plugins/Morpheus/templates/admin.twig index bb669acf51..fac1ce7987 100644 --- a/plugins/Morpheus/templates/admin.twig +++ b/plugins/Morpheus/templates/admin.twig @@ -3,14 +3,15 @@ {% set categoryTitle %}{{ 'CoreAdminHome_Administration'|translate }}{% endset %} {% set bodyClass = postEvent('Template.bodyClass', 'admin') %} +{% set isAdminArea = true %} {% block body %} - {% if isSuperUser %} - {% set topMenuModule = 'CoreAdminHome' %} - {% set topMenuAction = 'generalSettings' %} - {% else %} - {% set topMenuModule = 'SitesManager' %} + {% if userIsAnonymous %} + {% set topMenuModule = 'ScheduledReports' %} {% set topMenuAction = 'index' %} + {% else %} + {% set topMenuModule = 'UsersManager' %} + {% set topMenuAction = 'userSettings' %} {% endif %} {{ parent() }} {% endblock %} diff --git a/plugins/Morpheus/templates/user.twig b/plugins/Morpheus/templates/user.twig deleted file mode 100644 index f1fed83d2e..0000000000 --- a/plugins/Morpheus/templates/user.twig +++ /dev/null @@ -1,56 +0,0 @@ -{% extends 'layout.twig' %} - -{% set categoryTitle %}{{ 'CoreAdminHome_Administration'|translate }}{% endset %} - -{% set bodyClass = postEvent('Template.bodyClass', 'admin') %} - -{% block body %} - {% if userIsAnonymous %} - {% set topMenuModule = 'ScheduledReports' %} - {% set topMenuAction = 'index' %} - {% else %} - {% if currentModule != 'Feedback' %} - {% set topMenuModule = 'UsersManager' %} - {% set topMenuAction = 'userSettings' %} - {% endif %} - {% endif %} - {{ parent() }} -{% endblock %} - -{% block root %} - {% include "@CoreHome/_topScreen.twig" %} - - {% import 'ajaxMacros.twig' as ajax %} - {{ ajax.requestErrorDiv(emailSuperUser|default(''), arePiwikProAdsEnabled) }} - {{ postEvent("Template.beforeContent", "user", currentModule) }} - - <div class="page"> - - {% if showMenu is not defined or showMenu %} - {% import '@CoreHome/_menu.twig' as menu %} - {{ menu.menu(userMenu, false, 'Menu--admin', currentModule, currentAction) }} - {% endif %} - - <div class="pageWrap"> - - <div class="top_controls"> - {% block topcontrols %} - {% endblock %} - </div> - - <div id="content" class="admin user"> - - {% include "@CoreHome/_notifications.twig" %} - - <div class="ui-confirm" id="alert"> - <h2></h2> - <input role="no" type="button" value="{{ 'General_Ok'|translate }}"/> - </div> - - {% block content %} - {% endblock %} - - </div> - </div> - </div> -{% endblock %} diff --git a/plugins/PrivacyManager/Menu.php b/plugins/PrivacyManager/Menu.php index 7fbba50e6c..1e3523f1da 100644 --- a/plugins/PrivacyManager/Menu.php +++ b/plugins/PrivacyManager/Menu.php @@ -16,9 +16,9 @@ class Menu extends \Piwik\Plugin\Menu public function configureAdminMenu(MenuAdmin $menu) { if (Piwik::isUserHasSomeAdminAccess()) { - $menu->addSettingsItem('PrivacyManager_MenuPrivacySettings', - $this->urlForAction('privacySettings'), - $order = 9); + $menu->addManageItem('PrivacyManager_MenuPrivacySettings', + $this->urlForAction('privacySettings'), + $order = 9); } } } diff --git a/plugins/ScheduledReports/Menu.php b/plugins/ScheduledReports/Menu.php index ea02b98b60..64a454dcc8 100644 --- a/plugins/ScheduledReports/Menu.php +++ b/plugins/ScheduledReports/Menu.php @@ -8,7 +8,7 @@ */ namespace Piwik\Plugins\ScheduledReports; -use Piwik\Menu\MenuUser; +use Piwik\Menu\MenuAdmin; use Piwik\Piwik; use Piwik\Plugins\MobileMessaging\MobileMessaging; use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging; @@ -18,7 +18,7 @@ class Menu extends \Piwik\Plugin\Menu const MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY = 'MobileMessaging_TopMenu'; const PDF_REPORTS_TOP_MENU_TRANSLATION_KEY = 'ScheduledReports_EmailReports'; - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $tooltip = Piwik::translate( \Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging') diff --git a/plugins/ScheduledReports/templates/index.twig b/plugins/ScheduledReports/templates/index.twig index 542fab8e70..05949d6b0a 100644 --- a/plugins/ScheduledReports/templates/index.twig +++ b/plugins/ScheduledReports/templates/index.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% set title %}{{ 'ScheduledReports_PersonalEmailReports'|translate }}{% endset %} diff --git a/plugins/UserCountry/Menu.php b/plugins/UserCountry/Menu.php index 92f88a7f14..48a6b21980 100644 --- a/plugins/UserCountry/Menu.php +++ b/plugins/UserCountry/Menu.php @@ -16,9 +16,9 @@ class Menu extends \Piwik\Plugin\Menu public function configureAdminMenu(MenuAdmin $menu) { if (UserCountry::isGeoLocationAdminEnabled() && Piwik::hasUserSuperUserAccess()) { - $menu->addSettingsItem('UserCountry_Geolocation', - $this->urlForAction('adminIndex'), - $order = 9); + $menu->addManageItem('UserCountry_Geolocation', + $this->urlForAction('adminIndex'), + $order = 9); } } } diff --git a/plugins/UsersManager/Menu.php b/plugins/UsersManager/Menu.php index 9f3175a3ef..277d96f63c 100644 --- a/plugins/UsersManager/Menu.php +++ b/plugins/UsersManager/Menu.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\UsersManager; use Piwik\Menu\MenuAdmin; -use Piwik\Menu\MenuUser; use Piwik\Piwik; class Menu extends \Piwik\Plugin\Menu @@ -21,12 +20,9 @@ class Menu extends \Piwik\Plugin\Menu } if (Piwik::hasUserSuperUserAccess() && API::getInstance()->getSitesAccessFromUser('anonymous')) { - $menu->addSettingsItem('UsersManager_AnonymousUser', $this->urlForAction('anonymousSettings'), $order = 20); + $menu->addManageItem('UsersManager_AnonymousUser', $this->urlForAction('anonymousSettings'), $order = 20); } - } - public function configureUserMenu(MenuUser $menu) - { if (!Piwik::isUserIsAnonymous()) { $menu->addItem('UsersManager_MenuPersonal', 'General_Settings', $this->urlForAction('userSettings'), 0); } diff --git a/plugins/UsersManager/templates/userSettings.twig b/plugins/UsersManager/templates/userSettings.twig index 6b075eda86..5752807eaf 100644 --- a/plugins/UsersManager/templates/userSettings.twig +++ b/plugins/UsersManager/templates/userSettings.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% set title %}{{ 'UsersManager_PersonalSettings'|translate }}{% endset %} diff --git a/plugins/Widgetize/Menu.php b/plugins/Widgetize/Menu.php index 850df3e2da..7ce5b188ba 100644 --- a/plugins/Widgetize/Menu.php +++ b/plugins/Widgetize/Menu.php @@ -8,12 +8,12 @@ */ namespace Piwik\Plugins\Widgetize; -use Piwik\Menu\MenuUser; +use Piwik\Menu\MenuAdmin; use Piwik\Piwik; class Menu extends \Piwik\Plugin\Menu { - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $tooltip = Piwik::translate('Widgetize_TopLinkTooltip'); $urlParams = $this->urlForAction('index', array('segment' => false)); diff --git a/plugins/Widgetize/templates/index.twig b/plugins/Widgetize/templates/index.twig index 8ada9906cf..19569aed92 100644 --- a/plugins/Widgetize/templates/index.twig +++ b/plugins/Widgetize/templates/index.twig @@ -1,4 +1,4 @@ -{% extends 'user.twig' %} +{% extends 'admin.twig' %} {% set title %}{{ 'General_Widgets'|translate }}{% endset %} diff --git a/tests/UI/specs/MeasurableManager_spec.js b/tests/UI/specs/MeasurableManager_spec.js index 691af5c436..500f2c0acc 100644 --- a/tests/UI/specs/MeasurableManager_spec.js +++ b/tests/UI/specs/MeasurableManager_spec.js @@ -31,7 +31,7 @@ describe("MeasurableManager", function () { }); it("should use measurable wording in menu", function (done) { - var selector = '#secondNavBar li:contains(Administration):first'; + var selector = '#secondNavBar li:contains(Manage):first'; expect.screenshot('measurable_menu_item').to.be.captureSelector(selector, function (page) { }, done); diff --git a/tests/UI/specs/Menus_spec.js b/tests/UI/specs/Menus_spec.js index 3e15888ecf..75142efd4a 100644 --- a/tests/UI/specs/Menus_spec.js +++ b/tests/UI/specs/Menus_spec.js @@ -38,20 +38,6 @@ describe("Menus", function () { }, done); }); - // user menu tests - it('should load the user reporting menu correctly', function (done) { - expect.screenshot('user_loaded').to.be.captureSelector('#secondNavBar', function (page) { - page.load("?" + generalParams + "&module=UsersManager&action=userSettings"); - }, done); - }); - - it('should change the user page correctly when a user menu item is clicked', function (done) { - expect.screenshot('user_changed').to.be.captureSelector('#secondNavBar', function (page) { - openMenuItem(page, 'Platform'); - openMenuItem(page, 'API'); - }, done); - }); - // admin menu tests it('should load the admin reporting menu correctly', function (done) { expect.screenshot('admin_loaded').to.be.captureSelector('#secondNavBar', function (page) { @@ -61,7 +47,7 @@ describe("Menus", function () { it('should change the admin page correctly when an admin menu item is clicked', function (done) { expect.screenshot('admin_changed').to.be.captureSelector('#secondNavBar', function (page) { - openMenuItem(page, 'Administration'); + openMenuItem(page, 'Manage'); openMenuItem(page, 'Websites'); }, done); }); |