<?php
/**
 * 
 * @file subject_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(EIFR_ROOT . 'admin/mod_article/class_article.php');

$url = 'mod_article/subject_edit.php';
Common::checkAdminFileAuth($url); //check file authority
$clComArticle = new ComArticle($cfgarr_article_type['subject']);

$act = kGet('act');
switch ($act) {
    case 'save_add':
        $extra_session = $clComArticle -> _CLASSNAME . '_' . $cfgarr_article_type['subject'];
        Common::checkSubmit($title, $extra_session);
        $clComArticle -> addRecords();
        break;

    case 'save_edit_base':
        $clComArticle -> editArticleRecords();
        break;

    case 'delete':
        $clComArticle -> recycleArticleRecords();
        break;

    case 'delete_forever':
        $clComArticle -> deleteArticleRecords();
        break;

    case 'save_edit_subject_list_layout':
        $clComArticle -> editSubjectListRelation();
        break;

    case 'edit_subject_list':
    case 'edit_subject_list_layout':
        $layout = $clComArticle -> get_layout_article_subject_list_edit();
        require_once(getAdminTemplatePath('articel_subject_list_edit', $url));
        break;

    case 'add':
    case 'edit_base':
    default :
        $layout = $clComArticle -> get_layout_article_edit();
        require_once(getAdminTemplatePath('subject_edit', $url));
        break;
} 

?>
