Location: PHPKode > projects > RCS Man on the Web > RCSManager-0.2/main.php
<?php
/** 
 * $Id$
 * $Log$
 */

require("config.php");
header("Pragma : no-cache");

if($disconnect == "true")
     disconnect();

//--------------------
// définir le répertoire courant
if(isset($folder))
  $folder = stripslashes(urldecode($folder));

if(isset($file))
{
  $file = stripslashes(urldecode($file));
  $folder = dirname($file);
  $file = basename($file);
}

if((!isset($folder)) || $folder[0] != "/")
     $folder = "/";

// Vérifier que le repetoire courant est valid.
$err = is_path_is_ok($folder);
if(! ($err == "0 - ok"))
{
  print("<h1>$err: $folder</h1><br>");
  exit();
}

//--------------------
// Cookies & Préférences

// What Style Sheet
if(isset($newsheet))
{
  $sheet = urldecode($newsheet);
  setcookie("sheet", $sheet, time() + 365*24*60*60);
}
if(is_file(CssDIR . "/$sheet"))
     $argument[sheet] = "$sheet"; 
else 
     $argument[sheet] = "default.css";

if(isset($newmode))
{
  $mode = urldecode($newmode);
  setcookie("mode", $mode, time() + 365*24*60*60);
}
if(!isset($mode)) $mode="1";


//--------------------
// Common setting
$argument[mode] = $mode;
$argument[file] = $file;
$argument[revision] = $revision;
$argument[headerfile] = $headerfile;

//--------------------
// What is the Request 
switch($request)
{
 case "checkin":
   $argument[rcsname] = $rcsname;
   $argument[fichier] = $fichier;
   $argument[fichier_name] = stripslashes($fichier_name);
   $argument[fichier_size] = $fichier_size;
   $argument[fichier_type] = $fichier_type;
   $argument[description] = stripslashes($description);
   $argument[log] = stripslashes($log);
   $argument[type] = $type;
  
   $rcs = new RCS($folder);
   $result = $rcs->checkin($argument);
   $argument[result] = $result;
   $frame="Infos";
   $type="checkin";
   break;

 case "checkout":
   $argument[verou] = $verou;
   $argument[destination] = $destination;

   $rcs = new RCS($folder);
   $result = $rcs->checkout($argument);
   $argument[result] = $result;
   $frame="Infos";
   $type="checkout";
   break;
}/*switch($request)*/
$argument[type] = $type;

//--------------------
// Which page to send

if(!preg_match("/^(Index|Banner|Explore|Files|Infos|CheckIn|CheckOut|Reponse)$/", $frame))
{ $frame = "Index"; }
     
switch($frame)
{
 case "Index":
   include(ClsDIR . "/IndexPage.php");
   $page = new IndexPage($folder, TplDIR . "/index.xtpl", $argument);
   $page->out();
   break;

 case "Banner":
   include(ClsDIR . "/BannerPage.php");
   $page = new BannerPage($folder, TplDIR . "/banner.xtpl", $argument);
   $page->out();
   break;
      
 case "Explore":
   include(ClsDIR . "/ExplorePage.php");
   $page = new ExplorePage($folder, TplDIR . "/explore.xtpl", $argument);
   $page->out();
   break;
		
 case "Files":
   include(ClsDIR . "/FilesPage.php");
   $page = new FilesPage($folder, TplDIR . "/files.xtpl", $argument);
   $page->out();
   break;
   
 case "Infos":
   include(ClsDIR . "/InfosPage.php");
   $page = new InfosPage($folder, TplDIR . "/infos.xtpl", $argument);
   $page->out();
   break;
      
 case "CheckIn":
   include(ClsDIR . "/CheckInPage.php");
   $page = new CheckInPage($folder, TplDIR . "/checkin.xtpl", $argument);
   $page->out();
   break;
   
 case "CheckOut":
   include(ClsDIR . "/CheckOutPage.php");
   $page = new CheckOutPage($folder, TplDIR . "/checkout.xtpl", $argument);
   $page->out();
   break;
}/*switch($frame)*/

?>
Return current item: RCS Man on the Web