1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Flash Gallery |
---|
4 | Version: 0.0.2 |
---|
5 | Description: Insert Flash on your gallery |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=299 |
---|
7 | Author: Tiico |
---|
8 | Author URI: |
---|
9 | */ |
---|
10 | // See CHANGELOG for release informations |
---|
11 | |
---|
12 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
13 | |
---|
14 | global $prefixeTable; |
---|
15 | |
---|
16 | define('FLASHGAL_DIR' , basename(dirname(__FILE__))); |
---|
17 | define('FLASHGAL_PATH' , PHPWG_PLUGINS_PATH . FLASHGAL_DIR . '/'); |
---|
18 | define('FLASHGAL_TABLE' , $prefixeTable . 'flash_gallery'); |
---|
19 | |
---|
20 | |
---|
21 | function flashgal_admin_menu($menu) |
---|
22 | { |
---|
23 | array_push($menu, array( |
---|
24 | 'NAME' => 'Flash Gallery', |
---|
25 | 'URL' => get_admin_plugin_menu_link(FLASHGAL_PATH . 'admin/admin.php'))); |
---|
26 | return $menu; |
---|
27 | } |
---|
28 | |
---|
29 | function set_flashgal_on_index() |
---|
30 | { |
---|
31 | global $page; |
---|
32 | |
---|
33 | if (isset($page['section']) and $page['section'] == 'categories') |
---|
34 | { |
---|
35 | include_once(FLASHGAL_PATH . 'include/flashgal.inc.php'); |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | // Remplacement de la navigation courante par le module |
---|
40 | function set_flashgal_replacement() |
---|
41 | { |
---|
42 | global $page, $template; |
---|
43 | include_once(FLASHGAL_PATH . 'include/class.inc.php'); |
---|
44 | $home = (($page['section'] == 'categories') and empty($page['category'])) ? true : null ; |
---|
45 | $catid = ($page['section'] == 'categories' and |
---|
46 | isset($page['category'])) ? $page['category']['id'] : null ; |
---|
47 | $permalinkcat = empty($page['category']['permalink']) ? null : $page['category']['permalink']; |
---|
48 | |
---|
49 | $flashgal = new flashgal($catid, $home, $permalinkcat); |
---|
50 | |
---|
51 | if ($flashgal->module['replace_thumb'] == 'true') |
---|
52 | { |
---|
53 | $template->clear_assign('THUMBNAILS'); |
---|
54 | $template->clear_assign('NAV_BAR'); |
---|
55 | } |
---|
56 | // Suppression de la barre de navigation categories |
---|
57 | if ($flashgal->module['replace_cats'] == 'true') |
---|
58 | { |
---|
59 | $template->clear_assign('CATEGORIES'); |
---|
60 | } |
---|
61 | |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | add_event_handler('get_admin_plugin_menu_links', 'flashgal_admin_menu'); |
---|
66 | add_event_handler('loc_begin_index', 'set_flashgal_on_index'); |
---|
67 | add_event_handler('loc_end_index', 'set_flashgal_replacement'); |
---|
68 | |
---|
69 | ?> |
---|