source: extensions/PWG_Stuffs/trunk/admin.php @ 15578

Last change on this file since 15578 was 9738, checked in by patdenice, 14 years ago

New admin URL.

File size: 1.6 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 . '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');
19if ($page['tab'] == 'add_module')
20{
21  $tabsheet->add('add_module', l10n('stuffs_add_mod'), $my_base_url.'-add_module&amp;path='.$_GET['path']);
22}
23else
24{
25  $tabsheet->add('new', l10n('stuffs_add_mod'), $my_base_url.'-new');
26}
27if ($page['tab'] == 'edit_module')
28{
29  $tabsheet->add('edit_module', l10n('stuffs_edit_mod'), $my_base_url.'-edit_module&amp;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
36add_event_handler('get_stuffs_modules', 'get_default_stuffs_modules');
37$disp_modules = trigger_event('get_stuffs_modules', array());
38uasort($disp_modules, 'name_compare');
39
40$modules = array();
41foreach($disp_modules as $module)
42{
43  $module['path'] = PHPWG_ROOT_PATH.trim($module['path'], './').'/';
44  $modules[$module['path']] = $module;
45}
46
47// Include file
48include(STUFFS_PATH.'admin/'.$page['tab'].'.inc.php');
49
50?>
Note: See TracBrowser for help on using the repository browser.