<?php
if(!defined("BASE_DIR")) exit;

if(!perm('content'))
{
	no_perm();
} else {
	include_once(BASE_DIR . 'admin/class/class.content.php');
	$content = new Content;
	
	$_REQUEST['sub'] = (isset($_REQUEST['sub']) && !empty($_REQUEST['sub'])) ? $_REQUEST['sub'] : 'overview';
	
	switch($_REQUEST['sub'])
	{
		case '':
		case 'overview':
			$content->showContent();
		break;
		
		case 'addcontent':
			$content->addContent();
		break;
		
		case 'editcontent':
			$content->editContent($_REQUEST['id']);
		break;
		
		case 'delete':
			$content->deleteContent($_REQUEST['id']);
		break;
		
		case 'categories':
			$content->displayCategs();
		break;
		
		case 'delcateg':
			$content->delCateg($_REQUEST['id']);
		break;
		
		case 'openclose':
			$content->Openclose($_REQUEST['openclose'],$_REQUEST['id']);
		break;
		
		case 'delrating':
			if(!perm('del_rating'))
				no_perm();
			else
				$content->DelRating(@$_REQUEST['id']);
		break;
		
		case 'iconupload':
			if(perm('artcle_edit') || perm('artcle_new'))
			{
				include_once(BASE_DIR . 'admin/class/class.fileupload.php');
				$upload = new Fileupload('/uploads/content/','hidden',@$_REQUEST['divid'],@$_REQUEST['resize']);
			}
		break;
	}
}
?>