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. $hidden=false//variable pour cacher ou non les champs de formulaire
  25. $link_mod=$rub_link."&amp;todo=mod&amp;type=";
  26. $updatable=true//le formulaire est en modification ou en visualisation
  27.  
  28. if (isset($_REQUEST['type'])) $type=$_REQUEST['type'];
  29.  
  30. if(isset($_POST['valider'])) {
  31.   $updatable=false;
  32.   $hidden=true;
  33.   $l21config->setParams($_POST);
  34. }
  35. if(isset($_POST['enregistrer'])) {
  36.  
  37.     // we prepare values with new inputs
  38.   $l21config->setParams($_POST);
  39.   
  40.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  41.   
  42.   //ok on écrit les paramètres en fichiers
  43.   if($l21config->writeReleaseParams()) header("Location: ".$link_confirm);
  44.   else system_error();
  45. }
  46. ?>
  47.  
  48. <div id="chemin">
  49. <ul>
  50.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a></li>
  51.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','system')?></a></li>
  52.     <li><span><?php echo _t('system','mod'?></span></li>
  53. </ul>
  54. </div>
  55.  
  56. <!--end barre haute -->
  57. <?php
  58. include_once(THEME_ADMIN_PATH."quickicons.php");
  59. ?>
  60. <div class="contentcontainer">
  61.   <?php include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));?>
  62.   <div id="content">
  63.     <h2><?php echo _t('system','mod')?></h2>
  64.     <form id="<?php echo $type?>" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  65.       <?php
  66.         switch ($type)
  67.         {
  68.           case 'config':
  69.             echo $l21config->getReleaseParams($updatable,$hidden);
  70.             break;
  71.           case 'database':
  72.             echo $l21config->getDatabaseParams($updatable,$hidden);
  73.             break;
  74.           case 'theme':
  75.             echo $l21config->getThemeParams($updatable,$hidden);
  76.             break;
  77.           default:
  78.             exit('no way');
  79.         }
  80.       ?>
  81.       <div>
  82.         <input name="type" type="hidden" value="<?php echo $type?>" id="type" />
  83.         <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  84.         <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  85.         <?php
  86.         if(!isset($_POST['valider']&& !isset($_POST['enregistrer'])){
  87.           echo cancel_button('javascript:history.go(-1);');
  88.         ?>
  89.         <input name="valider" type="submit" value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  90.         <?php }
  91.         else if(isset($_POST['valider'])){
  92.         ?>
  93.         <?php echo cancel_button('?rub=system&amp;todo=list')?>
  94.           <input name="retour" type="button" value="<?php echo _t('btn','preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  95.           <input name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>" class="button" id="enregistrer" />
  96.         <?php ?>
  97.        </div>
  98.     </form>
  99.   </div>
  100.   <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?>
  101. </div>

Documentation generated on Thu, 20 Mar 2014 16:48:57 +0100 by phpDocumentor 1.4.1