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>
  48.     </li>
  49.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  50.         class="chemin_rub"><?php echo _t('menu','system')?></a></li>
  51.     <li><span><?php echo _t('system','mod'?></span></li>
  52. </ul>
  53. </div>
  54.  
  55. <!--end barre haute -->
  56. <?php
  57. include_once(THEME_ADMIN_PATH."quickicons.php");
  58. ?>
  59. <div class="contentcontainer"><?php include_once($dir "/menurub.php");?>
  60. <div id="content">
  61. <h2><?php echo _t('system','mod')?></h2>
  62. <form id="<?php echo $type?>"
  63.     action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post"
  64.     <?if(isset($_POST['valider'])) {?>
  65.     onsubmit="if(!confirm('<?php echo _t('system','confirm_mod_js')?>')) return false;"
  66.     <?}?>><?php
  67.     switch ($type)
  68.     {
  69.       case 'define_release':
  70.         echo $config_file->getReleaseParams($updatable,$hidden);
  71.         break;
  72.       case 'define_db':
  73.         echo $config_file->getDbParams($updatable,$hidden);
  74.         break;
  75.       case 'theme':
  76.         echo $config_file->getThemeParams($updatable,$hidden);
  77.         break;
  78.       default:
  79.         echo $config_file->getReleaseParams($updatable,$hidden);
  80.     }
  81.     ?>
  82. <div><input name="type" type="hidden" value="<?php echo $type?>"
  83.     id="type" /> <input name="rub" type="hidden"
  84.     value="<?php echo $rub?>" id="rub" /> <input name="todo"
  85.     type="hidden" value="<?php echo $todo?>" id="todo" /> <?php 
  86.     if(!isset($_POST['valider']&& !isset($_POST['enregistrer'])){
  87.       echo cancel_button('javascript:history.go(-1);');
  88.       ?> <input name="valider" type="submit"
  89.     value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  90.       <?php }
  91.       else if(isset($_POST['valider'])){?> <?php echo cancel_button('?rub=system&amp;todo=list')?>
  92. <input name="retour" type="button"
  93.     value="<?php echo _t('btn','preview'?>" class="button" id="retour"
  94.     onclick="history.go(-1);" /> <input name="enregistrer" type="submit"
  95.     value="<?php echo _t('btn','save'?>" class="button" id="enregistrer" />
  96.       <?}?></div>
  97. </form>
  98. </div>
  99.       <?php include_once($dir "/help.php");?></div>

Documentation generated on Fri, 01 Apr 2011 09:33:13 +0200 by phpDocumentor 1.4.1