diff options
author | patdenice <patdenice@piwigo.org> | 2008-03-05 17:54:32 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-03-05 17:54:32 +0000 |
commit | 7e1e705f8ba79c7579a1c433ad6cf3488a4e349b (patch) | |
tree | 43fefa004b6f5adfd62d992e7d7362f44ff9c3d7 /admin/plugins.php | |
parent | ef77dac315831446c72fbd1f1746db94d12f1207 (diff) |
user_list.tpl goes smarty.
Correction in plugins update and delete options.
git-svn-id: http://piwigo.org/svn/trunk@2253 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/plugins.php | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/admin/plugins.php b/admin/plugins.php index d40158b33..a4260513b 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -35,6 +35,34 @@ $my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugins'; // +-----------------------------------------------------------------------+ +// | Sections definitions | +// +-----------------------------------------------------------------------+ +if (empty($_GET['section'])) +{ + $page['section'] = 'list'; +} +else +{ + $page['section'] = $_GET['section']; +} + +$tab_link = $my_base_url . '&section='; + +// TabSheet +$tabsheet = new tabsheet(); +// TabSheet initialization +$tabsheet->add('list', l10n('plugins_tab_list'), $tab_link.'list'); +$tabsheet->add('update', l10n('plugins_tab_update'), $tab_link.'update'); +$tabsheet->add('new', l10n('plugins_tab_new'), $tab_link.'new'); +// TabSheet selection +$tabsheet->select($page['section']); +// Assign tabsheet to template +$tabsheet->assign(); + +$my_base_url .= '§ion=' . $page['section']; + + +// +-----------------------------------------------------------------------+ // | perform requested actions | // +-----------------------------------------------------------------------+ if (isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser()) @@ -153,7 +181,11 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"'; break; case 'delete': - if (!deltree(PHPWG_PLUGINS_PATH . $plugin_id)) + if (!empty($crt_db_plugin)) + { + array_push($errors, 'CANNOT delete - PLUGIN IS INSTALLED'); + } + elseif (!deltree(PHPWG_PLUGINS_PATH . $plugin_id)) { send_to_trash(PHPWG_PLUGINS_PATH . $plugin_id); } @@ -177,34 +209,6 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"'; // +-----------------------------------------------------------------------+ -// | Sections definitions | -// +-----------------------------------------------------------------------+ -if (empty($_GET['section'])) -{ - $page['section'] = 'list'; -} -else -{ - $page['section'] = $_GET['section']; -} - -$tab_link = $my_base_url . '&section='; - -// TabSheet -$tabsheet = new tabsheet(); -// TabSheet initialization -$tabsheet->add('list', l10n('plugins_tab_list'), $tab_link.'list'); -$tabsheet->add('update', l10n('plugins_tab_update'), $tab_link.'update'); -$tabsheet->add('new', l10n('plugins_tab_new'), $tab_link.'new'); -// TabSheet selection -$tabsheet->select($page['section']); -// Assign tabsheet to template -$tabsheet->assign(); - -$my_base_url .= '§ion=' . $page['section']; - - -// +-----------------------------------------------------------------------+ // | start template output | // +-----------------------------------------------------------------------+ $fs_plugins = get_fs_plugins(); |