source: trunk/plugins/AdminTools/main.inc.php @ 29231

Last change on this file since 29231 was 29197, checked in by mistic100, 10 years ago

bug 3110: AdminTools DOM misplaced on admin

File size: 1.8 KB
Line 
1<?php
2/*
3Plugin Name: Admin Tools
4Version: 2.6.2
5Description: Do some admin task from the public pages
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=720
7Author: Piwigo team
8Author URI: http://piwigo.org
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13define('ADMINTOOLS_ID',       basename(dirname(__FILE__)));
14define('ADMINTOOLS_PATH' ,    PHPWG_PLUGINS_PATH . ADMINTOOLS_ID . '/');
15define('ADMINTOOLS_ADMIN',    get_root_url() . 'admin.php?page=plugin-' . ADMINTOOLS_ID);
16
17include_once(ADMINTOOLS_PATH . 'include/events.inc.php');
18include_once(ADMINTOOLS_PATH . 'include/MultiView.class.php');
19
20
21global $MultiView;
22$MultiView = new MultiView();
23
24add_event_handler('init', 'admintools_init');
25
26add_event_handler('user_init', array(&$MultiView, 'user_init'));
27add_event_handler('init', array(&$MultiView, 'init'));
28
29add_event_handler('ws_add_methods', array('MultiView', 'register_ws'));
30add_event_handler('delete_user', array('MultiView', 'invalidate_cache'));
31add_event_handler('register_user', array('MultiView', 'invalidate_cache'));
32
33if (!defined('IN_ADMIN'))
34{
35  add_event_handler('loc_after_page_header', 'admintools_add_public_controller');
36  add_event_handler('loc_begin_picture', 'admintools_save_picture');
37  add_event_handler('loc_begin_index', 'admintools_save_category');
38}
39else
40{
41  add_event_handler('loc_begin_page_header', 'admintools_add_admin_controller_setprefilter');
42  add_event_handler('loc_after_page_header', 'admintools_add_admin_controller');
43  add_event_handler('get_admin_plugin_menu_links', 'admintools_admin_link');
44}
45
46
47function admintools_init()
48{
49  global $conf;
50  $conf['AdminTools'] = safe_unserialize($conf['AdminTools']);
51
52  load_language('plugin.lang', ADMINTOOLS_PATH);
53}
54
55function admintools_admin_link($menu) 
56{
57  $menu[] = array(
58    'NAME' => 'Admin Tools',
59    'URL' => ADMINTOOLS_ADMIN,
60    );
61
62  return $menu;
63}
Note: See TracBrowser for help on using the repository browser.