{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{include uri="design:settings/settings_validation.tpl"}

<form method="post" action={"settings/edit"|ezurl}>

{* DESIGN: Header START *}<div class="box-header"><div class="box-tc"><div class="box-ml"><div class="box-mr"><div class="box-tl"><div class="box-tr">
<h1 class="context-title">
{section show=$setting_name}
    {'Edit setting %setting'|i18n('design/admin/settings',,hash( '%setting', $setting_name ) )}
{section-else}
    {'New setting'|i18n('design/admin/settings')}
{/section}
</h1>

{* DESIGN: Mainline *}<div class="header-mainline"></div>

{* DESIGN: Header END *}</div></div></div></div></div></div>

{* DESIGN: Content START *}<div class="box-ml"><div class="box-mr"><div class="box-content">
<div class="context-attributes">

<div class="object">
    <h2>{'Ini setting'|i18n( 'design/admin/settings')}</h2>
    <p><strong>{'Ini File'|i18n( 'design/admin/settings' )}:</strong> {$ini_file}</p>
    <p><strong>{'Block'|i18n( 'design/admin/settings')}:</strong> {$block}</p>
    {section show=$setting_name}
        <p><strong>{'Setting'|i18n( 'design/admin/settings' )}:</strong> {$setting_name}</p>
        {section-else}
        <p><strong>{'Setting: <new setting>'|i18n( 'design/admin/settings' )|wash}</strong></p>
    {/section}
    <p><strong>{'Siteaccess'|i18n( 'design/admin/settings' )}:</strong> {$current_siteaccess}</p>
    <p>{'Values for each location setting are shown. The first values are lowest priority; the values toward the end have higher priority than the first ones.'|i18n( 'design/admin/settings' )|wash}</p>
    <p><strong>{'Tip'|i18n( 'design/admin/settings' )}:</strong>{'To create an empty array leave the first line empty'|i18n( 'design/admin/settings' )} </p>
    <div class="block">
        <div class="element">
            <label>{'Change setting type'|i18n( 'design/admin/settings')}:</label>
            <select name="SettingType" onchange="submit()">
            {section name=Files loop=$setting_type_array}
                {section show=eq( $:key, $setting_type )}
                    <option value="{$:key}" selected="selected">{$:item}</option>
                {section-else}
                    <option value="{$:key}">{$:item}</option>
                {/section}
            {/section}
            </select>
        </div>
    </div>

    <div class="break"></div>

</div>

<input type="hidden" name="INIFile" value="{$ini_file}" />
<input type="hidden" name="Block" value="{$block}" />

<input type="hidden" name="SiteAccess" value="{$current_siteaccess}" />

<div class="block">
<table class="list" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
    <th width="50%">
        {'Location (prioritized list shown)'|i18n( 'design/admin/settings' )|wash}
    </th>
    <th >
	{'Value'|i18n( 'design/admin/settings' )|wash}
    </th>
</tr>
<tr>
    <td>
        <strong>{'Default (cannot change)'|i18n( 'design/admin/settings' )|wash}</strong>
    </td>
    <td>
        {if and( is_set( $values['default'] ), ne( $values['default'], false() ))}
	    {$values['default']}
	{else}
	    {'No value'|i18n( 'design/admin/settings' )|wash}
	{/if}
    </td>
</tr>
<tr>
    <td><label><input type="radio" name="SettingPlacement" {section show=eq( $placement, "siteaccess" )}checked="checked"{/section} value="siteaccess">{'Siteaccess setting'|i18n('design/admin/settings')}</label></td>
    <td>
	{if and( is_set( $values['siteaccess'] ), ne( $values['siteaccess'], false() ) )}
	    {$values['siteaccess']}
	{else}
	    {'No value'|i18n( 'design/admin/settings' )|wash}
	{/if}
    </td>
</tr>
{foreach $values['extensions'] as $extension_name=>$extension_value}
<tr>
    <td><label><input type="radio" name="SettingPlacement" value="{$extension_name}">{$extension_name}</label></td>
    <td>
        {if ne( $extension_value, false() )}
	    {$extension_value}
	{else}
	    {'No value'|i18n( 'design/admin/settings' )|wash}
	{/if}
    </td>
</tr>
{/foreach}
<tr>
    <td><label><input type="radio" name="SettingPlacement" value="override" {section show=ne( $placement, "siteaccess" )}checked="checked"{/section}>{'Override setting (global)'|i18n( 'design/admin/settings' )}</label></td>
    <td>
        {if and( is_set( $values['override'] ), ne( $values['override'], false() ) )}
	    {$values['override']}
	{else}
	    {'No value'|i18n( 'design/admin/settings' )|wash}
	{/if}
    </td>
</tr>
</table>
</div>

<input type="hidden" name="Block" value="{$block}" />

{section show=$setting_name}
    <input type="hidden" name="SettingName" value="{$setting_name}" />
{section-else}
    <div class="block">
        <label>{'Setting name'|i18n( 'design/admin/settings' )}:</label>
        <input type="text" size="20" name="SettingName" value="" />
    </div>
{/section}

<div class="block">
    <label>{'Setting value'|i18n( 'design/admin/settings' )}:</label>

    {switch match=$setting_type}
    {case match='array'}
        <textarea size="70" rows="10" class="box" name="Value">{$value|wash}</textarea>
    {/case}
    {case match='enable/disable'}
        <select name="Value">
        {section show= eq( $value, 'enabled' )}
            <option value="enabled" selected="selected">{'Enabled'|i18n( 'design/admin/settings' )}</option>
            <option value="disabled">{'Disabled'|i18n( 'design/admin/settings' )}</option>
            {section-else}
            <option value="disabled" selected="selected">{'Disabled'|i18n( 'design/admin/settings' )}</option>
            <option value="enabled">{'Enabled'|i18n( 'design/admin/settings' )}</option>
        {/section}
        </select>
    {/case}
    {case match='true/false'}
        <select name="Value">
        {section show=eq( $value, 'true' )}
            <option value="true" selected="selected">{'True'|i18n( 'design/admin/settings' )}</option>
            <option value="false">{'False'|i18n( 'design/admin/settings' )}</option>
            {section-else}
            <option value="false" selected="selected">{'False'|i18n( 'design/admin/settings' )}</option>
            <option value="true">{'True'|i18n( 'design/admin/settings' )}</option>
        {/section}
        </select>
    {/case}
    {case}
        <input type="text" size="40" name="Value" value="{$value|wash}" />
    {/case}
    {/switch}
</div>

</div>
{* DESIGN: Content END *}</div></div></div>

<div class="controlbar">
{* DESIGN: Control bar START *}<div class="box-bc"><div class="box-ml"><div class="box-mr"><div class="box-tc"><div class="box-bl"><div class="box-br">
<div class="block">
    <input class="button" type="submit" name="WriteSetting" value="{'Save'|i18n( 'design/admin/settings' )}" />
    <input class="button" type="submit" name="Cancel" value="{'Cancel'|i18n( 'design/admin/settings' )}" />

</div>
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>



</form>
