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

{if count($errorMessages)}


	<ul>
	{foreach from=$errorMessages item=errorMessage}
		<li>{$errorMessage}</li>
	{/foreach}
	</ul>
{/if}

{*
{if $navi->id != ""}
<table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
	<form action="navigation.php?action=move&amp;area={$smarty.request.area}" method="post">
		<input type="hidden" name="id" value="{$navi->id}" />
		<tr>
			<td class="header" colspan="2">{$langadmin.move}</td>
		</tr>
		<tr>
			<td>{$langadmin.destination}
				<select name="destination">
					<option value="0"></option>
				{foreach from=$navis item=dest}
					{if $dest->id != $navi->id}
					<option value="{$dest->id}">{$dest->title}</option>
						{if count($dest->sub_navi)}
							{foreach from=$dest->sub_navi item=sub_dest}
								{if $sub_dest->id != $navi->id}
					<option value="{$sub_dest->id}">- {$sub_dest->title}</option>
									{if count($sub_dest->sub_navi)}
										{foreach from=$sub_dest->sub_navi item=sub_sub_dest}
											{if $sub_sub_dest->id != $navi->id}
					<option value="{$sub_sub_dest->id}">- - {$sub_sub_dest->title}</option>
											{/if}
										{/foreach}
									{/if}
								{/if}
							{/foreach}
						{/if}
					{/if}
				{/foreach}
				</select>
			</td>
			<td>
				<input type="submit" class="button" value="{$langadmin.move}" />
			</td>
		</tr>
	</form>
</table>
{/if}
*}
{literal}
<script language="JavaScript" type="text/javascript">
<!--

function check(){
if( document.kform.title.value == '')
	{
	alert("{/literal}{$langadmin.errornonavititle}{literal}");
	document.kform.title.focus();
	 return false;
	}
	
if( document.kform.document.value == '')
	{
	alert("{/literal}{$langadmin.errornodocument}{literal}");
	document.kform.document.focus();
	 return false;
	}

if( document.kform.position.value == '')
	{
	alert("{/literal}{$langadmin.errornoposition}{literal}");
	document.kform.position.focus();
	 return false;
	}
}
//-->
</script>
{/literal}
<table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
	<form name="kform" action="navigation.php?action=apply&amp;area={$smarty.request.area}" method="post" onsubmit="return check();">
		<input type="hidden" name="id" value="{$navi->id}" />
		
		<tr>
			<td colspan="2" valign="top" class="header">
			{if $smarty.request.action=="new"}
			{$langadmin.editnavitextnew}
			{else}
			{$langadmin.editnavitext}
			{/if}
			</td>
			
	  </tr>
		<tr>
		  <td width="20%" class="firstrow">{$langadmin.title}</td>
		  <td class="secondrow"><input name="title" type="text" value="{$navi->title}" size="50" /></td>
	  </tr>
	  {if $navi->id == ""}
		<tr>
		  <td width="20%" class="firstrow">{$langadmin.parent_navi}</td>
		  <td class="secondrow"><select name="parent">
            <option value="0"></option>
            
				{foreach from=$navis item=dest}
					{if $dest->id != $navi->id}
					
            <option value="{$dest->id}">{$dest->title}</option>
            
					{/if}
					{if count($dest->sub_navi)}
						{foreach from=$dest->sub_navi item=sub_dest}
							{if $sub_dest->id != $navi->id}
					
            <option value="{$sub_dest->id}">- {$sub_dest->title}</option>
            
							{/if}
						{/foreach}
					{/if}
				{/foreach}
				
	      </select></td>
	  </tr>
	  {/if}
		<tr>
		  <td width="20%" class="firstrow">{$langadmin.document}</td>
		  <td class="secondrow">
		  <input name="document" type="text" value="{$navi->document}" size="50" />
		  {if $navi->id == ""}
		<input type="hidden" name="area" value="{$smarty.post.area_id}" />
			{/if}
		  </td>
	  </tr>
		<tr>
		  <td width="20%" class="firstrow">{$langadmin.openonclick}</td>
		  <td class="secondrow">
		  <select name="openonclick">
            <option value="1" {if $navi->openonclick}selected{/if}>{$langadmin.yes}</option>
            <option value="0" {if !$navi->openonclick}selected{/if}>{$langadmin.no}</option>
          </select></td>
	  </tr>
		<tr>
		  <td width="20%" valign="top" class="firstrow">{$langadmin.menue_groupsaccess}</td>
		  <td class="secondrow"><select name="group[]" multiple size="7">
		    
				{foreach from=$groups item=group}
					
		    <option value="{$group->ugroup}" {if $navi->group_id}{if (in_array($group->ugroup, $navi->group_id)) || ($smarty.request.action=="new")}selected{/if}{/if}>{$group->groupname}</option>
		    
				{/foreach}
				
	      </select></td>
	  </tr>
		<tr>
		  <td width="20%" class="firstrow">{$langadmin.position}</td>
		  <td class="secondrow"><input type="text" name="position" value="{$navi->posi|default:"1"}" size="4" maxlength="4" /></td>
	  </tr>
		<tr>
		  <td width="20%" class="firstrow">&nbsp;</td>
		  <td class="secondrow"><input type="submit" class="button" value="{$langadmin.edit}" />
	      <input name="area" type="hidden" id="area" value="{$smarty.request.area}"></td>
	  </tr>
	</form>
</table>