1 | <?php |
---|
2 | /* |
---|
3 | Theme Name: GreyDragon |
---|
4 | Version: 1.0.14 |
---|
5 | Description: Dark, slate, white background, grayscale. |
---|
6 | Theme URI: http://piwigo.org/ext/extension_view.php?eid=775 |
---|
7 | Author: Serge Dosyukov |
---|
8 | Author URI: http://blog.dragonsoft.us |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | define('GDTHEME_VERSION', '1.0.14'); |
---|
14 | |
---|
15 | require_once( PHPWG_THEMES_PATH . 'greydragon/include/greydragon.class.php'); |
---|
16 | require_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 | |
---|
26 | add_event_handler('init', 'greydragon_init'); |
---|
27 | |
---|
28 | pwg_set_session_var('show_metadata', 1); |
---|
29 | |
---|
30 | // Load Theme's Parameters |
---|
31 | function 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 |
---|
46 | function greydragon_render_header() { |
---|
47 | return greyDragonCore::Instance()->getHeader(); |
---|
48 | } |
---|
49 | |
---|
50 | function 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 | ?> |
---|