source: extensions/linked_pages/main.inc.php @ 27042

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

update for Piwigo 2.6 + use underscore for admin

File size: 1.6 KB
Line 
1<?php 
2/*
3Plugin Name: Linked Pages
4Version: auto
5Description: Link Additional Pages to albums.
6Plugin URI: auto
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13if (mobile_theme())
14{
15  return;
16}
17
18global $prefixeTable;
19
20// +-----------------------------------------------------------------------+
21// | Define plugin constants                                               |
22// +-----------------------------------------------------------------------+
23define('LINKEDPAGES_ID',      basename(dirname(__FILE__)));
24define('LINKEDPAGES_PATH' ,   PHPWG_PLUGINS_PATH . LINKEDPAGES_ID . '/');
25define('LINKEDPAGES_TABLE',   $prefixeTable . 'linked_pages');
26define('LINKEDPAGES_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . LINKEDPAGES_ID);
27define('LINKEDPAGES_VERSION', 'auto');
28
29
30// init the plugin
31add_event_handler('init', 'linked_pages_init');
32
33
34/**
35 * plugin initialization
36 */
37function linked_pages_init()
38{
39  global $conf, $pwg_loaded_plugins;
40 
41  if (!isset($pwg_loaded_plugins['AdditionalPages']))
42  {
43    return;
44  }
45 
46  include_once(LINKEDPAGES_PATH . 'maintain.inc.php');
47  $maintain = new linked_pages_maintain(LINKEDPAGES_ID);
48  $maintain->autoUpdate(LINKEDPAGES_VERSION, 'install');
49 
50  // add event handlers
51  if (defined('IN_ADMIN'))
52  {
53    add_event_handler('tabsheet_before_select', 'linked_pages_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
54  }
55  else
56  {
57    add_event_handler('loc_end_index', 'linked_pages_loc_end_index', EVENT_HANDLER_PRIORITY_NEUTRAL+20);
58  }
59
60  include_once(LINKEDPAGES_PATH . 'include/functions.inc.php');
61}
Note: See TracBrowser for help on using the repository browser.