1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Header Manager |
---|
4 | Version: auto |
---|
5 | Description: Header Manager allows to simply manage gallery banners. You can upload a picture from your computer or use a picture already in the gallery. |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=608 |
---|
7 | Author: Mistic |
---|
8 | Author URI: http://www.strangeplanet.fr |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | global $prefixeTable; |
---|
14 | define('HEADER_MANAGER_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
15 | define('HEADER_MANAGER_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__))); |
---|
16 | define('HEADER_MANAGER_DIR', PWG_LOCAL_DIR . 'banners/'); |
---|
17 | define('HEADER_MANAGER_TABLE', $prefixeTable . 'category_banner'); |
---|
18 | |
---|
19 | add_event_handler('init', 'header_manager_init'); |
---|
20 | |
---|
21 | function header_manager_init() |
---|
22 | { |
---|
23 | if (defined('PWG_HELP')) return; |
---|
24 | |
---|
25 | global $conf; |
---|
26 | $conf['header_manager'] = unserialize($conf['header_manager']); |
---|
27 | |
---|
28 | include(HEADER_MANAGER_PATH . 'include/functions.inc.php'); |
---|
29 | include(HEADER_MANAGER_PATH . 'include/header_manager.inc.php'); |
---|
30 | |
---|
31 | add_event_handler('render_page_banner', 'header_manager_render'); |
---|
32 | |
---|
33 | if (defined('IN_ADMIN')) |
---|
34 | { |
---|
35 | add_event_handler('tabsheet_before_select', 'header_manager_tab', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
36 | add_event_handler('get_admin_plugin_menu_links', 'header_manager_admin_menu'); |
---|
37 | add_event_handler('delete_categories', 'header_manager_delete_categories'); |
---|
38 | } |
---|
39 | } |
---|
40 | |
---|
41 | ?> |
---|