Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Sep 30, 2013
2 parents 2e9c51a + b16d8cf commit 354f910
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
5 changes: 5 additions & 0 deletions core/PluginsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ public function uninstallPlugin($pluginName)
if(!$this->isPluginInFilesystem($pluginName)) {
throw new \Exception("You are trying to uninstall the plugin $pluginName but it was not found in the directory piwik/plugins/");
}

$this->returnLoadedPluginsInfo();
$plugin = $this->getLoadedPlugin($pluginName);
$plugin->uninstall();

self::deletePluginFromFilesystem($pluginName);

$this->removePluginFromPluginsConfig($pluginName);
Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,8 @@
"MenuPlatform": "Platform",
"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. "
"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?"
},
"CoreUpdater": {
"PluginDescription": "Piwik updating mechanism",
Expand Down
1 change: 1 addition & 0 deletions plugins/CorePluginsAdmin/CorePluginsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public function getJsFiles(&$jsFiles)
{
$jsFiles[] = "plugins/CoreHome/javascripts/popover.js";
$jsFiles[] = "plugins/CorePluginsAdmin/javascripts/pluginDetail.js";
$jsFiles[] = "plugins/CorePluginsAdmin/javascripts/pluginOverview.js";
}

}
26 changes: 26 additions & 0 deletions plugins/CorePluginsAdmin/javascripts/pluginOverview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*!
* Piwik - Web Analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

$(document).ready(function () {

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

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

if (!link) {
return;
}

piwikHelper.modalConfirm('#confirmUninstallPlugin', {
yes: function () {
window.location = link;
}
});
});

});
10 changes: 9 additions & 1 deletion plugins/CorePluginsAdmin/templates/macros.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@

{% macro tablePlugins(pluginsInfo, activateNonce, deactivateNonce, uninstallNonce, isTheme) %}

<div id="confirmUninstallPlugin" class="ui-confirm">

<h2 id="uninstallPluginConfirm">{{ 'CorePluginsAdmin_UninstallConfirm'|translate }}</h2>
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>

</div>

<div class='entityContainer'>
<table class="dataTable entityTable">
<thead>
Expand Down Expand Up @@ -84,7 +92,7 @@
{{ 'CorePluginsAdmin_Active'|translate }}
{% else %}
{{ 'CorePluginsAdmin_Inactive'|translate }} <br/>
- {% if plugin.uninstallable %}<a href='index.php?module=CorePluginsAdmin&action=uninstall&pluginName={{ name }}&nonce={{
- {% if plugin.uninstallable %}<a class="uninstall" href='index.php?module=CorePluginsAdmin&action=uninstall&pluginName={{ name }}&nonce={{
uninstallNonce }}'>uninstall</a>{% endif %}
{% endif %}
</td>
Expand Down
2 changes: 1 addition & 1 deletion plugins/SecurityInfo

0 comments on commit 354f910

Please sign in to comment.