source: extensions/Flash_Gallery/main.inc.php @ 4312

Last change on this file since 4312 was 3663, checked in by tiico, 15 years ago

Some corrections
Add EN translation (only for the core, not for modules)
Add comment options (%ID)

File size: 1.9 KB
RevLine 
[3531]1<?php
2/*
3Plugin Name: Flash Gallery
[3663]4Version: 0.0.2
[3531]5Description: Insert Flash on your gallery
[3663]6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=299
7Author:  Tiico
[3531]8Author URI:
9*/
[3663]10// See CHANGELOG for release informations
[3531]11
12if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
13
14global $prefixeTable;
15
16define('FLASHGAL_DIR' , basename(dirname(__FILE__)));
17define('FLASHGAL_PATH' , PHPWG_PLUGINS_PATH . FLASHGAL_DIR . '/');
18define('FLASHGAL_TABLE' , $prefixeTable . 'flash_gallery');
19
20
21function 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
29function 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
40function 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
65add_event_handler('get_admin_plugin_menu_links', 'flashgal_admin_menu');
66add_event_handler('loc_begin_index', 'set_flashgal_on_index');
67add_event_handler('loc_end_index', 'set_flashgal_replacement');
68
69?>
Note: See TracBrowser for help on using the repository browser.