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

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

update for 2.7

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