linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file add.php

Documentation is available at add.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage theme
  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. <div id="chemin">
  19.     <ul>
  20.         <li>
  21.             <a href="index.php"><?php echo $GLOBALS['lang']['way']['home']?></a>
  22.         </li>
  23.         <li>
  24.             <a href="<?php echo $rub_link?>"><?php echo $GLOBALS['lang']['menu']['theme']?></a>
  25.         </li>
  26.         <li>
  27.             <span><?php echo formatnavTitle($GLOBALS['lang']['theme']['add'])?></span>
  28.         </li>
  29.     </ul>
  30. </div>
  31. <!--end barre haute -->
  32. <?php
  33. $theme_object new theme;
  34.  
  35. $form_denomination='';
  36. $form_sdtheme=-1;
  37. $form_description_all='';
  38. $form_desc_project='';
  39. $form_desc_dashboard='';
  40. $form_desc_publication='';
  41. $form_desc_news='';
  42. $form_desc_workshop='';
  43. $mask_statut_P="checked=\"checked\"";
  44. $mask_statut_D='';
  45. $mask_desc_ALL="checked=\"checked\"";
  46. $mask_desc_DET='';
  47. $layer_all_style"style=\"display:block;\"";
  48. $layer_det_style"style=\"display:none;\"";
  49.  
  50. if(isset($_POST['enregistrer'])) {
  51.     $data_table=unserialize(urldecode($_POST['data_table']));
  52.     $result=$theme_object->AddTheme($data_table$sql_object);
  53.     $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  54.     if(is_numeric($result)) header("Location: ".$link_confirm);
  55.     else  system_error();
  56. }
  57.  
  58. if(isset($_POST['valider'])) {
  59.     $table[0]=$_POST['denomination'];
  60.     $table[1]=''// anciennement le visuel de thème
  61.     $table[2]=$_POST['sdtheme'];
  62.     if($_POST['description']=='ALL'{
  63.         $table[3]=$_POST['desc_for_all'];
  64.         $table[4]=$_POST['desc_for_all'];
  65.         $table[5]=$_POST['desc_for_all'];
  66.         $table[6]=$_POST['desc_for_all'];
  67.         $table[7]=$_POST['desc_for_all'];
  68.     }
  69.     if($_POST['description']=='DET'{
  70.         if(isset($_POST['desc_det_project'])) $table[3]=$_POST['desc_det_project']else $table[3]='';
  71.         if(isset($_POST['desc_det_dashboard'])) $table[4]=$_POST['desc_det_dashboard']else $table[4]='';
  72.         if(isset($_POST['desc_det_publication'])) $table[5]=$_POST['desc_det_publication']else $table[5]='';
  73.         if(isset($_POST['desc_det_news'])) $table[6]=$_POST['desc_det_news']else $table[6]='';
  74.         if(isset($_POST['desc_det_workshop'])) $table[7]=$_POST['desc_det_workshop']else $table[7]='';
  75.     }
  76.     // Rang des themes par catégorie
  77.     $table[8]=0;
  78.     $table[9]=0;
  79.     $table[10]=0;
  80.     $table[11]=0;
  81.     $table[12]=0;
  82.     $table[13]=$_POST['statut'];
  83.  
  84.     $theme_objectnew theme;
  85.     $integrity=$theme_object->CheckDataIntegrity($table);
  86.  
  87.     if(is_string($integrity)) $format_text='2FIELD';
  88.     else $format_text='2HTML';
  89.     
  90.     $form_denomination=formatText($_POST['denomination']$format_text);
  91.     $form_sdtheme=$_POST['sdtheme'];
  92.     
  93.     if($_POST['description']=='ALL'{
  94.         $form_description_all=stripslashes($_POST['desc_for_all']);
  95.         $layer_all_style"style=\"display:block;\"";
  96.         $layer_det_style"style=\"display:none;\"";
  97.         $mask_desc_ALL="checked=\"checked\"";
  98.         $mask_desc_DET='';
  99.     }
  100.     if($_POST['description']=='DET'{
  101.         if(isset($_POST['desc_det_project'])) $form_desc_project=formatText($_POST['desc_det_project']$format_text);
  102.         if(isset($_POST['desc_det_dashboard'])) $form_desc_dashboard=formatText($_POST['desc_det_dashboard']$format_text);
  103.         if(isset($_POST['desc_det_publication'])) $form_desc_publication=formatText($_POST['desc_det_publication']$format_text);
  104.         if(isset($_POST['desc_det_news'])) $form_desc_news=formatText($_POST['desc_det_news']$format_text);
  105.         if(isset($_POST['desc_det_workshop'])) $form_desc_workshop=formatText($_POST['desc_det_workshop']$format_text);
  106.         $layer_all_style"style=\"display:none;\"";
  107.         $layer_det_style"style=\"display:block;\"";
  108.         $mask_desc_ALL='';
  109.         $mask_desc_DET="checked=\"checked\"";
  110.     }
  111.     if($_POST['statut']=='D'$mask_statut_D="checked=\"checked\""else $mask_statut_D='';
  112.     if($_POST['statut']=='P'$mask_statut_P="checked=\"checked\""else $mask_statut_P='';
  113.     $table=urlencode(serialize($table));
  114. }
  115.  
  116. // preparation affichage detaillé 
  117. $description_detail_form='';
  118. if(defined('MOD_PROJECT')) {
  119.     $description_detail_form.= "<p>\n";
  120.     $description_detail_form.= "<label for=\"desc_det_project\">".$GLOBALS['lang']['theme']['desc_det_project']." : *</label>\n";
  121.     $description_detail_form.= "<textarea id=\"desc_det_project\"  name=\"desc_det_project\" ".AREA_SETTINGS." class=\"largetextfield\" >".$form_desc_project."</textarea>\n";
  122.     $description_detail_form.= "</p>\n";
  123. }
  124. if(defined('MOD_SDI')) {
  125.     $description_detail_form.= "<p>\n";
  126.     $description_detail_form.= "<label for=\"desc_det_dashboard\">".$GLOBALS['lang']['theme']['desc_det_dashboard']." : *</label>\n";
  127.     $description_detail_form.= "<textarea id=\"desc_det_dashboard\"  name=\"desc_det_dashboard\" ".AREA_SETTINGS." class=\"largetextfield\" >".$form_desc_dashboard."</textarea>\n";
  128.     $description_detail_form.= "</p>\n";
  129. }
  130. if(defined('MOD_PUBLICATION')) {
  131.     $description_detail_form.= "<p>\n";
  132.     $description_detail_form.= "<label for=\"desc_det_publication\">".$GLOBALS['lang']['theme']['desc_det_publication']." : *</label>\n";
  133.     $description_detail_form.= "<textarea id=\"desc_det_publication\"  name=\"desc_det_publication\" ".AREA_SETTINGS." class=\"largetextfield\" >".$form_desc_publication."</textarea>\n";
  134.     $description_detail_form.= "</p>\n";
  135. }
  136. if(defined('MOD_NEWS')) {
  137.     $description_detail_form.= "<p>\n";
  138.     $description_detail_form.= "<label for=\"desc_det_news\">".$GLOBALS['lang']['theme']['desc_det_news']." : *</label>\n";
  139.     $description_detail_form.= "<textarea id=\"desc_det_news\"  name=\"desc_det_news\" ".AREA_SETTINGS." class=\"largetextfield\" >".$form_desc_news."</textarea>\n";
  140.     $description_detail_form.= "</p>\n";
  141. }
  142. if(defined('MOD_WORKSHOP')) {
  143.     $description_detail_form.= "<p>\n";
  144.     $description_detail_form.= "<label for=\"desc_det_workshop\">".$GLOBALS['lang']['theme']['desc_det_workshop']." : *</label>\n";
  145.     $description_detail_form.= "<textarea id=\"desc_det_workshop\"  name=\"desc_det_workshop\" ".AREA_SETTINGS." class=\"largetextfield\" >".$form_desc_workshop."</textarea>\n";
  146.     $description_detail_form.= "</p>\n";
  147. }
  148.  
  149.  
  150. include_once("quickicons.php");
  151.  
  152. include_once("../lib/input_helpers.php");
  153. // select-box des SD thèmes
  154. $data=$sql_object->DBSelect($req_listsdtheme);
  155. $select_sdtheme=SDThemeSelectBox($data"sdtheme"$form_sdtheme);
  156.  
  157. ?>
  158.  
  159. <?php
  160. if(!isset($integrity|| is_string($integrity)) {
  161. ?>
  162. <div class="contentcontainer">
  163.         <?php
  164.         include_once($dir."/menurub.php");
  165.         ?>
  166.         <div id="content">
  167.             <?php
  168.             if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  169.             ?>
  170.             <h2><?php echo formatTitleh2($GLOBALS['lang']['theme']['add_title'])?></h2>
  171.             <form id="addtheme" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  172.                 <p>
  173.                 <label for="denomination" ><?php echo $GLOBALS['lang']['theme']['denomination']?> : *</label>
  174.                 <input name="denomination" type="text" class="textfield" id="denomination" maxlength="200" value="<?php echo $form_denomination?>" />
  175.                 </p>
  176.                 <p>
  177.                 <label for="sdtheme" ><?php echo $GLOBALS['lang']['theme']['sdtheme']?> : *</label>
  178.                 <?php echo $select_sdtheme?>
  179.                 </p>
  180.                 <p>
  181.                 <!--
  182.                 <label for="statut_P"><?php echo $GLOBALS['lang']['theme']['statut']?> : *</label>
  183.                 <input name="statut" type="radio" id="statut_P" value="P" <?php echo $mask_statut_P?> /><span class="radio"><?php echo $GLOBALS['lang']['statut']['public']?></span>
  184.                 <input name="statut" type="radio" id="statut_D" value="D" <?php echo $mask_statut_D?> /><span class="radio"><?php echo $GLOBALS['lang']['statut']['draft']?></span>
  185.                 -->
  186.                 <input name="statut" type="hidden" id="statut" value="P" />
  187.                 <br />
  188.                 </p>
  189.                 <p>
  190.                 <label for="description_ALL" ><?php echo $GLOBALS['lang']['theme']['description']?> : *</label><br />
  191.                 <input name="description" class="radioinline" type="radio" id="description_ALL" value="ALL" onclick="ShowthemeDesc('all');" <?php echo $mask_desc_ALL?> /><span class="radio"><?php echo $GLOBALS['lang']['theme']['description_all']?></span><br />
  192.                 <input name="description" class="radioinline" type="radio" id="description_DET" value="DET" onclick="ShowthemeDesc('det');" <?php echo $mask_desc_DET?> /><span class="radio"><?php echo $GLOBALS['lang']['theme']['description_det']?></span>
  193.                 <br />
  194.                 </p>
  195.                 <div>
  196.                 <div id="all" <?php echo $layer_all_style?>>
  197.                     <p>
  198.                     <label for="desc_for_all" ><?php echo $GLOBALS['lang']['theme']['desc_all']?> : *</label>
  199.                     <textarea id="desc_for_all"  name="desc_for_all" <?php echo AREA_SETTINGS?> class="largetextfield" ><?php echo $form_description_all?></textarea>
  200.                     </p>
  201.                 </div>
  202.                 <div id="det" <?php echo $layer_det_style?>>
  203.                     <?php echo $description_detail_form?> 
  204.                 </div>
  205.                 <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  206.                 <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  207.                 <?php echo cancel_button('javascript:history.go(-1);')?>
  208.                 <input name="valider" type="submit" value="<?php echo $GLOBALS['lang']['btn']['valid'?>" class="button" id="valider" />
  209.                 </div>
  210.             </form>
  211.         </div>
  212. <?php include_once($dir."/help.php")?>
  213. </div>
  214. <?php
  215. // Récapitulatif
  216. else    {
  217. $requete=SQL_getoneSDtheme($form_sdtheme);
  218. $data=$sql_object->DBSelect($requete);
  219. $display_sdtheme_name=formatText($data[0]['sdtheme_name'],'2HTML');
  220.  
  221. ?>
  222. <div class="contentcontainer">
  223. <?php
  224. include_once($dir."/menurub.php");
  225. ?>
  226. <div id="content">
  227.             <h2><?php echo formatTitleh2($GLOBALS['lang']['recap']['title'])?></h2>
  228.             <?php
  229.             echo "<dl class=\"dl3\">";
  230.             echo "<dt>".formatText($GLOBALS['lang']['theme']['denomination'],'2HTML')."</dt>";
  231.             echo "<dd>"$form_denomination."</dd>";
  232.             echo "<dt>"$GLOBALS['lang']['theme']['sdtheme']"</dt>";
  233.             echo "<dd>".$display_sdtheme_name."</dd>";
  234.             if($_POST['description']=='ALL'{
  235.                 echo "<dt>".formatText($GLOBALS['lang']['theme']['desc_all']'2HTML')."</dt>";
  236.                 echo "<dd>"$form_description_all."</dd>";
  237.             }
  238.             if($_POST['description']=='DET'{
  239.                 if(defined('MOD_PROJECT')) {
  240.                     echo "<dt>".formatText($GLOBALS['lang']['theme']['desc_det_project'],'2HTML')."</dt>";
  241.                     echo "<dd>"$form_desc_project."</dd>";
  242.                 }
  243.                 if(defined('MOD_SDI')) {
  244.                     echo "<dt>".formatText($GLOBALS['lang']['theme']['desc_det_dashboard']'2HTML')."</dt>";
  245.                     echo "<dd>"$form_desc_dashboard."</dd>";
  246.                 }
  247.                 if(defined('MOD_PUBLICATION')) {
  248.                     echo "<dt>".formatText($GLOBALS['lang']['theme']['desc_det_publication']'2HTML')."</dt>";
  249.                     echo "<dd>"$form_desc_publication."</dd>";
  250.                 }
  251.                 if(defined('MOD_NEWS')) {
  252.                     echo "<dt>".formatText($GLOBALS['lang']['theme']['desc_det_news']'2HTML')."</dt>";
  253.                     echo "<dd>"$form_desc_news."</dd>";
  254.                     }
  255.                 if(defined('MOD_WORKSHOP')) {
  256.                     echo "<dt>".formatText($GLOBALS['lang']['theme']['desc_det_workshop']'2HTML')."</dt>";
  257.                     echo "<dd>"$form_desc_workshop."</dd>";
  258.                     }
  259.                 }
  260.             /** PAS DE GESTION DES STATUTS
  261.             echo "<dt>".$GLOBALS['lang']['divers']['statut'] ."</dt>";
  262.             echo "<dd>". display_statut($_POST['statut']). "</dd>";
  263.             **/
  264.  
  265.             echo "</dl>";
  266.             ?>
  267.             <form id="addscale" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  268.                 <div>
  269.                 <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  270.                 <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  271.                 <input name="data_table" type="hidden" value="<?php echo $table?>" id="data_table" />
  272.                 <?php echo cancel_button('?rub='.$rub.'&amp;todo=list')?>
  273.                 <input name="retour" type="button" value="<?php echo $GLOBALS['lang']['btn']['preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  274.                 <input name="enregistrer" type="submit" value="<?php echo $GLOBALS['lang']['btn']['save'?>" class="button" id="valider" />
  275.                 </div>
  276.             </form>
  277.         </div>
  278.     <?php include_once($dir."/help.php")?>
  279. </div>
  280. <?php
  281. }
  282. ?>

Documentation generated on Sat, 08 Nov 2008 14:50:33 +0100 by phpDocumentor 1.4.1