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

Documentation generated on Fri, 01 Apr 2011 09:27:14 +0200 by phpDocumentor 1.4.1