<?php
/*
Copyright (C) 2008 by oscim   Project lossim  [ 15.09.2009, 09:17:59] @oscim
// kate: replace-trailing-space-save true; space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; word-wrap-marker-color #41C2A4
ENCODE UTF-8
*/
/***************************************************************************
 *   Copyright (C) 2008 by oscim   Project lossim                          *
 *   a@oscim.fr                                                            *
 *       [created : 14.03.2008, 18:59:38] @oscim                           *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
session_start();
error_reporting(E_ALL);
require("../include/lib_ext.php");
require("include/lib/lib.general.php");
var_config_cst($LIB,'');
$page_admin=(isset($_GET['page_admin'])) ?$_GET['page_admin'] : 'admin';
if ($page_admin=='deconnexion'){session_unset(); session_destroy();}
include("include/lib/lib.theme.php");
require("include/block/admin_header.php");
NewFct('verif_session');
if(control_niv_user($page_admin)==false) $page_admin='droit';
if (file_exists(_BO_REP_LIB."lib.".$page_admin.".php"))include(_BO_REP_LIB."lib.".$page_admin.".php");

/* Block header */
switch($page_admin){
  case 'admin':
          include_once(_BO_REP_LIB."lib.creer_une_page.php");
  break;
  case 'module':
          include_once(ADD_PATH_ADMIN."lib_partage/class.file_tbl_php.php");
  break;
  case 'modifier_un_fichier':
          include_once(_BO_REP_LIB."lib.creer_une_page.php");
  break;
  case 'edit_config':
          include_once(ADD_PATH_ADMIN."lib_partage/class.file_tbl_php.php");
          require(_BO_REP_LIB."lib.edit.php");
          $file_conf = array();
          $nom=NewFct('cstr_liste',"config/",'',true) ;
          if (is_array($nom)) $file_conf=array_merge($file_conf,$nom);
          $nom=NewFct('cstr_liste',ADD_PATH_ADMIN."include/config/",'',true) ;
          if (is_array($nom)) $file_conf=array_merge($file_conf,$nom);
          $nom=NewFct('cstr_liste',ADD_PATH_ADMIN."include/",'',true) ;
          if (is_array($nom)) $file_conf=array_merge($file_conf,$nom);
  break;
  case 'edit_file_lang':
          require(_BO_REP_LIB."lib.edit.php");

          $file_conf = array();
          array_push($file_conf, ADD_PATH_ADMIN."include/languages/".$_user_perso_['pref_language'].".php");
          array_push($file_conf, "include/language/".$_user_perso_['pref_language'].".php");
          $nom=NewFct('cstr_liste',"include/language/".$_user_perso_['pref_language']."/",'',true) ;
          $file_conf=array_merge($file_conf,$nom);
  break;
  case 'edit_revision':
          require(_BO_REP_LIB."lib.edit.php");
          $file_conf = $sortie =array();$prev='';
          $nom=NewFct('cstr_liste',ADD_PATH_ADMIN.REP_DATA."bak/",'',true) ;
          if (!empty($nom))$nom=array_reverse($nom);
          if (is_array($nom)) {
          $file_conf=array_merge($file_conf,$nom);
  }
  else array_push($file_conf, "Empty");
  break;
  case 'edit_template':
          require(_BO_REP_LIB."lib.edit.php");
          $file_conf = array();
          $nom=NewFct('cstr_liste',ADD_PATH_ADMIN."template/".NOM_DU_THEME."/",'php',true) ;
          $file_conf=array_merge($file_conf,$nom);

          $file_css = array();
          $nom=NewFct('cstr_liste',ADD_PATH_ADMIN."template/".NOM_DU_THEME."/",'css',true) ;
          $file_css=array_merge($file_css,$nom);

          $file_box = array();
          $nom=NewFct('cstr_liste',ADD_PATH_ADMIN."template/".NOM_DU_THEME."/inc/",'',true) ;
          $file_box=array_merge($file_box,$nom);
          $nom=NewFct('cstr_liste',ADD_PATH_ADMIN."include/box/",'',true) ;
          $file_box=array_merge($file_box,$nom);
  break;
  case 'xmedia':
          require_once (ADD_PATH_ADMIN.'lib_partage/lib.image.php');
  break;
  default:
}
/* Block Content */
switch($page_admin){
  case 'droit':
    print_top();
    require("include/block/application_top.php");
    print 	'<div id="menu_inter"></div><div id="article" ><div id="admin" class="a_box">'
            .'<h3>'.TXT_LIMITE_ACCE_LOGIN.'</h3>'
            .'<p>'.SI_ADMIN_EDIT_STRIC.'</p>'
            .'</div></div></div>';
// 			.'<script type="text/javascript">function redirection(page) {window.location=page;} setTimeout("redirection(\'admin.php\')",10000);</script>';
  break;
  default:
   include("template/".TEMPLATE_ADMIN."/".theme_grp('template').".php");
}

?>