source: extensions/AdditionalPages/trunk/admin.php @ 19669

Last change on this file since 19669 was 9713, checked in by patdenice, 14 years ago

New admin links.

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