2015-06-01 13:24:48 +02:00
|
|
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
$elcount = 0;
|
|
|
|
$htmlnugget = array();
|
|
|
|
foreach ($this->config as $config_item) {
|
|
|
|
$elcount++;
|
|
|
|
$config_value = $this->staticpage[$config_item];
|
|
|
|
$cbag = new serendipity_property_bag;
|
|
|
|
$this->introspect_item($config_item, $cbag);
|
|
|
|
|
2014-11-25 01:15:57 +01:00
|
|
|
$cname = (function_exists('serendipity_specialchars') ? serendipity_specialchars($cbag->get('name')) : htmlspecialchars($cbag->get('name'), ENT_COMPAT, LANG_CHARSET));
|
|
|
|
$cdesc = (function_exists('serendipity_specialchars') ? serendipity_specialchars($cbag->get('description')) : htmlspecialchars($cbag->get('description'), ENT_COMPAT, LANG_CHARSET));
|
2011-12-13 12:29:05 +01:00
|
|
|
$value = $this->get_static($config_item, 'unset');
|
2014-11-25 01:15:57 +01:00
|
|
|
$lang_direction = (function_exists('serendipity_specialchars') ? serendipity_specialchars($cbag->get('lang_direction')) : htmlspecialchars($cbag->get('lang_direction'), ENT_COMPAT, LANG_CHARSET));
|
2011-12-13 12:29:05 +01:00
|
|
|
$only_type = $cbag->get('only_type');
|
|
|
|
if (!empty($only_type) && $type != $only_type) {
|
|
|
|
$elcount--;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (empty($lang_direction)) {
|
|
|
|
$lang_direction = LANG_DIRECTION;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Apparently no value was set for this config item */
|
|
|
|
if ($value === 'unset') {
|
|
|
|
/* Try and the default value for the config item */
|
|
|
|
$value = $cbag->get('default');
|
|
|
|
}
|
2014-11-25 01:15:57 +01:00
|
|
|
$hvalue = (!isset($_POST["serendipity"]["staticSubmit"]) && isset($_POST['serendipity']['plugin'][$config_item]) ? (function_exists('serendipity_specialchars') ? serendipity_specialchars($_POST['serendipity']['plugin'][$config_item]) : htmlspecialchars($_POST['serendipity']['plugin'][$config_item], ENT_COMPAT, LANG_CHARSET)) : (function_exists('serendipity_specialchars') ? serendipity_specialchars($value) : htmlspecialchars($value, ENT_COMPAT, LANG_CHARSET)));
|
2011-12-13 12:29:05 +01:00
|
|
|
$radio = array();
|
|
|
|
$select = array();
|
|
|
|
$per_row = null;
|
|
|
|
|
|
|
|
switch ($cbag->get('type')) {
|
|
|
|
case 'seperator':
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
<hr>
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'select':
|
|
|
|
$select = $cbag->get('select_values');
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
<div class="clearfix form_select<?php if ($cdesc != '') { ?> has_info<?php } ?>">
|
|
|
|
<label for="serendipity_<?php echo $config_item; ?>"><?php echo $cname; ?><?php if ($cdesc != '') { ?> <button class="toggle_info button_link" type="button" data-href="#<?php echo $config_item; ?>_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> <?php echo MORE; ?></span></button><?php } ?></label>
|
|
|
|
<?php if ($cdesc != '') { ?><span id="<?php echo $config_item; ?>_info" class="field_info additional_info"><?php echo $cdesc; ?></span><?php } ?>
|
|
|
|
<select id="serendipity_<?php echo $config_item; ?>" class="direction_<?php echo $lang_direction; ?>" name="serendipity[plugin][<?php echo $config_item; ?>]{($is_multi_select) ? '[]' : ''}" {($is_multi_select) ? 'multiple' : ''} {($is_multi_select && ($select_size > 0)) ? "size='{$select_size}'" : ''}>
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
foreach($select AS $select_value => $select_desc) {
|
2014-11-25 01:15:57 +01:00
|
|
|
$id = (function_exists('serendipity_specialchars') ? serendipity_specialchars($config_item . $select_value) : htmlspecialchars($config_item . $select_value, ENT_COMPAT, LANG_CHARSET));
|
2011-12-13 12:29:05 +01:00
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
<option value="<?php echo $select_value; ?>" <?php echo ($select_value == $hvalue ? 'selected="selected"' : ''); ?> title="<?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($select_desc) : htmlspecialchars($select_desc, ENT_COMPAT, LANG_CHARSET)); ?>"><?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($select_desc) : htmlspecialchars($select_desc, ENT_COMPAT, LANG_CHARSET)); ?></option>
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
</select>
|
|
|
|
</div>
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'tristate':
|
|
|
|
$per_row = 3;
|
|
|
|
$radio['value'][] = 'default';
|
|
|
|
$radio['desc'][] = USE_DEFAULT;
|
|
|
|
|
|
|
|
case 'boolean':
|
|
|
|
$radio['value'][] = 'true';
|
|
|
|
$radio['desc'][] = YES;
|
|
|
|
|
|
|
|
$radio['value'][] = 'false';
|
|
|
|
$radio['desc'][] = NO;
|
|
|
|
|
|
|
|
case 'radio':
|
|
|
|
if (!count($radio) > 0) {
|
|
|
|
$radio = $cbag->get('radio');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (empty($per_row)) {
|
|
|
|
$per_row = $cbag->get('radio_per_row');
|
|
|
|
if (empty($per_row)) {
|
|
|
|
$per_row = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
<fieldset<?php if ($cdesc != '') { ?> class="has_info"<?php } ?>>
|
|
|
|
<span class="wrap_legend"><legend><?php echo $cname; ?><?php if ($cdesc != '') { ?> <button class="toggle_info button_link" type="button" data-href="#<?php echo $config_item; ?>_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> <?php echo MORE; ?></span></button><?php } ?></legend></span>
|
|
|
|
<?php if ($cdesc != '') { ?><span id="<?php echo $config_item; ?>_info" class="field_info additional_info"><?php echo $cdesc; ?></span><?php } ?>
|
|
|
|
<div class="clearfix grouped">
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
$counter = 0;
|
|
|
|
foreach($radio['value'] AS $radio_index => $radio_value) {
|
2014-11-25 01:15:57 +01:00
|
|
|
$id = (function_exists('serendipity_specialchars') ? serendipity_specialchars($config_item . $radio_value) : htmlspecialchars($config_item . $radio_value, ENT_COMPAT, LANG_CHARSET));
|
2011-12-13 12:29:05 +01:00
|
|
|
$counter++;
|
|
|
|
$checked = "";
|
|
|
|
|
|
|
|
if ($radio_value == 'true' && ($hvalue === '1' || $hvalue === 'true')) {
|
|
|
|
$checked = " checked";
|
|
|
|
} elseif ($radio_value == 'false' && ($hvalue === '' || $hvalue ==='0' || $hvalue === 'false')) {
|
|
|
|
$checked = " checked";
|
|
|
|
} elseif ($radio_value == $hvalue) {
|
|
|
|
$checked = " checked";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($counter == 1) {
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
<div class="form_radio">
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
<input id="serendipity_plugin_<?php echo $id; ?>" class="direction_<?php echo $lang_direction; ?>" name="serendipity[plugin][<?php echo $config_item; ?>]" type="radio" value="<?php echo $radio_value; ?>" <?php echo $checked ?> title="<?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($radio['desc'][$radio_index]) : htmlspecialchars($radio['desc'][$radio_index], ENT_COMPAT, LANG_CHARSET)); ?>">
|
|
|
|
<label for="serendipity_plugin_<?php echo $id; ?>"><?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($radio['desc'][$radio_index]) : htmlspecialchars($radio['desc'][$radio_index], ENT_COMPAT, LANG_CHARSET)); ?></label>
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
if ($counter == $per_row) {
|
|
|
|
$counter = 0;
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
</div>
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'string':
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
<div class="clearfix configuration_group">
|
|
|
|
<div class="clearfix form_field<?php if ($cdesc != '') { ?> has_info<?php } ?>">
|
|
|
|
<label for="serendipity_<?php echo $config_item; ?>"><?php echo $cname; if ($cdesc != '') { ?> <button class="toggle_info button_link" type="button" data-href="#<?php echo $config_item; ?>_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> <?php echo MORE; ?></span></button><?php } ?></label>
|
|
|
|
<?php if ($cdesc != '') { ?><span id="<?php echo $config_item; ?>_info" class="field_info additional_info"><?php echo $cdesc; ?></span><?php } ?>
|
|
|
|
<input id="serendipity_<?php echo $config_item; ?>" class="direction_<?php echo $lang_direction; ?>" name="serendipity[plugin][<?php echo $config_item; ?>]" type="text" value="<?php echo $hvalue; ?>">
|
|
|
|
</div>
|
|
|
|
</div>
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'html':
|
|
|
|
case 'text':
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
|
|
|
|
<div class="clearfix form_area<?php if ($cdesc != '') { ?> has_info<?php } ?>">
|
|
|
|
<label for="nuggets<?php echo $elcount; ?>"><?php echo $cname; if ($cdesc != '' && !$backend_wysiwyg) { ?> <button class="toggle_info button_link" type="button" data-href="#nuggets<?php echo $elcount; ?>_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> <?php echo MORE; ?></span></button><?php } ?></label>
|
|
|
|
<?php if ($cdesc != '') { ?><span id="nuggets<?php echo $elcount; ?>_info" class="field_info additional_info"><?php echo $cdesc; ?></span><?php } ?>
|
|
|
|
<textarea id="nuggets<?php echo $elcount; ?>" class="direction_<?php echo $lang_direction; ?>" name="serendipity[plugin][<?php echo $config_item; ?>]" rows="{$text_rows}"><?php echo $hvalue; ?></textarea>
|
|
|
|
</div>
|
|
|
|
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php
|
|
|
|
if ($cbag->get('type') == 'html') {
|
|
|
|
$htmlnugget[] = $elcount;
|
2015-06-01 13:24:48 +02:00
|
|
|
// SpawnMulti false per default (see multi nugget textareas, eg contactform) - where do we use jsname furthermore - or is that deprecated?
|
|
|
|
serendipity_emit_htmlarea_code("nuggets{$elcount}","nuggets{$elcount}");
|
2011-12-13 12:29:05 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'content':
|
2015-06-01 13:24:48 +02:00
|
|
|
?>
|
|
|
|
<div class="clearfix">
|
|
|
|
<?php echo $cbag->get('default'); ?>
|
|
|
|
</div>
|
|
|
|
<?php
|
2011-12-13 12:29:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'hidden':
|
2015-06-01 13:24:48 +02:00
|
|
|
?>
|
|
|
|
<div class="clearfix">
|
|
|
|
<input name="serendipity[plugin][<?php echo $config_item; ?>]" type="hidden" value="<?php echo $cbag->get('value'); ?>">
|
|
|
|
</div>
|
|
|
|
<?php
|
2011-12-13 12:29:05 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($serendipity['wysiwyg']) && $serendipity['wysiwyg'] && count($htmlnugget) > 0) {
|
|
|
|
$ev = array('nuggets' => $htmlnugget, 'skip_nuggets' => false);
|
|
|
|
serendipity_plugin_api::hook_event('backend_wysiwyg_nuggets', $ev);
|
|
|
|
|
|
|
|
if ($ev['skip_nuggets'] === false) {
|
|
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function Spawnnugget() {
|
2015-06-01 13:24:48 +02:00
|
|
|
<?php foreach($htmlnugget AS $htmlnuggetid) { ?>
|
|
|
|
if (window.Spawnnuggets) Spawnnuggets('<?php echo $htmlnuggetid; ?>');
|
2011-12-13 12:29:05 +01:00
|
|
|
<?php } ?>
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2015-06-01 13:24:48 +02:00
|
|
|
|
|
|
|
<div class="clearfix edit_actions">
|
|
|
|
<input class="input_button state_submit" type="submit" value="<?php echo SAVE; ?>" name="serendipity[SAVECONF]">
|
2011-12-13 12:29:05 +01:00
|
|
|
</div>
|
2015-06-01 13:24:48 +02:00
|
|
|
|
|
|
|
</div>
|