aboutsummaryrefslogtreecommitdiffstats
path: root/admin/plugins.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/plugins.php62
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 .= '&section=' . $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 .= '&section=' . $page['section'];
-
-
-// +-----------------------------------------------------------------------+
// | start template output |
// +-----------------------------------------------------------------------+
$fs_plugins = get_fs_plugins();