<?php
	!defined('IN_MANAGE') && exit('Access Denied!');
	$action=empty($action)?'top':trim($action);
	
	include SYSTEM_ROOT.'include/nav.class.php';
	$navobj=new nav();

	switch($action)
	{
		case 'top':
			$parentid=$parentid?intval($parentid):0;
			if(isset($do_submit))
			{
				if($navobj->set($parentid,1,$id,$old_orderby,$old_name,$old_url,$old_color,$orderby,$name,$url,$color))
				{
					admin_success($adminlang['manage_success']);
				}
				else
				{
					admin_error($adminlang['manage_error']);
				}
			}
			$datalist=$navobj->navlist(1,$parentid);
			include admin_tlp('nav');
			break;
		case 'nav':
			$parentid=$parentid?intval($parentid):0;
			if(isset($do_submit))
			{
				if($navobj->set($parentid,2,$id,$old_orderby,$old_name,$old_url,$old_color,$orderby,$name,$url,$color))
				{
					admin_success($adminlang['manage_success']);
				}
				else
				{
					admin_error($adminlang['manage_error']);
				}
			}
			$datalist=$navobj->navlist(2,$parentid);
			include admin_tlp('nav');
			break;
		case 'life':
			$parentid=$parentid?intval($parentid):0;
			if(isset($do_submit))
			{
				if($navobj->set($parentid,3,$id,$old_orderby,$old_name,$old_url,$old_color,$orderby,$name,$url,$color))
				{
					admin_success($adminlang['manage_success']);
				}
				else
				{
					admin_error($adminlang['manage_error']);
				}
			}
			$datalist=$navobj->navlist(3,$parentid);
			include admin_tlp('nav');
			break;
		case 'phone':
			$parentid=$parentid?intval($parentid):0;
			if(isset($do_submit))
			{
				if($navobj->set($parentid,4,$id,$old_orderby,$old_name,$old_url,$old_color,$orderby,$name,$url,$color))
				{
					admin_success($adminlang['manage_success']);
				}
				else
				{
					admin_error($adminlang['manage_error']);
				}
			}
			$datalist=$navobj->navlist(4,$parentid);
			include admin_tlp('phone');
			break;
	}
?>