1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | global $template, $conf, $user; |
---|
6 | |
---|
7 | load_language('plugin.lang', STUFFS_PATH); |
---|
8 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
9 | include_once(STUFFS_PATH . 'functions.inc.php'); |
---|
10 | $my_base_url = get_root_url().'admin.php?page=plugin-'.STUFFS_DIR; |
---|
11 | |
---|
12 | // +-----------------------------------------------------------------------+ |
---|
13 | // | Tabsheet |
---|
14 | // +-----------------------------------------------------------------------+ |
---|
15 | $page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : 'manage'; |
---|
16 | |
---|
17 | $tabsheet = new tabsheet(); |
---|
18 | $tabsheet->add('manage', l10n('stuffs_mods_management'), $my_base_url.'-manage'); |
---|
19 | if ($page['tab'] == 'add_module') |
---|
20 | { |
---|
21 | $tabsheet->add('add_module', l10n('stuffs_add_mod'), $my_base_url.'-add_module&path='.$_GET['path']); |
---|
22 | } |
---|
23 | else |
---|
24 | { |
---|
25 | $tabsheet->add('new', l10n('stuffs_add_mod'), $my_base_url.'-new'); |
---|
26 | } |
---|
27 | if ($page['tab'] == 'edit_module') |
---|
28 | { |
---|
29 | $tabsheet->add('edit_module', l10n('stuffs_edit_mod'), $my_base_url.'-edit_module&edit='.$_GET['edit']); |
---|
30 | } |
---|
31 | $tabsheet->add('config', l10n('Configuration'), $my_base_url.'-config'); |
---|
32 | $tabsheet->select($page['tab']); |
---|
33 | $tabsheet->assign(); |
---|
34 | |
---|
35 | //Récupération des modules disponibles |
---|
36 | add_event_handler('get_stuffs_modules', 'get_default_stuffs_modules'); |
---|
37 | $disp_modules = trigger_event('get_stuffs_modules', array()); |
---|
38 | uasort($disp_modules, 'name_compare'); |
---|
39 | |
---|
40 | $modules = array(); |
---|
41 | foreach($disp_modules as $module) |
---|
42 | { |
---|
43 | $module['path'] = PHPWG_ROOT_PATH.trim($module['path'], './').'/'; |
---|
44 | $modules[$module['path']] = $module; |
---|
45 | } |
---|
46 | |
---|
47 | // Include file |
---|
48 | include(STUFFS_PATH.'admin/'.$page['tab'].'.inc.php'); |
---|
49 | |
---|
50 | ?> |
---|