[9281] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Theme Name: hr_os_xl |
---|
[9670] | 4 | Version: auto |
---|
[9281] | 5 | Description: A theme with an horizontal menu everywhere and a simple modern design |
---|
| 6 | Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=504 |
---|
| 7 | Author: flop25 |
---|
| 8 | Author URI: http://www.planete-flop.fr |
---|
| 9 | */ |
---|
| 10 | $themeconf = array( |
---|
| 11 | 'name' => 'hr_os_xl', |
---|
| 12 | 'parent' => 'default', |
---|
| 13 | 'icon_dir' => 'themes/hr_os_xl/icon', |
---|
| 14 | 'mime_icon_dir' => 'themes/hr_os_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 | ); |
---|
[9670] | 20 | @include(PHPWG_ROOT_PATH. 'local/config/hr_os_xl.inc.php'); |
---|
| 21 | if (isset($conf['local_dir_site'])) |
---|
| 22 | { |
---|
| 23 | @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/hr_os_xl.inc.php'); |
---|
| 24 | } |
---|
[9281] | 25 | |
---|
[10825] | 26 | // thx to P@t |
---|
| 27 | add_event_handler('loc_begin_page_header', 'set_hr_os_xl_header'); |
---|
| 28 | |
---|
| 29 | function set_hr_os_xl_header() |
---|
| 30 | { |
---|
| 31 | global $page, $conf, $template; |
---|
| 32 | |
---|
| 33 | $config = unserialize($conf['hr_os_xl']); |
---|
| 34 | |
---|
| 35 | if (isset($page['body_id']) and $page['body_id'] == 'theCategoryPage') |
---|
| 36 | { |
---|
| 37 | $header = isset($page['category']) ? $config['categories'] : $config['home']; |
---|
| 38 | } |
---|
| 39 | elseif (isset($page['body_id']) and $page['body_id'] == 'thePicturePage') |
---|
| 40 | { |
---|
| 41 | $header = $config['picture']; |
---|
| 42 | } |
---|
| 43 | else |
---|
| 44 | { |
---|
| 45 | $header = $config['other']; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | $template->assign('display_hr_os_xl_banner', $header); |
---|
| 49 | } |
---|
[9281] | 50 | // thx to Vdigital and his plugin spreadmenus |
---|
| 51 | if ( !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 | .'&cat_id='.(isset($page['category']) ? $page['category']['id'] : '') |
---|
| 72 | .( isset($page['image_id']) ? '&image_id='.$page['image_id'] : '') |
---|
| 73 | ); |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | } |
---|
| 77 | } |
---|
| 78 | ?> |
---|