source: extensions/Back2Front/main.inc.php @ 21213

Last change on this file since 21213 was 21213, checked in by mistic100, 8 years ago

fix language load, fix fatal error, (probably) fix jQuery issues

File size: 1.3 KB
Line 
1<?php 
2/*
3Plugin Name: Back2Front
4Version: auto
5Description: Add a link on picture's page to show a alternative version of the pic (for postcards for example)
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=533
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12global $prefixeTable;
13
14define('B2F_DIR', basename(dirname(__FILE__)));
15define('B2F_PATH', PHPWG_PLUGINS_PATH . B2F_DIR . '/');
16define('B2F_TABLE', $prefixeTable . 'image_verso');
17
18include_once(B2F_PATH . 'Back2Front.php');
19
20add_event_handler('init', 'Back2Front_init');
21
22function Back2Front_init()
23{
24  load_language('plugin.lang', B2F_PATH);
25}
26
27if (script_basename() == 'picture')
28{
29  add_event_handler('render_element_content', 'Back2Front_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL+20, 2);
30}
31
32if (script_basename() == 'index')
33{
34  add_event_handler('loc_end_index_thumbnails', 'Back2Front_thumbnails');
35}
36
37if (script_basename() == 'admin')
38{
39  add_event_handler('loc_begin_admin_page', 'Back2Front_picture_modify');
40 
41  add_event_handler('get_admin_plugin_menu_links', 'Back2Front_admin_menu');
42  function Back2Front_admin_menu($menu) 
43  {
44    array_push($menu, array(
45      'NAME' => 'Back2Front',
46      'URL' => get_root_url().'admin.php?page=plugin-' . B2F_DIR));
47    return $menu;
48  }
49}
50
51?>
Note: See TracBrowser for help on using the repository browser.