linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file mod.php

Documentation is available at mod.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage system
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!class_exists('auth')) {
  13.   include_once ("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!$l21auth->isSuperAdmin()) ReloadIndex('admin');
  20. ////////////
  21.  
  22. include_once('../lib/input_helpers.php');
  23.  
  24. $config_file new config_file;
  25.  
  26. $hidden=false//variable pour cacher ou non les champs de formulaire
  27. $link_mod=$rub_link."&amp;todo=mod&amp;type=";
  28. $updatable=true//le formulaire est en modification ou en visualisation
  29.  
  30. if (isset($_GET['type']))    $type=$_GET['type'];
  31. if (isset($_POST['type'])) $type=$_POST['type'];
  32.  
  33. if(isset($_POST['valider'])) {
  34.   $updatable=false;
  35.   $hidden=true;
  36.   $config_file->setParams($type,$_POST);
  37. }
  38. if(isset($_POST['enregistrer'])) {
  39.  
  40.   $config_file->setParams($type,$_POST);
  41.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  42.   //ok on écrit les paramètres en fichiers
  43.   if($type == 'define_release' || $type == 'theme'$result=$config_file->writeReleaseParams();
  44.   else if($type == 'define_db'$result=$config_file->writeDbParams();
  45.   if($resultheader("Location: ".$link_confirm);
  46.   else  system_error();
  47. }
  48. ?>
  49.  
  50. <div id="chemin">
  51. <ul>
  52.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a></li>
  53.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','system')?></a></li>
  54.     <li><span><?php echo _t('system','mod'?></span></li>
  55. </ul>
  56. </div>
  57.  
  58. <!--end barre haute -->
  59. <?php
  60. include_once(THEME_ADMIN_PATH."quickicons.php");
  61. ?>
  62. <div class="contentcontainer">
  63.   <?php include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));?>
  64.   <div id="content">
  65.     <h2><?php echo _t('system','mod')?></h2>
  66.     <form id="<?php echo $type?>" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  67.       <?php
  68.         switch ($type)
  69.         {
  70.           case 'define_release':
  71.             echo $config_file->getReleaseParams($updatable,$hidden);
  72.             break;
  73.           case 'define_db':
  74.             echo $config_file->getDbParams($updatable,$hidden);
  75.             break;
  76.           case 'theme':
  77.             echo $config_file->getThemeParams($updatable,$hidden);
  78.             break;
  79.           default:
  80.             echo $config_file->getReleaseParams($updatable,$hidden);
  81.         }
  82.       ?>
  83.       <div>
  84.         <input name="type" type="hidden" value="<?php echo $type?>" id="type" />
  85.         <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  86.         <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  87.         <?php
  88.         if(!isset($_POST['valider']&& !isset($_POST['enregistrer'])){
  89.           echo cancel_button('javascript:history.go(-1);');
  90.         ?>
  91.         <input name="valider" type="submit" value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  92.         <?php }
  93.         else if(isset($_POST['valider'])){
  94.         ?>
  95.         <?php echo cancel_button('?rub=system&amp;todo=list')?>
  96.           <input name="retour" type="button" value="<?php echo _t('btn','preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  97.           <input name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>" class="button" id="enregistrer" />
  98.         <?php ?>
  99.        </div>
  100.     </form>
  101.   </div>
  102.   <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?>
  103. </div>

Documentation generated on Mon, 08 Apr 2013 18:15:47 +0200 by phpDocumentor 1.4.1