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

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

update for 2.7

File size: 1.4 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: auto
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13global $prefixeTable;
14
15define('B2F_ID',    basename(dirname(__FILE__)));
16define('B2F_PATH',  PHPWG_PLUGINS_PATH . B2F_ID . '/');
17define('B2F_TABLE', $prefixeTable . 'image_verso');
18define('B2F_ADMIN', get_root_url() . 'admin.php?page=plugin-' . B2F_ID);
19
20include_once(B2F_PATH . 'include/Back2Front.php');
21
22
23add_event_handler('init', 'back2front_init');
24
25
26function back2front_init()
27{
28  global $conf;
29 
30  $conf['back2front'] = safe_unserialize($conf['back2front']);
31
32  load_language('plugin.lang', B2F_PATH);
33}
34
35
36if (script_basename() == 'picture')
37{
38  add_event_handler('render_element_content', 'back2front_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL+20, 2);
39}
40
41if (script_basename() == 'index')
42{
43  add_event_handler('loc_end_index_thumbnails', 'back2front_thumbnails');
44}
45
46if (script_basename() == 'admin')
47{
48  add_event_handler('loc_begin_admin_page', 'back2front_picture_modify');
49 
50  add_event_handler('get_admin_plugin_menu_links', 'back2front_admin_menu');
51  function back2front_admin_menu($menu) 
52  {
53    array_push($menu, array(
54      'NAME' => 'Back2Front',
55      'URL' => B2F_ADMIN,
56    ));
57    return $menu;
58  }
59}
Note: See TracBrowser for help on using the repository browser.