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

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