<?php
/**
 * @package linea21.modules
 * @subpackage resources
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 * 'Resource' module is used by 'Publication' and 'Workshop' modules
 */

//////////// Check Inclusion de pages ////////////
if (!function_exists('AuthenthificationProcess')) {
    include_once("../lib/lib_common.php");
    ReloadIndex('admin');
} 
////////////

include_once('../class/class.resources.php');

if(isset($_POST['type']))	$type=$_POST['type'];
if(isset($_GET['type']))	$type=$_GET['type'];

if(isset($_POST['parent']))	$parent=$_POST['parent'];
if(isset($_GET['parent']))	$parent=$_GET['parent'];

if(isset($_POST['res']))	$res=$_POST['res'];
if(isset($_GET['res']))		$res=$_GET['res'];

if($type=='P')  {
	$mod_inc='publication';
	$rub_link='?rub='.$mod_inc;
	$cancel_link='index.php?rub=publication&amp;todo=det&amp;id='.$parent;
}
if($type=='W') {
	$mod_inc='workshop';
	$rub_link='?rub='.$mod_inc;
	$cancel_link='index.php?rub=workshoprep&amp;todo=det&amp;id='.$parent;
}

//////////// Check Droits utilisateur ////////////
if (!HaveRight($mod_inc)) ReloadIndex('admin');
///////////
 
$todopage=$dir."/";
	switch ($todo) 
	{
		case 'add_l':
	    $todopage.="add_link.php";
		break;
		case 'add_m':
	    $todopage.="add_multi.php";
		break;
		case 'add_b':
	    $todopage.="add_biblio.php";
		break;
		case 'mod_l':
		$todopage.="mod_link.php";
		break;
		case 'mod_m':
		$todopage.="mod_multi.php";
		break;
		case 'mod_b':
		$todopage.="mod_biblio.php";
		break;
		case 'sup':
	    $todopage.="sup.php";
		break;
		default:
		$todopage.="add.php";			
	}
include_once($todopage);    
?>