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 . 'include/functions.inc.php'); |
---|
10 | include_once(STUFFS_PATH . 'admin/functions.inc.php'); |
---|
11 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
12 | |
---|
13 | // +-----------------------------------------------------------------------+ |
---|
14 | // | Tabsheet |
---|
15 | // +-----------------------------------------------------------------------+ |
---|
16 | $page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : 'manage'; |
---|
17 | |
---|
18 | $tabsheet = new tabsheet(); |
---|
19 | $tabsheet->add('manage', l10n('stuffs_mods_management'), $my_base_url.'&tab=manage'); |
---|
20 | if ($page['tab'] == 'add_module') |
---|
21 | { |
---|
22 | $tabsheet->add('add_module', l10n('stuffs_add_mod'), $my_base_url.'&tab=add_module&path='.$_GET['path']); |
---|
23 | } |
---|
24 | else |
---|
25 | { |
---|
26 | $tabsheet->add('new', l10n('stuffs_add_mod'), $my_base_url.'&tab=new'); |
---|
27 | } |
---|
28 | if ($page['tab'] == 'edit_module') |
---|
29 | { |
---|
30 | $tabsheet->add('edit_module', l10n('stuffs_edit_mod'), $my_base_url.'&tab=edit_module'); |
---|
31 | } |
---|
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 | |
---|
45 | if (preg_match('#^'.preg_quote(PHPWG_PLUGINS_PATH).'([^/]*?)/#', $module['path'], $match) and $match[1] != 'PWG_Stuffs') |
---|
46 | { |
---|
47 | $module['parent'] = $match[1]; |
---|
48 | } |
---|
49 | $modules[$module['path']] = $module; |
---|
50 | } |
---|
51 | |
---|
52 | // Include file |
---|
53 | include(STUFFS_PATH.'admin/'.$page['tab'].'.php'); |
---|
54 | |
---|
55 | ?> |
---|