mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
Merge branch 'master' of https://github.com/slawkens/myaac
This commit is contained in:
commit
d4900eac84
@ -46,28 +46,33 @@ if(isset($_REQUEST['uninstall'])){
|
|||||||
error('Plugin ' . $uninstall . ' does not exist.');
|
error('Plugin ' . $uninstall . ' does not exist.');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$string = file_get_contents($filename);
|
if(!isset($plugin_info['uninstall'])) {
|
||||||
$plugin_info = json_decode($string, true);
|
error("Plugin doesn't have uninstall options defined. Skipping...");
|
||||||
if($plugin_info == false) {
|
|
||||||
warning('Cannot load plugin info ' . $uninstall . '.json');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$success = true;
|
$string = file_get_contents($filename);
|
||||||
foreach($plugin_info['uninstall'] as $file) {
|
$plugin_info = json_decode($string, true);
|
||||||
$file = BASE . $file;
|
if($plugin_info == false) {
|
||||||
if(!deleteDirectory($file)) {
|
error('Cannot load plugin info ' . $uninstall . '.json');
|
||||||
$success = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($success) {
|
|
||||||
if($cache->enabled()) {
|
|
||||||
$cache->delete('templates');
|
|
||||||
}
|
|
||||||
success('Successfully uninstalled plugin ' . $uninstall);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
error('Error while uninstalling plugin ' . $uninstall . ': ' . error_get_last());
|
$success = true;
|
||||||
|
foreach($plugin_info['uninstall'] as $file) {
|
||||||
|
$file = BASE . $file;
|
||||||
|
if(!deleteDirectory($file)) {
|
||||||
|
$success = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($success) {
|
||||||
|
if($cache->enabled()) {
|
||||||
|
$cache->delete('templates');
|
||||||
|
}
|
||||||
|
success('Successfully uninstalled plugin ' . $uninstall);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
error('Error while uninstalling plugin ' . $uninstall . ': ' . error_get_last());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,11 @@
|
|||||||
<td>{{ plugin.version }}</td>
|
<td>{{ plugin.version }}</td>
|
||||||
<td>{{ plugin.author }}</td>
|
<td>{{ plugin.author }}</td>
|
||||||
<td>{{ plugin.contact }}</td>
|
<td>{{ plugin.contact }}</td>
|
||||||
<td><a href="?p=plugins&uninstall={{ plugin.file }}" onclick="return confirm('Are you sure?');">Uninstall</a></td>
|
<td>
|
||||||
|
{% if plugin.uninstall %}
|
||||||
|
<a href="?p=plugins&uninstall={{ plugin.file }}" onclick="return confirm('Are you sure?');">Uninstall</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
Loading…
x
Reference in New Issue
Block a user