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

Revision 28697, 1.7 KB checked in by mistic100, 5 years ago (diff)

feature 3088: [AdminTools] don't use auto version and uri anymore + author is "Piwigo Team"

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('get_admin_plugin_menu_links', 'admintools_admin_link');
42}
43
44
45function admintools_init()
46{
47  global $conf;
48  $conf['AdminTools'] = safe_unserialize($conf['AdminTools']);
49
50  load_language('plugin.lang', ADMINTOOLS_PATH);
51}
52
53function admintools_admin_link($menu) 
54{
55  $menu[] = array(
56    'NAME' => 'Admin Tools',
57    'URL' => ADMINTOOLS_ADMIN,
58    );
59
60  return $menu;
61}
Note: See TracBrowser for help on using the repository browser.