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

Revision 30484, 1.6 KB checked in by SergeD, 5 years ago (diff)

version 1.0.14 - please refer to changelog for details

Line 
1<?php
2/*
3Theme Name: GreyDragon
4Version: 1.0.14
5Description: Dark, slate, white background, grayscale.
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
13define('GDTHEME_VERSION', '1.0.14');
14
15require_once( PHPWG_THEMES_PATH . 'greydragon/include/greydragon.class.php');
16require_once( PHPWG_THEMES_PATH . 'greydragon/admin/upgrade.inc.php');
17
18$themeCore = greyDragonCore::Instance(GDTHEME_VERSION);
19
20$themeconf = array(
21  'name'  => 'greydragon',
22  'parent' => 'default',
23  'colorscheme' => 'whitehawk' == $themeCore->getOption('p_colorpack') ? 'clear' : 'dark'
24);
25
26add_event_handler('init', 'greydragon_init');
27
28pwg_set_session_var('show_metadata', 1);
29
30// Load Theme's Parameters
31function greydragon_init() {
32  global $template;
33
34  $themeCore = greyDragonCore::Instance();
35  if ($themeCore->hasOption("p_logo_path") || $themeCore->hasOption("p_header") || $themeCore->hasOption('page_banner', TRUE)):
36    add_event_handler('render_page_banner', 'greydragon_render_header');
37  endif;
38  if ($themeCore->getOption("p_nocounter") == "on"):
39    add_event_handler('loc_end_index', 'no_breadcrumb_counter');
40  endif;
41
42  $template->assign('greydragon', $themeCore->getConfig());
43}
44
45// Render custom header content
46function greydragon_render_header() {
47  return greyDragonCore::Instance()->getHeader();
48}
49
50function no_breadcrumb_counter() {
51  global $template;
52
53  $titre = $template->get_template_vars('TITLE');
54  $pos = strrpos($titre,"[");
55  if ($pos !== false):
56    $template->assign('TITLE', substr($titre, 0, $pos));
57  endif;
58}
59
60?>
Note: See TracBrowser for help on using the repository browser.