Skip to content

Commit

Permalink
refs matomo-org#546 display the name of the plugin in the confirm mes…
Browse files Browse the repository at this point in the history
…sage
  • Loading branch information
tsteur committed Sep 30, 2013
1 parent 354f910 commit b79c18f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@
"MenuExtend": "Extend",
"PluginNotCompatibleWith": "%1$s plugin is not compatible with %2$s.",
"PluginAskDevToUpdate": "If you enjoyed this plugin, maybe you can ask the developers to update it to work on the latest Piwik. ",
"UninstallConfirm": "You are about to uninstall a plugin. The plugin will be completely removed from your platform and it won't be recoverable. Are you sure you want to do this?"
"UninstallConfirm": "You are about to uninstall a plugin %s. The plugin will be completely removed from your platform and it won't be recoverable. Are you sure you want to do this?"
},
"CoreUpdater": {
"PluginDescription": "Piwik updating mechanism",
Expand Down
15 changes: 13 additions & 2 deletions plugins/CorePluginsAdmin/javascripts/pluginOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,26 @@

$(document).ready(function () {

var uninstallConfirmMessage = '';

$('#plugins .uninstall').click(function (event) {
event.preventDefault();

var link = $(this).attr('href');

if (!link) {
var pluginName = $(this).attr('data-pluginName');

if (!link || !pluginName) {
return;
}

if (!uninstallConfirmMessage) {
uninstallConfirmMessage = $('#uninstallPluginConfirm').text();
}

var messageToDisplay = uninstallConfirmMessage.replace('%s', pluginName);

$('#uninstallPluginConfirm').text(messageToDisplay);

piwikHelper.modalConfirm('#confirmUninstallPlugin', {
yes: function () {
window.location = link;
Expand Down
2 changes: 1 addition & 1 deletion plugins/CorePluginsAdmin/templates/macros.twig
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
{{ 'CorePluginsAdmin_Active'|translate }}
{% else %}
{{ 'CorePluginsAdmin_Inactive'|translate }} <br/>
- {% if plugin.uninstallable %}<a class="uninstall" href='index.php?module=CorePluginsAdmin&action=uninstall&pluginName={{ name }}&nonce={{
- {% if plugin.uninstallable %}<a data-pluginName="{{ name|escape('html_attr') }}" class="uninstall" href='index.php?module=CorePluginsAdmin&action=uninstall&pluginName={{ name }}&nonce={{
uninstallNonce }}'>uninstall</a>{% endif %}
{% endif %}
</td>
Expand Down

0 comments on commit b79c18f

Please sign in to comment.