source: extensions/greydragon/themeconf.inc.php @ 30730

Revision 30730, 1.7 KB checked in by SergeD, 5 years ago (diff)

version 1.0.16 - please refer to changelog for more details

Line 
1<?php
2/*
3Theme Name: GreyDragon
4Version: 1.0.16
5Description: GreyDragon Theme
6Theme URI: http://piwigo.org/ext/extension_view.php?eid=775
7Author: Serge Dosyukov
8Author URI: http://blog.dragonsoft.us
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13require_once( PHPWG_THEMES_PATH . 'greydragon/include/greydragon.class.php');
14require_once( PHPWG_THEMES_PATH . 'greydragon/admin/upgrade.inc.php');
15
16$themeCore = greyDragonCore::Instance(GDTHEME_VERSION);
17
18$themeconf = array(
19  'name'  => 'greydragon',
20  'parent' => 'default',
21  'colorscheme' => 'whitehawk' == $themeCore->getOption('p_colorpack') ? 'clear' : 'dark'
22);
23
24add_event_handler('init', 'greydragon_init');
25
26// Load Theme's Parameters
27function greydragon_init() {
28  global $template;
29
30  $themeCore = greyDragonCore::Instance();
31  if ($themeCore->hasOption("p_logo_path") || $themeCore->hasOption("p_header") || $themeCore->hasOption('page_banner', TRUE)):
32    add_event_handler('render_page_banner', 'greydragon_render_header');
33  endif;
34  if ($themeCore->getOption("p_nocounter") == "on"):
35    add_event_handler('loc_end_index', 'no_breadcrumb_counter');
36  endif;
37  if ($themeCore->getOption("p_pict_tab_exif") == "off"):
38    pwg_set_session_var('show_metadata', 0);
39  else:
40    pwg_set_session_var('show_metadata', 1);
41  endif;
42
43  $template->assign('greydragon', $themeCore->getConfig());
44}
45
46// Render custom header content
47function greydragon_render_header() {
48  return greyDragonCore::Instance()->getHeader();
49}
50
51function no_breadcrumb_counter() {
52  global $template;
53
54  $titre = $template->get_template_vars('TITLE');
55  $pos = strrpos($titre,"[");
56  if ($pos !== false):
57    $template->assign('TITLE', substr($titre, 0, $pos));
58  endif;
59}
60
61?>
Note: See TracBrowser for help on using the repository browser.