<?php
/**
 * @package linea21.modules
 * @subpackage workshop
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

//////////// Check Droits utilisateur ////////////
if (!$l21auth->hasRight('workshop') && !$l21auth->isSuperAdmin())
	ReloadIndex('admin');
////////////

include_once($dir."/".SQL.".inc.php");
include_once('../class/class.workshop.php');
include_once('../class/class.workshop_report.php');
include_once('../class/class.calendar.php');
include_once('../class/class.workshop_com.php');


function afflinkbar($todo, $id, $lang){

  $link_details="<a href=\"index.php?rub=workshop&amp;todo=det&amp;id=".$id."\" title=\""._t('workshop','det')."\">"._t('workshop','det')."</a>";
  $link_cal="<a href=\"index.php?rub=workshop&amp;todo=list_cal&amp;id=".$id."\" title=\""._t('workshop','list_cal')."\">"._t('workshop','list_cal')."</a>";
  $link_com="<a href=\"index.php?rub=workshop&amp;todo=list_com&amp;id=".$id."\" title=\""._t('workshop','list_com')."\">"._t('workshop','list_com')."</a>";
  $link_doc='<a id="browse_files" href="../library/access.php?langCode='.U_L.'&amp;expandedFolder=workgroups/'.$id.'/" title="'. _t('filemanager','browse').'">'._t('workshop','list_doc').'</a>';
  $liste=$link_details." | ".$link_cal." | ".$link_com." | ".$link_doc;
  echo "<div class=\"mod_link\">";
  echo $liste;
  echo "</div><br class=\"brendstep\" />";

}

$todopage=$dir."/";
switch ($todo)
{
  case 'add':
    $todopage.="add.php";
    break;
  case 'mod':
    $todopage.="mod.php";
    break;
  case 'mod_p':
    $todopage.="modpass.php";
    break;
  case 'sup':
    $todopage.="sup.php";
    break;
  case 'list':
    $todopage.="list.php";
    break;
  case 'det':
    $todopage.="det.php";
    break;
  case 'sup_u':
    $todopage.="sup_u.php";
    break;
  case 'add_u':
    $todopage.="add_u.php";
    break;
  case 'add_cal':
    $todopage.="add_cal.php";
    break;
  case 'sup_cal':
    $todopage.="sup_cal.php";
    break;
  case 'mod_cal':
    $todopage.="mod_cal.php";
    break;
  case 'list_cal':
    $todopage.="list_cal.php";
    break;
  case 'list_com':
    $todopage.="list_com.php";
    break;
  case 'det_com':
    $todopage.="det_com.php";
    break;
  case 'sup_com':
    $todopage.="sup_com.php";
    break;
  case 'lock_com':
    $todopage.="lock_com.php";
    break;
  case 'mod_com':
    $todopage.="mod_com.php";
    break;
  case 'add_com':
    $todopage.="add_com.php";
    break;
  default:
    $todopage.="list.php";
}
include_once(override($todopage, THEME_ADMIN_PATH));
?>
<script type="text/javascript">
	$(document).ready(function(){

		$("#browse_files").colorbox({iframe:true, innerWidth:"80%", innerHeight:"80%"});
		/**
		@todo remove - not used anymore
		$("#browse_files").click(function() {
			 OpenServerBrowser($('#browse_files').attr('href'),screen.width * 0.7, screen.height * 0.7 );
			 return false;
			});
				*/

	});
 </script>