noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
user_pref.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 /*! \file
00022  * \brief Page for the personal preference (theme, password,...)
00023  */
00024 require_once '../include/constant.php';
00025 include_once ("ac_common.php");
00026 require_once('class_database.php');
00027 /* Admin. Dossier */
00028 $Rep=new Database();
00029 include_once ("class_user.php");
00030 require_once('class_dossier.php');
00031 
00032 /* if the dossier is not set then we have to connect to the
00033  * account_repository database
00034  */
00035 
00036 if ( isset ($_REQUEST['gDossier']))
00037 {
00038     $cn=new Database($_REQUEST['gDossier']);
00039 }
00040 else
00041 {
00042     $cn=new Database();
00043 }
00044 
00045 global $g_user;
00046 $g_user=new User($cn);
00047 
00048 // Met a jour le theme utilisateur (style)
00049 if ( isset ( $_POST['style_user']) )
00050 {
00051     $g_user->update_global_pref('THEME',$_POST['style_user']);
00052     $_SESSION['g_theme']=$_POST['style_user'];
00053 
00054 }
00055 // Update the language
00056 if ( isset($_POST ['lang']))
00057 {
00058     $g_user->update_global_pref('LANG',$_POST['lang']);
00059     $_SESSION['g_lang']=$_POST['lang'];
00060 }
00061 
00062 html_page_start($_SESSION['g_theme']);
00063 
00064 // Met a jour le pagesize
00065 if ( isset ( $_POST['p_size']) )
00066 {
00067     $g_user->update_global_pref('PAGESIZE',$_POST['p_size']);
00068     $_SESSION['g_pagesize']=$_POST['p_size'];
00069 
00070 }
00071 
00072 // Topmenu
00073 //   not used for the moment
00074 //---------------------------------------------------------------------------
00075 // Here we put all the changes
00076 //---------------------------------------------------------------------------
00077 
00078 if ( isset ($_POST['val']) )
00079 {
00080     // Change the mini report
00081     if ( isset ($_POST['minirap']))   $g_user->set_mini_report($_POST['minirap']);
00082 }
00083 // show the top menu depending of the use_style
00084 // comta style
00085 
00086 include_once ("user_menu.php");
00087 echo "<h2 class=\"info\">"._('Préférence')."</h2>";
00088 
00089 require_once("pref.inc.php");
00090 html_page_stop();
00091 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations