return;
}
+class template_option {
+ var $config = null;
+ var $values = null;
+ var $keys = null;
+
+ function introspect_config_item($item, &$bag) {
+ foreach($this->config[$item] AS $key => $val) {
+ $bag->add($key, $val);
+ }
+ }
+
+ function get_config($item) {
+ return $this->values[$item];
+ }
+
+ function set_config($item, $value) {
+ global $serendipity;
+ serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options
+ WHERE okey = 't_" . serendipity_db_escape_string($serendipity['template']) . "'
+ AND name = '" . serendipity_db_escape_string($item) . "'");
+ serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}options (okey, name, value)
+ VALUES ('t_" . serendipity_db_escape_string($serendipity['template']) . "', '" . serendipity_db_escape_string($item) . "', '" . serendipity_db_escape_string($value) . "')");
+ return true;
+ }
+
+ function import(&$config) {
+ foreach($config AS $key => $item) {
+ $this->config[$item['var']] = $item;
+ $this->keys[$item['var']] = $item['var'];
+ }
+ }
+}
+
if ($serendipity['GET']['adminAction'] == 'install' ) {
serendipity_plugin_api::hook_event('backend_templates_fetchtemplate', $serendipity);
?>
<?php
- if ( @file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] .'/layout.php') ) {
- echo '<div class="serendipityAdminMsgNote">'. WARNING_TEMPLATE_DEPRECATED .'</div>';
+if ( @file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] .'/layout.php') ) {
+ echo '<div class="serendipityAdminMsgNote">'. WARNING_TEMPLATE_DEPRECATED .'</div>';
+}
+
+echo '<h3>' . STYLE_OPTIONS . '</h3>';
+if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] . '/config.inc.php')) {
+ serendipity_smarty_init();
+ include_once $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] . '/config.inc.php';
+}
+
+if (is_array($template_config)) {
+ serendipity_plugin_api::hook_event('backend_templates_configuration_top', $template_config);
+
+ if ($serendipity['POST']['adminAction'] == 'configure') {
+ foreach($serendipity['POST']['template'] AS $option => $value) {
+ template_option::set_config($option, $value);
+ }
+ echo '<div class="serendipityAdminMsgSuccess">' . DONE .': '. sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')) . '</div>';
}
-?>
+ echo '<form method="post" action="serendipity_admin.php">';
+ echo '<input type="hidden" name="serendipity[adminModule]" value="templates" />';
+ echo '<input type="hidden" name="serendipity[adminAction]" value="configure" />';
+
+ include S9Y_INCLUDE_PATH . 'include/functions_plugins_admin.inc.php';
+ $template_vars =& serendipity_loadThemeOptions($template_config);
+
+ $template_options = new template_option();
+ $template_options->import($template_config);
+ $template_options->values =& $template_vars;
+
+ serendipity_plugin_config(
+ $template_options,
+ $template_vars,
+ $serendipity['template'],
+ $serendipity['template'],
+ $template_options->keys,
+ true,
+ true,
+ true,
+ true,
+ 'template'
+ );
+ echo '</form><br />';
+ serendipity_plugin_api::hook_event('backend_templates_configuration_bottom', $template_config);
+} else {
+ echo '<p>' . STYLE_OPTIONS_NONE . '</p>';
+ serendipity_plugin_api::hook_event('backend_templates_configuration_none', $template_config);
+}
-<?php echo SELECT_TEMPLATE; ?>
+echo '<h3>' . SELECT_TEMPLATE . '</h3>';
+?>
<br /><br />
<?php
$i = 0;
<td valign="top">
<?php echo AUTHOR; ?>: <?php echo $info['author'];?><br />
<?php echo LAST_UPDATED; ?>: <?php echo $info['date']; ?><br />
- <?php echo CUSTOM_ADMIN_INTERFACE; ?>: <?php echo (isset($info['custom_admin_interface']) ? $info['custom_admin_interface'] : NO); ?><br />
+ <?php echo CUSTOM_ADMIN_INTERFACE; ?>: <?php echo $info['custom_admin_interface']; ?><br />
</td>
</tr>
</table>