<!--
Selectbox edit
-->

<SCRIPT language="javascript">
{literal}
function confirmLink(theLink, confirmText) {
    if (confirmText == '') {
        return true;
    }

    var is_confirmed = confirm(confirmText + '\n');
	if (is_confirmed) {
        theLink.href += '&is_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function
{/literal}
</SCRIPT>

<table border="0" width="100%">
  <tr>
    <td valign="top">
      <b>&nbsp;{$TITLE.edit_selectboxes} <i>{$data.title}</i></b>
	  &nbsp;-&nbsp;<a href="{$add_selectboxvalue_url}" title="{$STRING.add_new_selectbox_value}">{$STRING.add_new_selectbox_value}</a>
	  <hr size="1">
		  {if not $noSb}
	  
		<form method=post action="project.php">
			<input type=hidden name="field_conf_id" value="{$data.field_conf_id}">
			<input type=hidden name="do" value="edit_selectbox_validate">
			<table>
			<th>{$STRING.delete}</th>
			<th>{$STRING.selectbox.order}</th>
			<th>{$STRING.selectbox.value}</th>
			<th>{$STRING.selectbox.description}</th>
			<th>{$STRING.selectbox.reserved}</th>
			<th>{$STRING.selectbox.expanded}</th>
			<th>{$STRING.selectbox.hidden}</th>
			{if $isStatus}
				<th>{$STRING.selectbox.closed}</th>
				<th>{$STRING.selectbox.sequenceFree}</th>
			{/if}
			
			{section name=sb loop=$input}
			<tr>
				<td>
					<a href="{$input[sb].del_url}" onClick="return confirmLink(this, '{$STRING.warning_sv_must_not_be_used|addslashes}\n' + '{$STRING.do_you_want_to_continue|addslashes}');">{$STRING.del}</a>
					<!-- {$STRING.unable_to_delete_selectbox_value} -->
				</td>
				<td>
					{$input[sb].order}
				</td>
				<td>
					{$input[sb].value}
				</td>
				<td>
					{$input[sb].description}
				</td>
				<td>
					{$input[sb].options.reserved}
				</td>
				<td>
					{$input[sb].options.expanded}
				</td>
				<td>
					{$input[sb].options.hidden}
				</td>
				{if $isStatus}
				<td>
					{$input[sb].options.closed}
				</td>
				<td>
					{$input[sb].options.sequenceFree}
				</td>
				{/if}
			</tr>
			{/section}			
			<tr>
				<td>
					<input type=submit value=OK>
				</td>
				<td>	
					<!-- <a href="{$back_url}">{$STRING.back}</a> -->
					<INPUT TYPE="Button" Value="{$STRING.back}" onClick="window.location.href='{$back_url}'">
				</td>
			</tr>
			</table>			
			</form>
			{else}
				{$STRING.no_selectbox_value}
				<br>
				<INPUT TYPE="Button" Value="{$STRING.PreviousPage}" OnClick="history.go(-1)">
			{/if}
    </td>
	</tr>
</table>
