source: extensions/AdditionalPages/main.inc.php @ 4031

Last change on this file since 4031 was 3825, checked in by patdenice, 15 years ago

Correct some notices.
Add polish language.

File size: 1.4 KB
Line 
1<?php
2/*
3Plugin Name: Additional Pages
4Version: auto
5Description: Add additional pages in menubar.
6Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=153
7Author: P@t
8Author URI: http://www.gauchon.com
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13global $prefixeTable, $conf;
14
15define('AP_DIR' , basename(dirname(__FILE__)));
16define('AP_PATH' , PHPWG_PLUGINS_PATH . AP_DIR . '/');
17define('ADD_PAGES_TABLE' , $prefixeTable . 'additionalpages');
18
19function 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
27function section_init_additional_page()
28{
29    global $tokens, $page;
30    if ($tokens[0] == 'additional_page')
31      $page['section'] = 'additional_page';
32}
33
34function index_additional_page()
35{
36    global $page;
37    if (isset($page['section']) and $page['section'] == 'additional_page')
38      include(AP_PATH . 'additional_page.php');
39}
40
41$ap_conf = explode ("," , $conf['additional_pages']);
42if (isset($ap_conf[1]) and $ap_conf[1] == 'on' or is_admin())
43{
44  include(AP_PATH . 'index_menu.php');
45}
46
47add_event_handler('get_admin_plugin_menu_links', 'additional_pages_admin_menu');
48add_event_handler('loc_end_section_init', 'section_init_additional_page');
49add_event_handler('loc_end_index', 'index_additional_page');
50
51?>
Note: See TracBrowser for help on using the repository browser.