<?php
// $Id: url.menu.html.php,v 1.10 2004/02/14 11:11:59 rcastley Exp $
/**
* Administrator menu url presentation layer
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License: http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.10 $
**/

// ensure this file is being included by a parent file
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/**
* Writes the edit form for new and existing content item
*
* A new record is defined when <var>$row</var> is passed witht the <var>id</var>
* property set to 0.
* @param mosContent The category object
*/

class url_menu_html {

	function edit( &$menu, &$olist, &$glist, &$clist, &$parlist, $option ) {
?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			//form.name.value = form.componentid.options[form.componentid.selectedIndex].text;
			//submitform( pressbutton );
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			// do field validation
			if (trim(form.name.value) == ""){
				alert( "Link must have a name" );
			} else if (trim(form.link.value) == ""){
				alert( "You must provide a url." );
			} else {
				submitform( pressbutton );
			}
		}
		</script>

		<form action="index2.php" method="POST" name="adminForm">
		<table cellpadding="4" cellspacing="0" border="0" width="100%">
    <tr> 
      <td width="100%"><span class="sectionname"><?php echo $menu->id ? 'Edit' : 'Add';?> Menu Item - URL</span></td>
    </tr>
  </table>
		<table cellpadding="5" cellspacing="0" border="0" width="100%" class="adminform">
			<tr>
				<td width="20%" align="right">Name:</td>
				<td width="80%">
					<input class="inputbox" type="text" name="name" size="50" maxlength="150" value="<?php echo $menu->name; ?>" />
				</td>
			</tr>
			<tr>
				<td width="20%" align="right">Link:</td>
				<td width="80%">
					<input class="inputbox" type="text" name="link" size="50" maxlength="250" value="<?php echo $menu->link; ?>" />
				</td>
			</tr>
			<tr>
				<td valign="top" align="right">On Click, Open in:</td>
				<td>
					<?php echo $clist; ?>
				</td>
			</tr>
			<tr>
				<td align="right">Parent Item:</td>
				<td>
					<?php echo $parlist;?>
				</td>
			</tr>
			<tr>
				<td valign="top" align="right">Ordering:</td>
				<td>
					<?php echo $olist; ?>
				</td>
			</tr>
			<tr>
				<td valign="top" align="right">Access Level:</td>
				<td>
					<?php echo $glist; ?>
				</td>
			</tr>
		</table>

		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="id" value="<?php echo $menu->id; ?>" />
		<input type="hidden" name="menutype" value="<?php echo $menu->menutype; ?>" />
		<input type="hidden" name="type" value="<?php echo $menu->type; ?>" />
		<input type="hidden" name="task" value="" />
		</form>
<?php
	}
}
?>
