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 level
  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. ////////////
  17.  
  18. if (isset($_GET['id']))    $id=$_GET['id'];
  19. if (isset($_POST['id'])) $id=$_POST['id'];
  20.  
  21. $level_objectnew level;
  22.  
  23. $mask_statut_P='';
  24. $mask_statut_D='';
  25.  
  26. $requete=SQL_getonelevel($id);
  27. $data=$sql_object->DBSelect($requete'OBJECT');
  28. $display_title=formatText($data[0]->level_name'2HTML');
  29.  
  30. $form_denomination=formatText($data[0]->level_name'2FIELD');
  31. $form_description=formatText($data[0]->level_description'2FIELD');
  32. $form_comment=formatText($data[0]->level_comment'2FIELD');
  33. $form_visual_identity=$data[0]->level_visual_identity;
  34.  
  35. if(!empty($form_visual_identity)) {
  36.   $complete_uri="../".$data[0]->level_visual_identity;
  37.   $complete_uri=EnlargeImage($complete_uri);
  38. else $complete_uri=_t('divers','novisu');
  39.  
  40. $form_statut_level=$data[0]->level_statut;
  41. $form_range=$data[0]->level_range;
  42.  
  43.  
  44. if(isset($_POST['valider'])) {
  45.   $table[0]=$_POST['denomination'];
  46.   $table[1]=$_POST['description'];
  47.   $table[2]=$_POST['com_level'];
  48.   $table[3]=$form_visual_identity;
  49.   $table[4]=$form_range;
  50.   $table[5]=$_POST['statut'];
  51.  
  52.   $integrity=$level_object->CheckDataIntegrity($table);
  53.   if(is_string($integrity)) $format_text='2FIELD'else $format_text='HTML';
  54.  
  55.   $form_denomination=formatText($_POST['denomination']$format_text);
  56.   $form_description=formatText($_POST['description']$format_text);
  57.   $form_comment=formatText($_POST['com_level']$format_text);
  58.   $form_statut_level=$_POST['statut'];
  59.  
  60.   $table=urlencode(serialize($table));
  61. }
  62.  
  63. if(isset($_POST['enregistrer'])) {
  64.   include_once('../class/system/class.upload.php');
  65.   $upload_objectnew upload;
  66.   $data_table=unserialize(urldecode($_POST['data_table']));
  67.   $result=$level_object->ModifyLevel($id$data_table$sql_object);
  68.   $visual_uri="../".$data_table[3];
  69.   $result_rename=$upload_object->Archivefile($visual_uri);
  70.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&id=".$id;
  71.   if($resultheader("Location: ".$link_confirm);
  72.   else  system_error();
  73. }
  74.  
  75.  
  76. if($form_statut_level=='P'$mask_statut_P=' checked="checked"';
  77. if($form_statut_level=='D'$mask_statut_D=' checked="checked"';
  78. ?>
  79. <div id="chemin">
  80. <ul>
  81.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a>
  82.     </li>
  83.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  84.         class="chemin_rub"><?php echo _t('menu','level')?></a></li>
  85.     <li><span><?php echo formatNavTitle(_t('level','mod').' : '.$display_title)?></span>
  86.     </li>
  87. </ul>
  88. </div>
  89. <!--end barre haute -->
  90. <?php
  91. include_once(THEME_ADMIN_PATH."quickicons.php");
  92. // select box statut
  93. $select_statut="<!--";
  94. $select_statut.="<label for=\"statut_P\" >"._t('divers','statut'." : *</label>\n";
  95. $select_statut.="<input type=\"radio\" name=\"statut\" id=\"statut_P\" value=\"P\"".$mask_statut_P." /><span class=\"radio\">"._t('statut','public')."</span>\n";
  96. $select_statut.="<input type=\"radio\" name=\"statut\" id=\"statut_D\" value=\"D\"".$mask_statut_D." /><span class=\"radio\">"._t('statut','draft')."</span>\n";
  97. $select_statut.='-->';
  98. $select_statut.='<input name="statut" type="hidden" id="statut" value="P" />'.END_LINE;
  99.  
  100. if(!isset($integrity|| is_string($integrity)) {
  101.   ?>
  102. <div class="contentcontainer"><?php
  103. include_once($dir."/menurub.php");
  104. ?>
  105. <div id="content"><?php
  106. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  107. ?>
  108. <h2><?php echo formatTitleh2($display_title)?></h2>
  109. <form id="modlevel" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  110.     method="post">
  111. <p><label for="denomination"><?php echo _t('level','denomination')?> :
  112. *</label> <input name="denomination" type="text" id="denomination"
  113.     maxlength="200" value="<?php echo $form_denomination?>"
  114.     class="textfield" /></p>
  115. <p><label for="description"><?php echo _t('level','description')?> : </label>
  116. <textarea id="description" name="description" class="largetextfield"
  117. <?php echo AREA_SETTINGS?>><?php echo $form_description?></textarea>
  118. <br />
  119. </p>
  120. <p><label for="com_level"><?php echo _t('level','comment')?> : </label>
  121. <textarea id="com_level" name="com_level" class="largetextfield"
  122. <?php echo AREA_SETTINGS?>><?php echo $form_comment?></textarea> <br />
  123. </p>
  124. <p><?php echo $select_statut?></p>
  125. <p><label for="img"><?php echo _t('level','visual_identity')?> :</label>
  126. <?php echo $complete_uri?></p>
  127. <div><input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  128. <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  129. <?php echo cancel_button('javascript:history.go(-1);')?> <input
  130.     name="todo" type="hidden" value="<?php echo $todo?>" id="todo" /> <input
  131.     name="valider" type="submit" value="<?php echo _t('btn','valid'?>"
  132.     class="button" id="valider" /></div>
  133. </form>
  134. </div>
  135. <?php include_once($dir."/help.php")?></div>
  136. <?php
  137. // Récapitulatif
  138. else    {
  139.  
  140.  
  141.   ?>
  142. <div class="contentcontainer"><?php
  143. include_once($dir."/menurub.php");
  144. ?>
  145. <div id="content">
  146. <h2><?php echo formatTitleh2(_t('recap','title'))?></h2>
  147. <dl class="dl3">
  148.     <dt><?php echo _t('level','denomination')?> :</dt>
  149.     <dd><?php echo $form_denomination?><br />
  150.     </dd>
  151.  
  152.     <dt><?php echo _t('level','description')?> :</dt>
  153.     <dd><?php echo empty_none($form_description)?><br />
  154.     </dd>
  155.  
  156.     <dt><?php echo _t('level','comment')?> :</dt>
  157.     <dd><?php echo empty_none($form_comment)?><br />
  158.     </dd>
  159.     <!--
  160.                 <dt><?php echo _t('divers','statut')?> : </dt>
  161.                 <dd><?php echo display_statut($form_statut_level)?><br /></dd>        
  162.                 -->
  163.     <dt><?php echo _t('level','visual_identity')?></dt>
  164.     <dd><?php echo $complete_uri?><br />
  165.     </dd>
  166.  
  167. </dl>
  168. <form id="modlevel" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  169.     method="post">
  170. <div><input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  171. <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  172. <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  173. <input name="data_table" type="hidden" value="<?php echo $table?>"
  174.     id="data_table" /> <?php echo cancel_button('?rub=level&amp;todo=list')?>
  175. <input name="retour" type="button"
  176.     value="<?php echo _t('btn','preview'?>" class="button" id="retour"
  177.     onclick="history.go(-1);" /> <input name="enregistrer" type="submit"
  178.     value="<?php echo _t('btn','save'?>" class="button" id="valider" /></div>
  179. </form>
  180. </div>
  181. <?php include_once($dir."/help.php")?></div>
  182. <?php
  183. }
  184. ?>

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