<?php
/**
 * Resources module
 * 
 * Default module index file
 * 
 * @package linea21\modules\resources
 * @author $Author$ - linea21 <info@linea21.com>
 * @version $Id$ 
 * @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 (!class_exists('auth')) {
  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'];

$mod_inc='home'; // default value accessible to all admin users

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 (!$l21auth->hasRight($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:
    redirect_to($mod_inc);
}
include_once(override($todopage, THEME_ADMIN_PATH));
?>