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

Documentation generated on Thu, 03 May 2012 15:06:24 +0200 by phpDocumentor 1.4.1