Last change
on this file since 7154 was
3609,
checked in by patdenice, 15 years ago
|
Convert all php and tpl files in Unix format for my plugins.
|
File size:
1.3 KB
|
Line | |
---|
1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Has High |
---|
4 | Version: 2.0.c |
---|
5 | Description: Add a "With high definition" link in "Specials" menu / Ajoute un lien "Avec haute définition" dans le menu "Spéciales" |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=222 |
---|
7 | Author: P@t |
---|
8 | Author URI: http://www.gauchon.com |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | define('HASHIGH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
14 | |
---|
15 | function 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 | |
---|
38 | function section_init_has_high() |
---|
39 | { |
---|
40 | global $tokens; |
---|
41 | if (in_array('has_high', $tokens)) |
---|
42 | include(HASHIGH_PATH . 'has_high.php'); |
---|
43 | } |
---|
44 | |
---|
45 | add_event_handler('blockmanager_apply' , 'add_link_has_high'); |
---|
46 | add_event_handler('loc_end_section_init', 'section_init_has_high'); |
---|
47 | |
---|
48 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.