1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Additional Pages |
---|
4 | Version: 2.0.b |
---|
5 | Description: Add additional pages in menubar. |
---|
6 | Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=153 |
---|
7 | Author: P@t |
---|
8 | Author URI: http://www.gauchon.com |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | global $prefixeTable, $conf; |
---|
14 | |
---|
15 | define('AP_DIR' , basename(dirname(__FILE__))); |
---|
16 | define('AP_PATH' , PHPWG_PLUGINS_PATH . AP_DIR . '/'); |
---|
17 | define('ADD_PAGES_TABLE' , $prefixeTable . 'additionalpages'); |
---|
18 | |
---|
19 | function additional_pages_admin_menu($menu) |
---|
20 | { |
---|
21 | array_push($menu, array( |
---|
22 | 'NAME' => 'Additional Pages', |
---|
23 | 'URL' => get_admin_plugin_menu_link(AP_PATH . 'admin/admin.php'))); |
---|
24 | return $menu; |
---|
25 | } |
---|
26 | |
---|
27 | function section_init_additional_page() |
---|
28 | { |
---|
29 | global $tokens, $page; |
---|
30 | if ($tokens[0] == 'additional_page') |
---|
31 | $page['section'] = 'additional_page'; |
---|
32 | } |
---|
33 | |
---|
34 | function index_additional_page() |
---|
35 | { |
---|
36 | global $page; |
---|
37 | if ($page['section'] == 'additional_page') |
---|
38 | include(AP_PATH . 'additional_page.php'); |
---|
39 | } |
---|
40 | |
---|
41 | $ap_conf = explode ("," , $conf['additional_pages']); |
---|
42 | if (isset($ap_conf[1]) and $ap_conf[1] == 'on' or is_admin()) |
---|
43 | { |
---|
44 | include(AP_PATH . 'index_menu.php'); |
---|
45 | } |
---|
46 | |
---|
47 | add_event_handler('get_admin_plugin_menu_links', 'additional_pages_admin_menu'); |
---|
48 | add_event_handler('loc_end_section_init', 'section_init_additional_page'); |
---|
49 | add_event_handler('loc_end_index', 'index_additional_page'); |
---|
50 | |
---|
51 | ?> |
---|