Rev | Line | |
---|
[9278] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Theme Name: hr_glass_xl |
---|
[9670] | 4 | Version: auto |
---|
[12263] | 5 | Description: A theme with an horizontal menu and a simple modern design |
---|
[9279] | 6 | Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=502 |
---|
[9278] | 7 | Author: flop25 |
---|
| 8 | Author URI: http://www.planete-flop.fr |
---|
| 9 | */ |
---|
| 10 | $themeconf = array( |
---|
[12265] | 11 | 'name' => 'hr_glass_xl', |
---|
[9278] | 12 | 'parent' => 'default', |
---|
| 13 | 'icon_dir' => 'themes/hr_glass_xl/icon', |
---|
| 14 | 'mime_icon_dir' => 'themes/hr_glass_xl/icon/mimetypes/', |
---|
[12265] | 15 | 'local_head' => 'local_head.tpl', |
---|
| 16 | 'activable' => true, |
---|
[9278] | 17 | ); |
---|
[12263] | 18 | // Need upgrade? |
---|
| 19 | if (!isset($conf['hr_glass_xl'])) |
---|
| 20 | { |
---|
| 21 | $config = array( |
---|
| 22 | 'home' => true, |
---|
| 23 | 'categories' => true, |
---|
| 24 | 'picture' => false, |
---|
| 25 | 'other' => true, |
---|
| 26 | ); |
---|
| 27 | |
---|
| 28 | $query = ' |
---|
| 29 | INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) |
---|
| 30 | VALUES ("hr_glass_xl" , "'.pwg_db_real_escape_string(serialize($config)).'" , "hr_glass_xl parameters");'; |
---|
| 31 | |
---|
| 32 | pwg_query($query); |
---|
| 33 | load_conf_from_db(); |
---|
| 34 | } |
---|
| 35 | |
---|
[10827] | 36 | // thx to P@t |
---|
| 37 | add_event_handler('loc_begin_page_header', 'set_hr_glass_xl_header'); |
---|
[9278] | 38 | |
---|
[10827] | 39 | function set_hr_glass_xl_header() |
---|
| 40 | { |
---|
| 41 | global $page, $conf, $template; |
---|
| 42 | |
---|
| 43 | $config = unserialize($conf['hr_glass_xl']); |
---|
| 44 | |
---|
| 45 | if (isset($page['body_id']) and $page['body_id'] == 'theCategoryPage') |
---|
| 46 | { |
---|
| 47 | $header = isset($page['category']) ? $config['categories'] : $config['home']; |
---|
| 48 | } |
---|
| 49 | elseif (isset($page['body_id']) and $page['body_id'] == 'thePicturePage') |
---|
| 50 | { |
---|
| 51 | $header = $config['picture']; |
---|
| 52 | } |
---|
| 53 | else |
---|
| 54 | { |
---|
| 55 | $header = $config['other']; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | $template->assign('display_hr_glass_xl_banner', $header); |
---|
| 59 | } |
---|
[9278] | 60 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.