phpDocumentor lodel-source-lodel-edition
[ class tree: lodel-source-lodel-edition ] [ index: lodel-source-lodel-edition ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3.  * Fichier racine de lodel/edition
  4.  *
  5.  * PHP versions 4 et 5
  6.  *
  7.  * LODEL - Logiciel d'Edition ELectronique.
  8.  *
  9.  * Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos
  10.  * Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
  11.  * Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
  12.  * Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  13.  * Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  14.  * Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  15.  *
  16.  * Home page: http://www.lodel.org
  17.  *
  18.  * E-Mail: lodel@lodel.org
  19.  *
  20.  * All Rights Reserved
  21.  *
  22.  * This program is free software; you can redistribute it and/or modify
  23.  * it under the terms of the GNU General Public License as published by
  24.  * the Free Software Foundation; either version 2 of the License, or
  25.  * (at your option) any later version.
  26.  *
  27.  * This program is distributed in the hope that it will be useful,
  28.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  29.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  30.  * GNU General Public License for more details.
  31.  *
  32.  * You should have received a copy of the GNU General Public License
  33.  * along with this program; if not, write to the Free Software
  34.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  35.  *
  36.  * @author Ghislain Picard
  37.  * @author Jean Lamy
  38.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  39.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  40.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  41.  * @licence http://www.gnu.org/copyleft/gpl.html
  42.  * @version CVS:$Id:
  43.  * @package lodel/source/lodel/edition
  44.  */
  45.  
  46.  
  47.  
  48. include ('siteconfig.php');
  49. require_once ('auth.php');
  50.  
  51. // Authentification HTTP pour les flux RSS coté édition (flux du tableau de bord) : Cf. auth.php
  52. if ($_GET['page'== 'backend' && $_GET['format'{
  53.     authenticate(LEVEL_VISITOR'HTTP');
  54.     }
  55. else {
  56.     }
  57.  
  58. if (!$_GET['do'&& !$_POST['do'&& !$_GET['lo'&& !$_POST['lo']{
  59.     if ($lodeluser['rights'>= LEVEL_ADMIN{
  60.         require_once ('entitiesfunc.php');
  61.         cleanEntities()// nettoyage de la table entities (supprime les entites à -64 modifiées il y a + de 12h)
  62.     }
  63.     recordurl();
  64.     $context['id'$id intval($_GET['id']);
  65.     require_once 'view.php';
  66.     $view &View::getView();
  67.  
  68.     if ($view->renderIfCacheIsValid()) 
  69.         return;
  70.     }
  71.     if ($id{
  72.         do {
  73.             $row $db->getRow(lq("SELECT tpledition,idparent,idtype FROM #_entitiestypesjoin_ WHERE #_TP_entities.id='$id'"));
  74.             if ($row === false{
  75.                 dberror();
  76.             }
  77.             if (!$row{
  78.                 header ("Location: not-found.html");
  79.                 return;
  80.             }
  81.             $base              $row['tpledition'];
  82.             $idparent          $row['idparent'];
  83.             $context['idtype'=$row['idtype'];
  84.             if (!$base{
  85.                 $context['id'$id $idparent;
  86.             }
  87.         while (!$base && $idparent);
  88. else {
  89.         if ($_GET['page']// call a special page (and template)
  90.             $base $_GET['page'];
  91.             if (strlen($base64 || preg_match("/[^a-zA-Z0-9_\/-]/"$base)) {
  92.                 die("invalid page");
  93.             }
  94.         else {
  95.             $base 'edition';
  96.         }
  97.     }
  98.     $view->renderCached($context$base);
  99.     return;
  100. else {
  101.     
  102.     require_once 'controler.php';
  103.     // automatic logic
  104.     $do $_GET['do'$_GET['do'$_POST['do'];
  105.     $lo $_GET['lo'$_GET['lo'$_POST['lo'];
  106.     
  107.     if(!$lo{
  108.         switch ($do// Detection automatique de la logique en fonction de l'action
  109.             case 'move':
  110.             case 'preparemove':
  111.             case 'changestatus':
  112.             case 'download':
  113.                 $lo 'entities_advanced';
  114.                 break;
  115.             case 'cleanIndex':
  116.             case 'deleteIndex':
  117.             case 'addIndex':
  118.                 $lo 'entities_index';
  119.                 break;
  120.             case 'view':
  121.             case 'edit':
  122.                 $lo 'entities_edition';
  123.                 break;
  124.             case 'import':
  125.                 $lo 'entities_import';
  126.                 break;
  127.             default :
  128.                 $lo 'entities';
  129.         }
  130.     }
  131.     
  132.     $Controler new controler(array('entities''entities_advanced''entities_edition''entities_import''entities_index''filebrowser',    'tasks''xml''users')$lo);
  133. }
  134.  
  135. ?>

Documentation generated on Thu, 19 Jun 2008 05:07:55 +0200 by phpDocumentor 1.4.0a2