Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-10-07 15:31:27 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-10-07 15:31:27 +0300
commit6f465eb01c10d578a4ad038dc003cfe194d7a218 (patch)
tree3ee00692f89cb2ba923115d74036ee3ae0144c68
parent10d482f1d3deb4c717fbb87f523428196634a326 (diff)
various fixes for left menu, code tweaks and documented new method to register icons
-rw-r--r--CHANGELOG.md2
-rw-r--r--core/Menu/MenuAbstract.php12
-rw-r--r--core/Updates/2.15.0-b16.php (renamed from core/Updates/2.15.0-b13.php)2
-rw-r--r--core/Version.php2
-rw-r--r--plugins/CoreAdminHome/Menu.php3
-rw-r--r--plugins/CoreHome/CoreHome.php2
-rw-r--r--plugins/CoreHome/Menu.php17
-rw-r--r--plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html2
-rw-r--r--plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less2
-rw-r--r--plugins/CoreHome/stylesheets/layout.less7
-rw-r--r--plugins/CoreHome/templates/_menu.twig2
-rw-r--r--plugins/CoreHome/templates/_topBar.twig8
-rw-r--r--plugins/Dashboard/stylesheets/dashboard.less4
m---------tests/UI/expected-ui-screenshots0
14 files changed, 39 insertions, 26 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f2b9c62546..5b29af62ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,10 +26,10 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'
### Internal change
* In `piwik.js` we replaced [JSON2](https://github.com/douglascrockford/JSON-js) with [JSON3](https://bestiejs.github.io/json3/) to implement CSP (Content Security Policy) as JSON3 does not use `eval()`. JSON3 will be used if a browser does not provide a native JSON API. We are using `JSON3` in a way that it will not conflict if your website is using `JSON3` as well.
-
### New APIs
* The JavaScript Tracker `piwik.js` got a new method `logAllContentBlocksOnPage` to log all found content blocks within a page to the console. This is useful to debug / test content tracking. It can be triggered via `_paq.push(['logAllContentBlocksOnPage'])`
* The Class `Piwik\Plugins\Login\Controller` is now considered a public API.
+* The new method `Piwik\Menu\MenuAbstract::registerMenuIcon()` can be used to define an icon for a menu category to replace the default arrow icon.
### Internal Change
* The option `branch` of the console command `development:sync-system-test-processed` was removed as it is no longer needed.
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php
index a742df41ab..777d97b523 100644
--- a/core/Menu/MenuAbstract.php
+++ b/core/Menu/MenuAbstract.php
@@ -49,9 +49,15 @@ abstract class MenuAbstract extends Singleton
return $this->menu;
}
- public function registerMenuIcon($menuName, $icon)
+ /**
+ * Let's you register a menu icon for a certain menu category to replace the default arrow icon.
+ *
+ * @param string $menuName The translation key of a main menu category, eg 'Dashboard_Dashboard'
+ * @param string $iconCssClass The css class name of an icon, eg 'icon-user'
+ */
+ public function registerMenuIcon($menuName, $iconCssClass)
{
- $this->menuIcons[$menuName] = $icon;
+ $this->menuIcons[$menuName] = $iconCssClass;
}
/**
@@ -173,7 +179,7 @@ abstract class MenuAbstract extends Singleton
if (!empty($this->menuIcons[$menuName])) {
$this->menu[$menuName]['_icon'] = $this->menuIcons[$menuName];
} else {
- $this->menu[$menuName]['_icon'] = 'icon-arrow-right';
+ $this->menu[$menuName]['_icon'] = '';
}
}
if (!empty($subMenuName)) {
diff --git a/core/Updates/2.15.0-b13.php b/core/Updates/2.15.0-b16.php
index 2420eeaecc..a37e621129 100644
--- a/core/Updates/2.15.0-b13.php
+++ b/core/Updates/2.15.0-b16.php
@@ -13,7 +13,7 @@ use Piwik\Plugin\Manager;
use Piwik\Updater;
use Piwik\Updates;
-class Updates_2_15_0_b13 extends Updates
+class Updates_2_15_0_b16 extends Updates
{
public function doUpdate(Updater $updater)
diff --git a/core/Version.php b/core/Version.php
index c9a04c200a..dd1ae538d2 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -20,7 +20,7 @@ final class Version
* The current Piwik version.
* @var string
*/
- const VERSION = '2.15.0-b15';
+ const VERSION = '2.15.0-b16';
public function isStableVersion($version)
{
diff --git a/plugins/CoreAdminHome/Menu.php b/plugins/CoreAdminHome/Menu.php
index 91d8ac8197..b4621e2f5e 100644
--- a/plugins/CoreAdminHome/Menu.php
+++ b/plugins/CoreAdminHome/Menu.php
@@ -51,7 +51,8 @@ class Menu extends \Piwik\Plugin\Menu
$url = $this->urlForAction('generalSettings');
}
- $menu->addItem('icon-configure', null, $url, 980, Piwik::translate('CoreAdminHome_Administration'));
+ $menu->registerMenuIcon('CoreAdminHome_Administration', 'icon-configure');
+ $menu->addItem('CoreAdminHome_Administration', null, $url, 980, Piwik::translate('CoreAdminHome_Administration'));
}
}
diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php
index 802c79004b..5b023b9cb3 100644
--- a/plugins/CoreHome/CoreHome.php
+++ b/plugins/CoreHome/CoreHome.php
@@ -180,7 +180,7 @@ class CoreHome extends \Piwik\Plugin
$translationKeys[] = 'General_Hide';
$translationKeys[] = 'General_Website';
$translationKeys[] = 'General_ChooseWebsite';
- $translationKeys[] = 'Intl_YearShort';
+ $translationKeys[] = 'Intl_Year_Short';
$translationKeys[] = 'General_MultiSitesSummary';
$translationKeys[] = 'General_SearchNoResults';
$translationKeys[] = 'CoreHome_YouAreUsingTheLatestVersion';
diff --git a/plugins/CoreHome/Menu.php b/plugins/CoreHome/Menu.php
index 03c847ac97..20d9ac8eb8 100644
--- a/plugins/CoreHome/Menu.php
+++ b/plugins/CoreHome/Menu.php
@@ -27,24 +27,29 @@ class Menu extends \Piwik\Plugin\Menu
}
if (Plugin\Manager::getInstance()->isPluginActivated('Feedback')) {
- $menu->addItem('icon-help', null, array('module' => 'Feedback', 'action' => 'index'), $order = 990, Piwik::translate('General_Help'));
+ $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('icon-user', null, array('module' => 'ScheduledReports', 'action' => 'index'), 970, $login);
+ $menu->addItem($login, null, array('module' => 'ScheduledReports', 'action' => 'index'), 970, $login);
} else {
- $menu->addItem('icon-user', null, array('module' => 'API', 'action' => 'listAllAPI'), 970, $login);
+ $menu->addItem($login, null, array('module' => 'API', 'action' => 'listAllAPI'), 970, $login);
}
} else {
- $menu->addItem('icon-user', null, array('module' => 'UsersManager', 'action' => 'userSettings'), 970, $login);
+ $menu->addItem($login, null, array('module' => 'UsersManager', 'action' => 'userSettings'), 970, $login);
}
$module = $this->getLoginModule();
if (Piwik::isUserIsAnonymous()) {
- $menu->addItem('icon-sign-in', null, array('module' => $module, 'action' => false), 1000, Piwik::translate('Login_LogIn'));
+ $menu->registerMenuIcon('Login_LogIn', 'icon-sign-in');
+ $menu->addItem('Login_LogIn', null, array('module' => $module, 'action' => false), 1000, Piwik::translate('Login_LogIn'));
} else {
- $menu->addItem('icon-sign-out', null, array('module' => $module, 'action' => 'logout', 'idSite' => null), 1000, Piwik::translate('General_Logout'));
+ $menu->registerMenuIcon('General_Logout', 'icon-sign-out');
+ $menu->addItem('General_Logout', null, array('module' => $module, 'action' => 'logout', 'idSite' => null), 1000, Piwik::translate('General_Logout'));
}
}
diff --git a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html
index d1964d1ac4..5da730a2e2 100644
--- a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html
+++ b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html
@@ -5,7 +5,7 @@
title="{{ tooltip }}"
ng-bind-html="menuTitle"/>
- <div class="items" ng-show="view.showItems">
+ <div class="items borderedControl" ng-show="view.showItems">
<div class="search" ng-if="showSearch && view.showItems">
<input type="text"
piwik-focus-if="view.showItems"
diff --git a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less
index 05d0a0771f..a36d00c0f5 100644
--- a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less
+++ b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less
@@ -27,7 +27,7 @@
.items {
z-index: 200;
position: absolute;
- border: 1px solid @color-silver-l80 !important;
+ border: 1px solid @color-silver-l80;
background: @theme-color-background-base;
max-height: 400px;
overflow-y: auto;
diff --git a/plugins/CoreHome/stylesheets/layout.less b/plugins/CoreHome/stylesheets/layout.less
index 7b140d3ab3..649c2ece47 100644
--- a/plugins/CoreHome/stylesheets/layout.less
+++ b/plugins/CoreHome/stylesheets/layout.less
@@ -272,17 +272,14 @@
.items {
width: 224px;
- background-color: @theme-color-background-base;
- border: 1px solid @theme-color-background-tinyContrast;
box-shadow: 0 1px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
- border: 1px solid #f2f2f2 !important;
.search {
margin: 15px 16px 10px 17px;
}
.item {
- padding: 10px 16px 4px !important;
+ padding: 10px 16px 10px !important;
min-height: 25px;
height: auto;
}
@@ -338,7 +335,7 @@
&.Menu--admin .navbar > li {
> .item {
- padding: 14px 21px 6px 14px;
+ padding: 14px 21px 6px 19px;
}
.item .icon-arrow-right:before {
content: "\e63b";
diff --git a/plugins/CoreHome/templates/_menu.twig b/plugins/CoreHome/templates/_menu.twig
index 2fee6907e5..81cb0f9a9f 100644
--- a/plugins/CoreHome/templates/_menu.twig
+++ b/plugins/CoreHome/templates/_menu.twig
@@ -44,7 +44,7 @@
<li id="{% if level2._url is defined and level2._url is not empty %}{{ _self.getId(level2._url) }}{% endif %}" class="menuTab">
<a class="item" {% if level2._url is defined and level2._url is not empty %}href="{% if anchorlink %}#{% else %}index.php?{% endif %}{{ _self.getFirstUrl(level2._url) }}"{% endif %}>
- <span class="menu-icon {{ level2._icon }}"></span>{{ level1|translate }}
+ <span class="menu-icon {{ level2._icon|default('icon-arrow-right') }}"></span>{{ level1|translate }}
<span class="hidden">
{{ 'CoreHome_Menu'|translate }}
</span>
diff --git a/plugins/CoreHome/templates/_topBar.twig b/plugins/CoreHome/templates/_topBar.twig
index c6d7141d92..e69e9c1978 100644
--- a/plugins/CoreHome/templates/_topBar.twig
+++ b/plugins/CoreHome/templates/_topBar.twig
@@ -1,9 +1,9 @@
{{ postEvent("Template.beforeTopBar", userAlias, userLogin, topMenu, userMenu) }}
<ul class="navbar-right">
- {% macro menuItemLabel(label) %}
- {% if label starts with 'icon-' %}
- <span class="{{ label|striptags }}"></span>
+ {% macro menuItemLabel(label, icon) %}
+ {% if icon is defined and icon and icon starts with 'icon-' %}
+ <span class="{{ icon|striptags }}"></span>
{% else %}
{{ label|translate }}
{% endif %}
@@ -16,7 +16,7 @@
<a {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %}
class="topBarElem {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %}active{% endif %}"
id="topmenu-{{ menu._url.module|lower }}"
- href="index.php{{ menu._url|urlRewriteWithParameters }}">{{ _self.menuItemLabel(label) }}</a>
+ href="index.php{{ menu._url|urlRewriteWithParameters }}">{{ _self.menuItemLabel(label, menu._icon) }}</a>
{% endif %}
{% endmacro %}
diff --git a/plugins/Dashboard/stylesheets/dashboard.less b/plugins/Dashboard/stylesheets/dashboard.less
index cd928a97da..39ad2e3ed7 100644
--- a/plugins/Dashboard/stylesheets/dashboard.less
+++ b/plugins/Dashboard/stylesheets/dashboard.less
@@ -2,6 +2,10 @@
margin: 0 -6px;
}
+#standalone #dashboard {
+ margin: -10px -6px 0;
+}
+
#dashboard {
.col {
diff --git a/tests/UI/expected-ui-screenshots b/tests/UI/expected-ui-screenshots
-Subproject ae43d0c24150d059c9350c89fe20589d171fb40
+Subproject 226ef830c369abf63bea6d350c7598fc3e8662e