<?php
/**
 * Handle content for publication and workgroup report modules
 * 
 * Default module index file
 * 
 * @package linea21\modules\content
 * @author $Author$ - linea21 <info@linea21.com>
 * @version $Id$ 
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 * 'Content' 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.contents.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':
    $todopage.="add.php";
    break;
  case 'mod':
    $todopage.="mod.php";
    break;
  case 'sup':
    $todopage.="sup.php";
    break;
  case 'det':
    $todopage.="det.php";
    break;
  default:
    redirect_to($mod_inc);
}
include_once(override($todopage, THEME_ADMIN_PATH));
?>