{* 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}
    {'Edit setting %setting'|i18n('design/admin/settings',,hash( '%setting', $setting) )}
{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">
    <p>{'Block'|i18n( 'design/admin/settings')}: {$block}</p>
    {section show=$setting}
        <p>{'Setting'|i18n( 'design/admin/settings' )}: {$setting}</p>
        {section-else}
        <p>{'Setting: <new setting>'|i18n( 'design/admin/settings' )|wash}</p>
    {/section}
    <p>{'INI File'|i18n( 'design/admin/settings' )}: {$ini_file}</p>
    <p>{'SiteAccess'|i18n( 'design/admin/settings' )}: {$current_siteaccess}</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}" />

<p><strong>{'Note'|i18n( 'design/admin/settings' )}:</strong> {'A global setting will override a siteaccess setting'|i18n( 'design/admin/settings' )}</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">
    {section show=eq( $placement, "siteaccess" )}
        <label><input type="radio" name="SettingPlacement" checked="checked" value="siteaccess">{'Siteaccess setting'|i18n('design/admin/settings')}</label>
        <label><input type="radio" name="SettingPlacement" value="override" >{'Override setting (global)'|i18n( 'design/admin/settings' )}</label>
     {section-else}
        <label><input type="radio" name="SettingPlacement" value="siteaccess" >{'Siteaccess setting'|i18n( 'design/admin/settings' )}</label>
        <label><input type="radio" name="SettingPlacement" value="override" checked="checked">{'Global setting'|i18n( 'design/admin/settings' )}</label>
    {/section}
</div>

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

{section show=$setting}
    <input type="hidden" name="SettingName" value="{$setting}" />
{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>
