-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathadmin.php
40 lines (31 loc) · 1.02 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
load_language('plugin.lang', AP_PATH);
global $conf, $template;
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
$my_base_url = get_root_url().'admin.php?page=plugin-'.AP_DIR;
$query = 'SELECT id
FROM ' . ADD_PAGES_TABLE . '
LIMIT 1
;';
$page_exist = array_from_query($query, 'id');
$page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : 'manage';
if (!$page_exist and $page['tab'] == 'manage')
{
redirect($my_base_url.'&tab=add_page');
}
include(AP_PATH.'admin/'.$page['tab'].'.inc.php');
$tabsheet = new tabsheet();
if ($page_exist)
{
$tabsheet->add('manage', l10n('Manage'), $my_base_url.'-manage');
}
$tabsheet->add('add_page', l10n('ap_add_page'), $my_base_url.'-add_page');
$tabsheet->add('config', l10n('Configuration'), $my_base_url.'-config');
if ($page['tab'] == 'edit_page')
{
$tabsheet->add('edit_page', l10n('ap_edit_page'), $my_base_url.'-edit_page&edit='.$_GET['edit']);
}
$tabsheet->select($page['tab']);
$tabsheet->assign();
?>