Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | load_language('plugin.lang', AP_PATH); |
---|
5 | |
---|
6 | global $conf, $template; |
---|
7 | |
---|
8 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
9 | $my_base_url = get_root_url().'admin.php?page=plugin-'.AP_DIR; |
---|
10 | |
---|
11 | $query = 'SELECT id |
---|
12 | FROM ' . ADD_PAGES_TABLE . ' |
---|
13 | LIMIT 1 |
---|
14 | ;'; |
---|
15 | $page_exist = array_from_query($query, 'id'); |
---|
16 | |
---|
17 | $page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : 'manage'; |
---|
18 | |
---|
19 | if (!$page_exist and $page['tab'] == 'manage') |
---|
20 | { |
---|
21 | redirect($my_base_url.'&tab=add_page'); |
---|
22 | } |
---|
23 | |
---|
24 | include(AP_PATH.'admin/'.$page['tab'].'.inc.php'); |
---|
25 | |
---|
26 | $tabsheet = new tabsheet(); |
---|
27 | if ($page_exist) |
---|
28 | { |
---|
29 | $tabsheet->add('manage', l10n('Manage'), $my_base_url.'-manage'); |
---|
30 | } |
---|
31 | $tabsheet->add('add_page', l10n('ap_add_page'), $my_base_url.'-add_page'); |
---|
32 | $tabsheet->add('config', l10n('Configuration'), $my_base_url.'-config'); |
---|
33 | if ($page['tab'] == 'edit_page') |
---|
34 | { |
---|
35 | $tabsheet->add('edit_page', l10n('ap_edit_page'), $my_base_url.'-edit_page&edit='.$_GET['edit']); |
---|
36 | } |
---|
37 | $tabsheet->select($page['tab']); |
---|
38 | $tabsheet->assign(); |
---|
39 | |
---|
40 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.