source: extensions/PWG_Stuffs/admin/admin.php @ 3508

Last change on this file since 3508 was 3300, checked in by patdenice, 15 years ago

New extension added:
PWG Stuffs (2.0.o)

File size: 1.7 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5global $template, $conf, $user;
6
7load_language('plugin.lang', STUFFS_PATH);
8include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
9include_once(STUFFS_PATH . 'include/functions.inc.php');
10include_once(STUFFS_PATH . 'admin/functions.inc.php');
11$my_base_url = get_admin_plugin_menu_link(__FILE__);
12
13// +-----------------------------------------------------------------------+
14// |                            Tabsheet
15// +-----------------------------------------------------------------------+
16if (!isset($_GET['tab']))
17    $page['tab'] = 'manage';
18else
19    $page['tab'] = $_GET['tab'];
20
21$tabsheet = new tabsheet();
22$tabsheet->add('manage',
23               l10n('stuffs_mods_management'),
24               $my_base_url.'&amp;tab=manage');
25$tabsheet->add('new',
26               l10n('stuffs_add_mod'),
27               $my_base_url.'&amp;tab=new');
28$tabsheet->select($page['tab']);
29$tabsheet->assign();
30
31//Ajout d'un module
32if (isset($_POST['addModule']) and !is_adviser())
33{
34        if (!isset($_POST['module']))
35  {
36                array_push($page['errors'], l10n('stuffs_error_no_mod_selected'));
37        }
38  else
39  {
40    redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadd_module.php&type=' . $_POST['module']);
41        }
42}
43
44//Suppression d'un module
45if (isset($_GET['del']) and !is_adviser())
46{
47        pwg_query('DELETE FROM ' . STUFFS_TABLE . ' WHERE id = ' . $_GET['del'] . ' LIMIT 1;');
48  redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php');
49}
50
51//Récupération des modules disponibles
52$modules = get_stuffs_modules();
53
54// Include file
55include(STUFFS_PATH.'admin/'.$page['tab'].'.php');
56
57?>
Note: See TracBrowser for help on using the repository browser.