diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-24 03:06:17 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-24 03:06:17 +0400 |
commit | 1297f8109d8a86bc96ac285a7556c8b7bc4917ad (patch) | |
tree | 652ed0860f150396846f0ed4b24fa34a886aba1c /plugins | |
parent | ff25602897305a7033f8f8af62499db79497b3ed (diff) |
refs #4126 display a link to plugin settings page from plugins and themes page as well as after activating a plugin
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreAdminHome/Controller.php | 2 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/Controller.php | 3 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/stylesheets/marketplace.less | 7 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/templates/macros.twig | 7 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/templates/plugins.twig | 8 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/templates/themes.twig | 2 |
6 files changed, 24 insertions, 5 deletions
diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php index f4d1302198..f07ec674b1 100644 --- a/plugins/CoreAdminHome/Controller.php +++ b/plugins/CoreAdminHome/Controller.php @@ -101,7 +101,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $view = new View('@CoreAdminHome/pluginSettings'); - $settings = SettingsManager::getAllPluginSettings(); + $settings = SettingsManager::getPluginSettingsForCurrentUser(); ksort($settings); $view->pluginSettings = $settings; $view->nonce = Nonce::getNonce(static::SET_PLUGIN_SETTINGS_NONCE); diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index 33a97d27b0..386397269f 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -18,6 +18,7 @@ use Piwik\Nonce; use Piwik\Piwik; use Piwik\Plugin; use Piwik\Plugin\Manager; +use Piwik\Settings\Manager as SettingsManager; use Piwik\Url; use Piwik\View; @@ -212,6 +213,8 @@ class Controller extends Plugin\ControllerAdmin $view->otherUsersCount = count($users) - 1; $view->themeEnabled = \Piwik\Plugin\Manager::getInstance()->getThemeEnabled()->getPluginName(); + $view->pluginNamesHavingSettings = array_keys(SettingsManager::getPluginSettingsForCurrentUser()); + if (CorePluginsAdmin::isMarketplaceEnabled()) { $marketplace = new Marketplace(); $view->pluginsHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly); diff --git a/plugins/CorePluginsAdmin/stylesheets/marketplace.less b/plugins/CorePluginsAdmin/stylesheets/marketplace.less index 653d255051..5bea89b89f 100644 --- a/plugins/CorePluginsAdmin/stylesheets/marketplace.less +++ b/plugins/CorePluginsAdmin/stylesheets/marketplace.less @@ -9,6 +9,13 @@ .callToAction { font-size: 1.1em;line-height: 2em; } } +#plugins .settingsLink { + text-align: right; + width: 100%; + display: inline-block; + font-style: italic; +} + #installPluginByUpload { .description { margin-top: 30px; diff --git a/plugins/CorePluginsAdmin/templates/macros.twig b/plugins/CorePluginsAdmin/templates/macros.twig index 8f44cca872..0c64cca4ae 100644 --- a/plugins/CorePluginsAdmin/templates/macros.twig +++ b/plugins/CorePluginsAdmin/templates/macros.twig @@ -41,7 +41,7 @@ {% endmacro %} -{% macro tablePlugins(pluginsInfo, activateNonce, deactivateNonce, uninstallNonce, isTheme) %} +{% macro tablePlugins(pluginsInfo, pluginNamesHavingSettings, activateNonce, deactivateNonce, uninstallNonce, isTheme) %} <div id="confirmUninstallPlugin" class="ui-confirm"> @@ -72,6 +72,11 @@ {% endif %} {{ name }} {% if plugin.info.homepage is defined %}</a>{% endif %} + + {% if name in pluginNamesHavingSettings %} + <br /><br /> + <a href="{{ linkTo({'module':'CoreAdminHome', 'action': 'pluginSettings'}) }}#{{ name|e('html_attr') }}" class="settingsLink">{{ 'General_Settings'|translate }}</a> + {% endif %} </td> <td class="vers">{{ plugin.info.version }}</td> <td class="desc"> diff --git a/plugins/CorePluginsAdmin/templates/plugins.twig b/plugins/CorePluginsAdmin/templates/plugins.twig index c87114c5a1..236e81ee97 100644 --- a/plugins/CorePluginsAdmin/templates/plugins.twig +++ b/plugins/CorePluginsAdmin/templates/plugins.twig @@ -6,7 +6,11 @@ <div style="max-width:980px;"> {% if activatedPluginName %} - <div id="feedback-success"><strong>Well done!</strong> You have successfully activated plugin {{ activatedPluginName }}</div> + <div id="feedback-success"><strong>Well done!</strong> You have successfully activated plugin {{ activatedPluginName }}. + {% if activatedPluginName in pluginNamesHavingSettings %} + You can change <a href="{{ linkTo({'module':'CoreAdminHome', 'action': 'pluginSettings'}) }}#{{ activatedPluginName|e('html_attr') }}">settings</a> for this plugin now. + {% endif %} + </div> {% endif %} {% if pluginsHavingUpdate|length %} @@ -21,7 +25,7 @@ <p>{{ 'CorePluginsAdmin_MainDescription'|translate }}</p> - {{ plugins.tablePlugins(pluginsInfo, activateNonce, deactivateNonce, uninstallNonce, false) }} + {{ plugins.tablePlugins(pluginsInfo, pluginNamesHavingSettings, activateNonce, deactivateNonce, uninstallNonce, false) }} </div> {% endblock %}
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/templates/themes.twig b/plugins/CorePluginsAdmin/templates/themes.twig index 2889590e1e..0c9a2d73c0 100644 --- a/plugins/CorePluginsAdmin/templates/themes.twig +++ b/plugins/CorePluginsAdmin/templates/themes.twig @@ -25,7 +25,7 @@ {% endif %} </p> - {{ plugins.tablePlugins(pluginsInfo, activateNonce, deactivateNonce, uninstallNonce, true) }} + {{ plugins.tablePlugins(pluginsInfo, pluginNamesHavingSettings, activateNonce, deactivateNonce, uninstallNonce, true) }} </div> {% endblock %} |