[12975] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Theme Name: stripped-galleria |
---|
[26671] | 4 | Version: 1.4.3 |
---|
[12975] | 5 | Description: stripped-galleria theme |
---|
| 6 | Theme URI: http://piwigo.org/ext/extension_view.php?eid=585 |
---|
| 7 | Author: Julien Capitaine (Zaphod on Piwigo forums) |
---|
| 8 | Author URI: http://www.audreyetjulien.fr/galerie |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | $themeconf = array( |
---|
| 12 | 'parent' => 'stripped', |
---|
| 13 | 'load_parent_css' => true, |
---|
| 14 | 'load_parent_local_head' => true, |
---|
| 15 | 'name' => 'stripped-galleria', |
---|
| 16 | 'theme_dir' => 'stripped-galleria', |
---|
| 17 | 'icon_dir' => 'themes/stripped/icon', |
---|
| 18 | 'admin_icon_dir' => 'themes/default/icon/admin', |
---|
| 19 | 'mime_icon_dir' => 'themes/default/icon/mimetypes/', |
---|
| 20 | 'local_head' => 'local_head.tpl', |
---|
| 21 | ); |
---|
| 22 | |
---|
| 23 | global $conf, $stripped, $strippedgalleria; |
---|
| 24 | |
---|
[16337] | 25 | // temporary workaround |
---|
| 26 | $conf['template_combine_files'] = false; |
---|
| 27 | |
---|
[12975] | 28 | // Need upgrade? |
---|
| 29 | if (!isset($conf['stripped-galleria'])) |
---|
| 30 | include(PHPWG_THEMES_PATH.'stripped-galleria/admin/upgrade.inc.php'); |
---|
| 31 | |
---|
| 32 | $stripped['maxThumb']=999; |
---|
| 33 | $stripped = array_merge( unserialize( $conf['stripped'] ), (array)$stripped ); |
---|
| 34 | $strippedgalleria = unserialize( $conf['stripped-galleria'] ); |
---|
| 35 | if (!isset($strippedgalleria['lightbox'])) $strippedgalleria['lightbox']='none'; |
---|
| 36 | |
---|
[17962] | 37 | |
---|
[26671] | 38 | add_event_handler('loc_end_index_thumbnails', 'strippedgalleria_add_thumbnails_hd_url', 50, 2); |
---|
| 39 | function strippedgalleria_add_thumbnails_hd_url($tpl_vars) |
---|
[12975] | 40 | { |
---|
[26671] | 41 | global $user, $conf, $template, $page; |
---|
[17962] | 42 | foreach($tpl_vars as &$x) |
---|
| 43 | { |
---|
| 44 | if ($user['enabled_high']) $x['HD_ACCESS'] = true; |
---|
| 45 | else $x['HD_ACCESS'] = false; |
---|
| 46 | } |
---|
| 47 | unset($x); |
---|
[26671] | 48 | $stripped = unserialize( $conf['stripped'] ); |
---|
| 49 | $strippedgalleria = unserialize( $conf['stripped-galleria'] ); |
---|
| 50 | $template->assign( 'stripped', $stripped ); |
---|
| 51 | $template->assign( 'strippedgalleria', $strippedgalleria ); |
---|
| 52 | $template->assign( 'get_root_url', get_root_url() ); |
---|
| 53 | if (!empty($page['section'])) $template->assign('section', $page['section']); |
---|
| 54 | if (!empty($page['category']['id'])) $template->assign('catid', $page['category']['id']); |
---|
| 55 | if (!empty($page['tag_ids'])) $template->assign('tagids', implode(',', $page['tag_ids'])); |
---|
[17962] | 56 | return $tpl_vars; |
---|
[12975] | 57 | } |
---|
[26671] | 58 | |
---|
| 59 | add_event_handler('loc_begin_page_header', 'strippedgalleria_header'); |
---|
| 60 | function strippedgalleria_header() |
---|
| 61 | { |
---|
| 62 | global $conf, $template; |
---|
| 63 | $stripped = unserialize( $conf['stripped'] ); |
---|
| 64 | $strippedgalleria = unserialize( $conf['stripped-galleria'] ); |
---|
| 65 | $template->assign( 'stripped', $stripped ); |
---|
| 66 | $template->assign( 'strippedgalleria', $strippedgalleria ); |
---|
| 67 | } |
---|
| 68 | add_event_handler('loc_begin_index', 'strippedgalleria_add_downloadLink'); |
---|
| 69 | function strippedgalleria_add_downloadLink() |
---|
| 70 | { |
---|
| 71 | global $conf, $template; |
---|
| 72 | $template->assign('downloadLink', $conf['picture_download_icon']); |
---|
| 73 | } |
---|
| 74 | |
---|
[12975] | 75 | ?> |
---|