source: extensions/HasHigh/main.inc.php @ 27153

Last change on this file since 27153 was 7190, checked in by ddtddt, 13 years ago

[extension] - HasHigh - add description

File size: 1.3 KB
Line 
1<?php
2/*
3Plugin Name: Has High
4Version: 2.0.c
5Description: Add a "With high definition" link in "Specials" menu
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=222
7Author: P@t
8Author URI: http://www.gauchon.com
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13define('HASHIGH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
14
15function add_link_has_high($menu_ref_arr)
16{
17  global $conf, $user;
18
19  $menu = & $menu_ref_arr[0];
20 
21  if ($user['enabled_high'] and ($block = $menu->get_block('mbSpecials')) != null)
22  {
23    load_language('plugin.lang', HASHIGH_PATH);
24
25    $position = (isset($conf['hashigh_position']) and is_numeric($conf['hashigh_position'])) ? $conf['hashigh_position'] : count($block->data)+1;
26
27    array_splice($block->data, $position-1, 0, array('has_high' =>
28      array(
29        'URL' => make_index_url(array('section' => 'has_high')),
30        'TITLE' => l10n('has_high_cat_hint'),
31        'NAME' => l10n('has_high_cat')
32        )
33      )
34    );
35  }
36}
37
38function section_init_has_high()
39{
40  global $tokens;
41  if (in_array('has_high', $tokens))
42    include(HASHIGH_PATH . 'has_high.php');
43}
44
45add_event_handler('blockmanager_apply' , 'add_link_has_high');
46add_event_handler('loc_end_section_init', 'section_init_has_high');
47
48?>
Note: See TracBrowser for help on using the repository browser.