source: extensions/hr_glass_xl/themeconf.inc.php @ 11717

Last change on this file since 11717 was 10827, checked in by flop25, 14 years ago

adding an admin page for the header based on P@t's work

File size: 2.5 KB
Line 
1<?php
2/*
3Theme Name: hr_glass_xl
4Version: auto
5Description: A theme with an horizontal menu everywhere and a simple modern design
6Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=502
7Author: flop25
8Author URI: http://www.planete-flop.fr
9*/
10$themeconf = array(
11  'name'                                        => 'hr_glass_xl',
12  'parent'        => 'default',
13  'icon_dir'      => 'themes/hr_glass_xl/icon',
14  'mime_icon_dir' => 'themes/hr_glass_xl/icon/mimetypes/',
15  'local_head'          => 'local_head.tpl',
16  'activable'                   => true,
17        'add_menu_on_public_pages'                      => true,        # activation
18        'Exclude'                               => array('theNBMPage','thePopuphelpPage',),     # Excluded pages
19);
20@include(PHPWG_ROOT_PATH. 'local/config/hr_glass_xl.inc.php');
21if (isset($conf['local_dir_site']))
22{
23  @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/hr_glass_xl.inc.php');
24}
25// thx to P@t
26add_event_handler('loc_begin_page_header', 'set_hr_glass_xl_header');
27
28function set_hr_glass_xl_header()
29{
30  global $page, $conf, $template;
31
32  $config = unserialize($conf['hr_glass_xl']);
33
34  if (isset($page['body_id']) and $page['body_id'] == 'theCategoryPage')
35  {
36    $header = isset($page['category']) ? $config['categories'] : $config['home'];
37  }
38  elseif (isset($page['body_id']) and $page['body_id'] == 'thePicturePage')
39  {
40    $header = $config['picture'];
41  }
42  else
43  {
44    $header = $config['other'];
45  }
46
47  $template->assign('display_hr_glass_xl_banner', $header);
48}
49
50// thx to Vdigital and his plugin spreadmenus
51if ( !function_exists( 'add_menu_on_public_pages' ) ) {
52        if ( defined('IN_ADMIN') and IN_ADMIN ) return false;
53        add_event_handler('loc_after_page_header', 'add_menu_on_public_pages', 20);
54
55        function  add_menu_on_public_pages() {
56          if ( function_exists( 'initialize_menu') ) return false; # The current page has already the menu
57          if ( !get_themeconf('add_menu_on_public_pages') ) return false; # The current page has already the menu
58          global $template, $page, $conf;
59          if ( isset($page['body_id']) and in_array($page['body_id'], get_themeconf('Exclude')) ) return false;
60
61          $template->set_filenames(array(
62                'add_menu_on_public_pages' => dirname(__FILE__) . '/template/add_menu_on_public_pages.tpl',
63          ));
64          include_once(PHPWG_ROOT_PATH.'include/menubar.inc.php');
65          $template->parse('add_menu_on_public_pages');
66         
67          if (is_admin())
68                {
69          $template->assign(
70        'U_ADMIN', get_root_url().'admin.php?page=picture_modify'
71      .'&amp;cat_id='.(isset($page['category']) ? $page['category']['id'] : '')
72      .( isset($page['image_id']) ? '&amp;image_id='.$page['image_id'] : '')
73      );
74                }
75         
76        }
77}
78?>
Note: See TracBrowser for help on using the repository browser.