Skip to content
Extraits de code Groupes Projets
Valider fe239518 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #5994 add marketplace link to user menu and actually highlight settings...

refs #5994 add marketplace link to user menu and actually highlight settings in the user menu only if the user is on the user settings for instance to prevent Marketplace and Settings is highlight but also because it does not really make sense otherwise
parent 7145523b
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
&.active { &.active {
background-color: @color-silver-l80; background-color: @color-silver-l80;
cursor: default;
} }
&.category { &.category {
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
piwik-menudropdown> piwik-menudropdown>
{% if userLogin != 'anonymous' %} {% if userLogin != 'anonymous' %}
{% if isAdminLayout is defined %} {% if isAdminLayout is defined and currentModule == 'UsersManager' and currentAction == 'userSettings' %}
<a class="item active">{{ 'General_Settings'|translate }}</a> <a class="item active" href="index.php?module=CoreAdminHome">{{ 'General_Settings'|translate }}</a>
{% else %} {% else %}
<a class="item" href="index.php?module=CoreAdminHome">{{ 'General_Settings'|translate }}</a> <a class="item" href="index.php?module=CoreAdminHome">{{ 'General_Settings'|translate }}</a>
{% endif %} {% endif %}
......
...@@ -10,6 +10,7 @@ namespace Piwik\Plugins\CorePluginsAdmin; ...@@ -10,6 +10,7 @@ namespace Piwik\Plugins\CorePluginsAdmin;
use Piwik\Db; use Piwik\Db;
use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuAdmin;
use Piwik\Menu\MenuUser;
use Piwik\Piwik; use Piwik\Piwik;
/** /**
...@@ -52,7 +53,7 @@ class Menu extends \Piwik\Plugin\Menu ...@@ -52,7 +53,7 @@ class Menu extends \Piwik\Plugin\Menu
$order = 3); $order = 3);
} }
if ($isMarketplaceEnabled && !$isAnonymous) { if ($this->isAllowedToSeeMarketPlace()) {
$menu->addPlatformItem('CorePluginsAdmin_Marketplace', $menu->addPlatformItem('CorePluginsAdmin_Marketplace',
array('module' => 'CorePluginsAdmin', 'action' => 'extend', 'activated' => ''), array('module' => 'CorePluginsAdmin', 'action' => 'extend', 'activated' => ''),
$order = 5); $order = 5);
...@@ -60,4 +61,20 @@ class Menu extends \Piwik\Plugin\Menu ...@@ -60,4 +61,20 @@ class Menu extends \Piwik\Plugin\Menu
} }
} }
private function isAllowedToSeeMarketPlace()
{
$isAnonymous = Piwik::isUserIsAnonymous();
$isMarketplaceEnabled = CorePluginsAdmin::isMarketplaceEnabled();
return $isMarketplaceEnabled && !$isAnonymous;
}
public function configureUserMenu(MenuUser $menu)
{
if ($this->isAllowedToSeeMarketPlace()) {
$menu->addPlatformItem('CorePluginsAdmin_Marketplace',
array('module' => 'CorePluginsAdmin', 'action' => 'browsePlugins', 'activated' => ''),
$order = 5);
}
}
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter