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

if(@file_exists(BASE_DIR . 'admin/class/class.gallery.php'))
{

	if(!perm('templates'))
	{
		no_perm();
	} else {
		include_once(BASE_DIR . 'admin/class/class.templates.php');
		$templates = new Templates;
		
		$_REQUEST['sub'] = (isset($_REQUEST['sub']) && !empty($_REQUEST['sub'])) ? $_REQUEST['sub'] : 'showall';
		switch($_REQUEST['sub'])
		{
			case 'showall':
				$templates->ShowAll();
			break;
			
			case 'showfiles':
				$templates->ShowFiles();
			break;
		}
	}
} else {
	notFound();
}
?>