File size: 2.67Kb
<?php echo $this->validation()->messages() ?>
<h1><?php echo __('Settings') ?></h1>
<form action="" method="post">
<table class="grid" width="400">
<?php
foreach ($settings as $s)
{
$key = $s->name;
$val = $s->val;
$label = Inflector::humanize($s->name);
switch ($key)
{
case 'template':
$input_element = '';
foreach ($themes as $theme)
{
if ($val === $theme)
{
$sel = ' slected="selected"';
}
else
{
$sel = '';
}
$input_element .= '<option value="' . View::escape($theme) . '"' . $sel . '>' . View::escape($theme) . '</option>';
}
$input_element = '<select name="' . $key . '" id="' . $key . '">' . $input_element . '</select>';
$input_element .= '<p><em>' . __('If you want to modify template copy base template and work on copy. Do not make changes on Base template because on script update it may be updated and your custom changes will be deleted.') . '</em></p>';
break;
case 'wallpaper_sizes':
$input_element = '<input name="' . $key . '" type="text" id="' . $key . '" value="' . View::escape($val) . '" size="40" />';
$input_element .= ' <em>' . __('Comma seperated WIDTHxHEIGHT values. Leave empty to use default resize values.') . '</em>';
$input_element .= ' <p><em>' . __('Default') . ': ' . implode(', ', Wallpaper::arrSizes(true)) . '</em></p>';
break;
case 'news_from_veppa_on':
case 'approve_user_comments':
$input_element = '<input name="' . $key . '" type="checkbox" id="' . $key . '" value="1" '.($val?'checked="cheked"':'').' />';
break;
default:
$input_element = '<input name="' . $key . '" type="text" id="' . $key . '" value="' . View::escape($val) . '" size="40" />';
}
?>
<tr>
<td><label for="<?php echo $key ?>"><?php echo View::escape($label) ?>:</label> </td>
<td><?php echo $input_element ?></td>
</tr>
<?php
}
?>
<tr>
<td></td>
<td><input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
</table>
</form>