diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-26 20:28:46 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-26 20:28:46 +0000 |
commit | 9c8be228a73a602ac3e91e30bf980dd1cc695a81 (patch) | |
tree | 46b3b2dc825f652410aba04f2d148b566e5b61e5 /admin/modules.php | |
parent | a41697ea25a58ea5db5ed46a251fb62364626b1b (diff) | |
download | ampache-9c8be228a73a602ac3e91e30bf980dd1cc695a81.tar.gz ampache-9c8be228a73a602ac3e91e30bf980dd1cc695a81.tar.bz2 ampache-9c8be228a73a602ac3e91e30bf980dd1cc695a81.zip |
playlist switcher, plugin interface and the shell of a lastfm plugin (need patch file)
Diffstat (limited to 'admin/modules.php')
-rw-r--r-- | admin/modules.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/admin/modules.php b/admin/modules.php index 5dde981c..7e070610 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -57,6 +57,48 @@ switch ($action) { $body = ''; show_confirmation($title,$body,$url); break; + case 'install_plugin': + /* Verify that this plugin exists */ + $plugins = get_plugins(); + if (!array_key_exists($_REQUEST['plugin'],$plugins)) { + debug_event('plugins','Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected','1'); + break; + } + $plugin = new Plugin($_REQUEST['plugin']); + $plugin->install(); + + /* Show Confirmation */ + $url = conf('web_path') . '/admin/modules.php'; + $title = _('Plugin Activated'); + $body = ''; + show_confirmation($title,$body,$url); + break; + case 'confirm_uninstall_plugin': + $plugin = scrub_in($_REQUEST['plugin']); + $url = conf('web_path') . '/admin/modules.php?action=uninstall_plugin&plugin=' . $plugin; + $title = _('Are you sure you want to remove this plugin?'); + $body = ''; + show_confirmation($title,$body,$url,1); + break; + case 'uninstall_plugin': + /* Verify that this plugin exists */ + $plugins = get_plugins(); + if (!array_key_exists($_REQUEST['plugin'],$plugins)) { + debug_event('plugins','Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected','1'); + break; + } + $plugin = new Plugin($_REQUEST['plugin']); + $plugin->uninstall(); + + /* Show Confirmation */ + $url = conf('web_path') . '/admin/modules.php'; + $title = _('Plugin Deactivated'); + $body = ''; + show_confirmation($title,$body,$url); + break; + case 'upgrade_plugin': + + break; default: require_once (conf('prefix') . '/templates/show_modules.inc.php'); break; |