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

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