First attempt at admin settings page with writeable database backend.
Currently broken due to PHP's transparent conversion of "." to "_" in POST variable names!
This commit is contained in:
@@ -1 +1,56 @@
|
||||
Not yet implemented.
|
||||
<h2>Settings</h2>
|
||||
|
||||
<table id="settings">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$settings item=name}
|
||||
{assign var='value' value=$config->get($name)}
|
||||
{assign var='type' value=$config->type($name)}
|
||||
{assign var='id' value=str_replace('.', '-',$name)}
|
||||
<tr>
|
||||
<td>{$name}</td>
|
||||
<td>
|
||||
{switch $type}
|
||||
{case Sihnon_Config::TYPE_BOOL}
|
||||
<input type="checkbox" id="setting_{$id}" name="{$name}" value="1" {if $value}checked="checked" {/if} class="setting" />
|
||||
{/case}
|
||||
{case Sihnon_Config::TYPE_INT}
|
||||
<input type="text" id="setting_{$id}" name="{$name}" value="{$value}" class="setting settings_field_numeric" />
|
||||
{/case}
|
||||
{case Sihnon_Config::TYPE_STRING}
|
||||
<input type="text" id="setting_{$id}" name="{$name}" value="{$value}" class="setting settings_field_string" />
|
||||
{/case}
|
||||
{case Sihnon_Config::TYPE_STRING_LIST}
|
||||
<div id="container_{$id}">
|
||||
{foreach from=$value item=line name=settings}
|
||||
<div id="settings_{$id}_line{$smarty.foreach.settings.iteration}">
|
||||
<input type="text" name="{$name}[]" value="{$line}" class="setting settings_field_string" />
|
||||
<input type="button" value="-" class="settings_field_remove" onclick="rc.settings.remove_field('{$id}', '{$smarty.foreach.settings.iteration}')" />
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<div class="settings_addfieldcontainer">
|
||||
<input type="hidden" id="settings_{$id}_next" value="{$smarty.foreach.settings.iteration+1}" />
|
||||
<input type="button" value="+" class="settings_field_add" onclick="rc.settings.add_stringlist_field('{$id}')" />
|
||||
</div>
|
||||
{/case}
|
||||
{/switch}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="button" id="settings_save" name="save" value="Save" />
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
rc.settings.init();
|
||||
</script>
|
||||
@@ -2,7 +2,7 @@
|
||||
{if $messages}
|
||||
messages: [
|
||||
{foreach from=$messages item=message}
|
||||
'{$message}',
|
||||
'{$message|json_encode}',
|
||||
{/foreach}
|
||||
],
|
||||
{/if}
|
||||
|
||||
0
webui/source/templates/ajax/update-settings.tpl
Normal file
0
webui/source/templates/ajax/update-settings.tpl
Normal file
@@ -8,4 +8,10 @@
|
||||
<li><a href="{$base_uri}sources/list" title="Browse Sources">Sources</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Admin
|
||||
<ul>
|
||||
<li><a href="{$base_uri}admin/settings" title="Edit Settings">Settings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user