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

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

deleting the "spreadmenu" system (the plugins
adding a check for config
max width for pictures

File size: 1.4 KB
Line 
1<?php
2/*
3Theme Name: hr_os
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=503
7Author: flop25
8Author URI: http://www.planete-flop.fr
9*/
10$themeconf = array(
11  'name'          => 'hr_os',
12  'parent'        => 'default',
13  'icon_dir'      => 'themes/hr_os/icon',
14  'mime_icon_dir' => 'themes/hr_os/icon/mimetypes/',
15  'local_head'    => 'local_head.tpl',
16  'activable'     => true,
17);
18// Need upgrade?
19  if (!isset($conf['hr_os']))
20  {
21    $config = array(
22      'home'       => true,
23      'categories' => true,
24      'picture'    => false,
25      'other'      => true,
26      );
27     
28    $query = '
29INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
30VALUES ("hr_os" , "'.pwg_db_real_escape_string(serialize($config)).'" , "hr_os parameters");';
31
32    pwg_query($query);
33    load_conf_from_db();
34  }
35// thx to P@t
36add_event_handler('loc_begin_page_header', 'set_hr_os_header');
37
38function set_hr_os_header()
39{
40  global $page, $conf, $template;
41
42  $config = unserialize($conf['hr_os']);
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_banner', $header);
58}
59
60?>
Note: See TracBrowser for help on using the repository browser.