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

Last change on this file since 3599 was 3531, checked in by tiico, 15 years ago

First revision (for testing)
Only in French (translation to be done)

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