
{include file="../head.tpl"}

{if $smarty.request.action=="new" && $error==1}
<strong><font color="#FF0000" size="+1">{$langadmin.staticpages_notwriteable}</font></strong>{else}

<script language="JavaScript" type="text/javascript">
<!--

function check(){ldelim}
if( document.kform.title.value == "")
	{ldelim}
	alert("{$langadmin.jserror_notitle}");
	document.kform.title.focus();
	 return false;
	{rdelim}
{if $smarty.request.action=="new"}	
if( document.kform.pagename.value == "")
	{ldelim}
	alert("{$langadmin.jserror_nodoctitle}");
	document.kform.pagename.focus();
	return false;
	{rdelim}
{/if}
{rdelim}
//-->
</script>

</script>
<form name="kform" method="post" enctype="multipart/form-data" onSubmit="return check();">
  <table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
    <tr>
      <td colspan="2" class="header">
	  {if $smarty.request.action=="new"}
	  {$langadmin.staticpages_create}
	  {else}
	  {$langadmin.staticpages_edit}
	  {/if}
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="firstrow">{$langadmin.staticpages_info}
	 </td>
    </tr>
    <tr>
      <td class="c1">{$langadmin.kat}</td>
      <td class="c2"><select name="categ" id="categ">
	  <option value="1">{$langadmin.choosecateg}</option>
        {foreach from=$categs item=c}
		<option value="{$c->id}" {if $c->id==$row->categ}selected="selected"{/if}>{$c->name}</option>
		{/foreach}
      </select></td>
    </tr>
    <tr>
      <td width="25%" class="c1">{$langadmin.title}<br>
        <small>{$langadmin.statictitledesc}</small></td>
      <td class="c2"><input name="title" type="text" id="title" value="{$row->title}" size="50"></td>
    </tr>
	{if $smarty.request.action=="new"}
    <tr>
      <td width="25%" class="c1">{$langadmin.staticpages_docname}<br>
      <small>{$langadmin.staticpages_name} </small></td>
      <td class="c2"><input name="pagename" type="text" id="pagename" value="{$row->pagename}" size="50">
      .tpl</td>
    </tr>
	{/if}
    <tr>
      <td colspan="2" class="theader">ÄÚÈÝ</td>
    </tr>
    <tr>
      <td colspan="2" style="padding:0px">{$ed2}</td>
    </tr>
    <tr>
      <td colspan="2" class="secondrow"><input type="submit" class="button" value="{if $smarty.request.action=="new"}{$langadmin.create}{else}{$langadmin.refresh}{/if}">
      {if $smarty.request.action=="new"}
	  <input name="area" type="hidden" id="area" value="{$area}">
	  {else}
	  <input name="area" type="hidden" id="area" value="{$smarty.request.area}">
	  <input name="pi" type="hidden" id="pi" value="{$row->id}">
	  <input name="pagename" type="hidden" id="pagename" value="{$row->pagename}.tpl">
	  {/if}
	  <input name="save" type="hidden" id="save" value="1">
      
	  </td>
    </tr>
  </table>
</form>
{/if}
{include file="../foot.tpl"}