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. $config_file new config_file;
  17. $config_file->__construct($GLOBALS['authorized_release_sections'],$GLOBALS['authorized_db_sections'],$GLOBALS['authorized_theme_sections']);
  18. $config_file->loadParams();
  19. $hidden=false//variable pour cacher ou non les champs de formulaire
  20. $link_mod=$rub_link."&amp;todo=mod&amp;type=";
  21. $updatable=true;//le formulaire est en modification ou en visualisation
  22.  
  23. if (isset($_GET['type']))    $type=$_GET['type'];
  24. if (isset($_POST['type'])) $type=$_POST['type'];
  25.  
  26. if(isset($_POST['valider'])) {
  27.     $updatable=false;
  28.     $hidden=true;
  29.     $config_file->setParams($type,$_POST);
  30. }
  31. if(isset($_POST['enregistrer'])) {
  32.     
  33.     $config_file->setParams($type,$_POST);
  34.     $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  35.     //ok on écrit les paramètres en fichiers
  36.     if($type == 'define_release' || $type == 'theme'$result=$config_file->writeReleaseParams();
  37.     else if($type == 'define_db'$result=$config_file->writeDbParams();
  38.     if($resultheader("Location: ".$link_confirm);
  39.     else  system_error();
  40. }
  41.  
  42. ?>
  43.  
  44. <div id="chemin">
  45.     <ul>
  46.         <li>
  47.             <a href="index.php"><? echo $GLOBALS['lang']['way']['home'?></a>
  48.         </li>
  49.         <li>
  50.             <a href="<?php echo $rub_link?>"><? echo $GLOBALS['lang']['menu']['system']?></a>
  51.         </li>
  52.         <li>
  53.             <span><? echo $GLOBALS['lang']['system']['mod'?></span>
  54.         </li>
  55.     </ul>
  56. </div>
  57.  
  58.   <!--end barre haute -->
  59. <?php
  60. include_once ("quickicons.php");
  61. ?>
  62. <div class="contentcontainer">
  63. <?php include_once($dir "/menurub.php");?>
  64. <div id="content">
  65. <h2><? echo $GLOBALS['lang']['system']['mod']?></h2>
  66. <form id="<? echo $type?>" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post" <?if(isset($_POST['valider'])) {?>onsubmit="if(!confirm('<? echo $GLOBALS['lang']['system']['confirm_mod_js']?>')) return false;"<?}?>>
  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.                 
  88.     <?php 
  89.     if(!isset($_POST['valider']&& !isset($_POST['enregistrer'])){
  90.         echo cancel_button('javascript:history.go(-1);')
  91.     ?>
  92.     <input name="valider" type="submit" value="<? echo $GLOBALS['lang']['btn']['valid'?>" class="button" id="valider" />
  93.     <? 
  94.     else if(isset($_POST['valider'])){?>
  95.         <?php echo cancel_button('?rub=system&amp;todo=list')?>
  96.         <input name="retour" type="button" value="<? echo $GLOBALS['lang']['btn']['preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  97.         <input name="enregistrer" type="submit" value="<? echo $GLOBALS['lang']['btn']['save'?>" class="button" id="enregistrer" />        
  98.     <?}?>
  99.     </div>
  100. </form>
  101. </div>
  102. <?php include_once($dir "/help.php");?>
  103. </div>

Documentation generated on Sat, 08 Nov 2008 14:53:26 +0100 by phpDocumentor 1.4.1