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

Documentation generated on Thu, 03 May 2012 15:01:57 +0200 by phpDocumentor 1.4.1