1<?php
2if (IN_serendipity !== true) { die ("Don't hack!"); }
3
4@serendipity_plugin_api::load_language(dirname(__FILE__));
5
6$serendipity['smarty']->assign(array('currpage'  => "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
7                                     'currpage2' => $_SERVER['REQUEST_URI']));
8
9if (class_exists('serendipity_event_spamblock')) {
10    $required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%spamblock%required_fields'", true, 'assoc');
11} elseif (class_exists('serendipity_event_commentspice')) {
12    $required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%commentspice%required_fields'", true, 'assoc');
13}
14
15if (is_array($required_fieldlist)) {
16    $required_fields = explode(',', $required_fieldlist['value']);
17    $smarty_required_fields = array();
18
19    foreach($required_fields AS $required_field) {
20        $required_field = trim($required_field);
21
22        if (empty($required_field)) continue;
23            $smarty_required_fields[$required_field] = $required_field;
24        }
25
26    $serendipity['smarty']->assign('required_fields', $smarty_required_fields);
27}
28
29$template_config = array(
30    array(
31        'var' => 'date_format',
32        'name' => GENERAL_PLUGIN_DATEFORMAT . " (http://php.net/strftime)",
33        'type' => 'select',
34        'default' => DATE_FORMAT_ENTRY,
35        'select_values' => array(DATE_FORMAT_ENTRY => DATE_FORMAT_ENTRY,
36                                '%A, %e. %B %Y' => '%A, %e. %B %Y',
37                                '%a, %e. %B %Y' => '%a, %e. %B %Y',
38                                '%e. %B %Y' => '%e. %B %Y',
39                                '%d.%m.%y' => '%d.%m.%y',
40                                '%d.%m.%Y' => '%d.%m.%Y',
41                                '%A, %m/%d/%Y' => '%A, %m/%d/%Y',
42                                '%a, %m/%d/%y' => '%a, %m/%d/%y',
43                                '%m/%d/%y' => '%m/%d/%y',
44                                '%m/%d/%Y' => '%m/%d/%Y',
45                                '%Y-%m-%d' => '%Y-%m-%d')
46    ),
47    array(
48       'var' => 'bs_fluid',
49       'name' => BS_FLUID,
50       'type' => 'boolean',
51       'default' => false
52    ),
53    array(
54        'var' => 'bs_navbar_type',
55        'name' => BS_NAVBAR_TYPE,
56        'type' => 'select',
57        'default' => 'default',
58        'select_values' => array('default' => BS_DEFAULT,
59                                'fixed-top' => BS_TOP,
60                                'fixed-bottom' => BS_BOTTOM,
61                                'sticky-top' => BS_STICKY)
62    ),
63    array(
64        'var' => 'bs_navbar_style',
65        'name' => BS_NAVBAR_STYLE,
66        'type' => 'select',
67        'default' => 'light',
68        'select_values' => array('light' => BS_LIGHT,
69                                'dark' => BS_DARK,
70                                'primary' => BS_PRIMARY)
71    ),
72    array(
73        'var' => 'bs_jumbotron_type',
74        'name' => BS_JUMBOTRON_TYPE,
75        'type' => 'select',
76        'default' => 'large',
77        'select_values' => array('large' => BS_LARGE,
78                                'small' => BS_SMALL,
79                                'compact' => BS_COMPACT,
80                                'none' => BS_NONE)
81    ),
82    array(
83        'var' => 'bs_jumbotron_style',
84        'name' => BS_JUMBOTRON_STYLE,
85        'type' => 'select',
86        'default' => 'primary',
87        'select_values' => array('light' => BS_LIGHT,
88                                'dark' => BS_DARK,
89                                'primary' => BS_PRIMARY)
90    ),
91    array(
92       'var' => 'bs_feeds',
93       'name' => BS_RSS,
94       'type' => 'boolean',
95       'default' => true
96    ),
97    array(
98       'var' => 'use_corenav',
99       'name' => USE_CORENAV,
100       'type' => 'boolean',
101       'default' => true
102    )
103);
104
105$template_global_config = array('navigation' => true);
106$template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option'], true);
107serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
108
109if ($_SESSION['serendipityUseTemplate']) {
110    $template_loaded_config['use_corenav'] = false;
111}
112