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

Documentation generated on Fri, 16 Oct 2009 09:27:58 +0200 by phpDocumentor 1.4.1