Last change
on this file since 12523 was
12266,
checked in by flop25, 13 years ago
|
deleting the "spreadmenu" system
adding a check for config
|
File size:
1.5 KB
|
Rev | Line | |
---|
[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( |
---|
[12266] | 11 | 'name' => 'hr_os_xl', |
---|
[9281] | 12 | 'parent' => 'default', |
---|
| 13 | 'icon_dir' => 'themes/hr_os_xl/icon', |
---|
| 14 | 'mime_icon_dir' => 'themes/hr_os_xl/icon/mimetypes/', |
---|
[12266] | 15 | 'local_head' => 'local_head.tpl', |
---|
| 16 | 'activable' => true, |
---|
[9281] | 17 | ); |
---|
[12266] | 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 = ' |
---|
| 28 | INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) |
---|
| 29 | VALUES ("hr_os_xl" , "'.pwg_db_real_escape_string(serialize($config)).'" , "hr_os_xl parameters");'; |
---|
[9281] | 30 | |
---|
[12266] | 31 | pwg_query($query); |
---|
| 32 | load_conf_from_db(); |
---|
| 33 | } |
---|
| 34 | |
---|
[10825] | 35 | // thx to P@t |
---|
| 36 | add_event_handler('loc_begin_page_header', 'set_hr_os_xl_header'); |
---|
| 37 | |
---|
| 38 | function 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 | } |
---|
[9281] | 59 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.