source: extensions/hr_os_xl/themeconf.inc.php @ 15720

Last change on this file since 15720 was 12266, checked in by flop25, 13 years ago

deleting the "spreadmenu" system
adding a check for config

File size: 1.5 KB
Line 
1<?php
2/*
3Theme Name: hr_os_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=504
7Author: flop25
8Author 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);
18  if (!isset($conf['hr_os_xl']))
19  {
20    $config = array(
21      'home'       => true,
22      'categories' => true,
23      'picture'    => false,
24      'other'      => true,
25      );
26     
27    $query = '
28INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
29VALUES ("hr_os_xl" , "'.pwg_db_real_escape_string(serialize($config)).'" , "hr_os_xl parameters");';
30
31    pwg_query($query);
32    load_conf_from_db();
33  }
34
35// thx to P@t
36add_event_handler('loc_begin_page_header', 'set_hr_os_xl_header');
37
38function set_hr_os_xl_header()
39{
40  global $page, $conf, $template;
41
42  $config = unserialize($conf['hr_os_xl']);
43
44  if (isset($page['body_id']) and $page['body_id'] == 'theCategoryPage')
45  {
46    $header = isset($page['category']) ? $config['categories'] : $config['home'];
47  }
48  elseif (isset($page['body_id']) and $page['body_id'] == 'thePicturePage')
49  {
50    $header = $config['picture'];
51  }
52  else
53  {
54    $header = $config['other'];
55  }
56
57  $template->assign('display_hr_os_xl_banner', $header);
58}
59?>
Note: See TracBrowser for help on using the repository browser.