<?php
/**
 * 
 * @file template_edit.php
 * @copyright (c) 2005 - 2007 eifr.com
 * @license http://www.gnu.org/copyleft/gpl.html gnu/gpl
 * eifr is free software
 */

require_once('../../includes/inc_admin.php');
require_once('class_template.php');

$url = 'mod_template/template_edit.php';
Common::checkAdminFileAuth($url); //check file authority
$clComTemplate = new ComTemplate();

$act = '';
if (isset($_GET['act'])) $act = $_GET['act'];

switch ($act) {
    case 'up':
    case 'down':
        $clComTemplate -> orderbyRecords_layout();
        break;
    case 'save':
        $selectid = '';
        if (isset($_POST['selectValue'])) $selectid = $_POST['selectValue'];
        if ($selectid == '') {
            $clComTemplate -> addRecords();
        } else {
            $clComTemplate -> editRecords();
        } 
        break;
    case 'delete_layout':
        $clComTemplate -> deleteRecords_layout();
        break;
    case 'save_add_layout':
        $clComTemplate -> addRecords_layout();
        break;
    case 'save_edit_layout':
        $clComTemplate -> editRecords_layout();
        break;
    case 'edit':
        $clComTemplate -> layout_template_edit();
        break;
    case 'edit_layout':
        $clComTemplate -> layout_template_layout_edit();
        break;
    case 'add_layout':
        $clComTemplate -> layout_template_layout_edit();
        break;
    case 'add':
    default :
        $clComTemplate -> layout_template_add();
        break;
} 

?>