<?php
/**
 * 
 * @file article_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/redirect_edit.php';
Common::checkAdminFileAuth($url); //check file authority
$clComArticle = new ComArticle($cfgarr_article_type['redirect']);

$act = kGet('act');
switch ($act) {
    case 'save_add':
        $extra_session = $clComArticle -> _CLASSNAME . '_' . $cfgarr_article_type['redirect'];
        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 'add':
    case 'edit_base':
    default :
        $layout = $clComArticle -> get_layout_article_edit();
        require_once(getAdminTemplatePath('redirect_edit', $url));
        break;
} 

?>
