linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file add_multi.php

Documentation is available at add_multi.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage resources
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  'Resource' module is used by 'Publication' and 'Workshop' modules
  10.  */
  11.  
  12. //////////// Check Inclusion de pages ////////////
  13. if (!function_exists('AuthenthificationProcess')) {
  14.   include_once("../lib/lib_common.php");
  15.   ReloadIndex('admin');
  16. }
  17. ////////////
  18.  
  19. $complete_type=strtoupper($mod_inc);
  20. if($type=='P'{
  21.   $requeteSQL_getPublicationTitle($parent);
  22.   $result=$sql_object->DBSelect($requete);
  23.   $current_title=FormatText($result[0]['publi_title']'2HTML');
  24.   $publi_owner=$result[0]['publi_posted_by'];
  25.  
  26.   //////////// Check Droits utilisateur ////////////
  27.   if (!HaveRight('publication')) ReloadIndex('admin');
  28.   if (GetSessionElement('id')!=$publi_owner && !IsSuperAdmin()) ReloadIndex('admin');
  29.   ///////////
  30. }
  31. if($type=='W'{
  32.   $requeteSQL_getWorkshopRepTitleAndGroup($parent);
  33.   $result=$sql_object->DBSelect($requete);
  34.   $current_title=FormatText($result[0]['workrep_title'].' ('.$result[0]['workshop_denomination'].')''2HTML');
  35.   $workshop_id=$result[0]['workrep_workshop_id'];
  36.  
  37.   //////////// Check Droits utilisateur ////////////
  38.   if (!HaveRight('workshop')) ReloadIndex('admin');
  39.   if (!AuthUser4Workshop($workshop_id$sql_object&& !IsSuperAdmin()) ReloadIndex('admin');
  40.   ///////////
  41. }
  42. ?>
  43.  
  44. <div id="chemin">
  45. <ul>
  46.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a>
  47.     </li>
  48.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  49.         class="chemin_rub"><?php echo _t('menu',$mod_inc)?></a></li>
  50.     <li><span><?php echo formatNavTitle(_t('resources',$mod_inc.'_type')." : "$current_title)?></span>
  51.     </li>
  52. </ul>
  53. </div>
  54. <!--end barre haute -->
  55. <?php
  56. $form_name='';
  57. $form_description='';
  58. $form_url='';
  59. $mask_localisation_IN='';
  60. $mask_localisation_OUT='checked="checked"';
  61.  
  62.  
  63. $resources_objectnew resources;
  64.  
  65. if(isset($_POST['enregistrer'])) {
  66.   $data_table=unserialize(urldecode($_POST['data_table']));
  67.   $result=$resources_object->AddMultiRes($parent$data_table$complete_type$sql_object);
  68.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&type=".$type."&id=".$parent;
  69.   if($result===trueheader("Location: ".$link_confirm);
  70.   else  system_error();
  71. }
  72.  
  73. if(isset($_POST['valider'])) {
  74.   $table[0]=$_POST['multi_name'];
  75.   $table[1]=$_POST['multi_description'];
  76.   $table[2]=$_POST['multi_url'];
  77.   $table[3]=0// range
  78.   $table[4]=$_POST['multi_localisation'];
  79.  
  80.   if($_POST['multi_localisation']=='OUT'{
  81.     $display_localisation=_t('resources','multi_file_out');
  82.     $mask_localisation_OUT='checked="checked"';
  83.     $mask_localisation_IN='';
  84.   else {
  85.     $table[2]=$resources_object->M_URI_INPUT.$table[2];
  86.     $display_localisation=_t('resources','multi_file_in');
  87.   }
  88.  
  89.   $integrity=$resources_object->CheckDataIntegrity($table,'MULTI');
  90.  
  91.   if(is_string($integrity)) {
  92.     $text_format='2FIELD';
  93.   else {
  94.     $text_format='2HTML';
  95.   }
  96.   $form_name=formatText($_POST['multi_name']$text_format);
  97.   $form_description=formatText($_POST['multi_description']$text_format);
  98.   $form_url=formatText($_POST['multi_url']$text_format);
  99.  
  100.   $table=urlencode(serialize($table));
  101. }
  102.  
  103.  
  104. include_once(THEME_ADMIN_PATH."quickicons.php");
  105.  
  106. ?>
  107.  
  108. <?php
  109. if(!isset($integrity|| is_string($integrity)) {
  110.   ?>
  111. <div class="contentcontainer"><?php
  112. include_once($dir."/menurub.php");
  113. ?>
  114. <div id="content"><?php
  115. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  116. ?>
  117. <h2><?php echo formatTitleh2($current_title)?></h2>
  118. <form id="addmulti" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  119.     method="post">
  120. <p><label for="multi_name"><?php echo _t('resources','multi_name')?> :
  121. *</label> <input name="multi_name" type="text" class="textfield"
  122.     id="multi_name" maxlength="200" value="<?php echo $form_name?>" /></p>
  123. <p><label for="multi_description"><?php echo _t('resources','multi_description')?>
  124. : *</label> <textarea id="multi_description" name="multi_description"
  125.     class="largetextfield" <?php echo AREA_SETTINGS?>><?php echo $form_description?></textarea>
  126. </p>
  127. <p><label for="multi_localisation_IN"><?php echo _t('resources','multi_situ')?>
  128. : *</label> <input name="multi_localisation" type="radio"
  129.     id="multi_localisation_IN" value="IN" class="radio"
  130.     <?php echo $mask_localisation_IN?> /><span class="radio"><?php echo _t('resources','multi_file_in')?></span>
  131. <input name="multi_localisation" type="radio"
  132.     id="multi_localisation_OUT" value="OUT" class="radio"
  133.     <?php echo $mask_localisation_OUT?> /><span class="radio"><?php echo _t('resources','multi_file_out')?></span>
  134. </p>
  135. <p><label for="multi_url"><?php echo _t('resources','url')?> : *</label>
  136. <input name="multi_url" type="text" class="textfield" id="multi_url"
  137.     maxlength="255" value="<?php echo $form_url?>" /></p>
  138. <div><input name="rub" type="hidden" value="<?php echo $rub?>"
  139.     id="rub" /> <input name="todo" type="hidden"
  140.     value="<?php echo $todo?>" id="todo" /> <input name="type"
  141.     type="hidden" value="<?php echo $type?>" id="type" /> <input
  142.     name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  143.     <?php echo cancel_button($cancel_link)?> <input name="valider"
  144.     type="submit" value="<?php echo _t('btn','valid'?>" class="button"
  145.     id="valider" /></div>
  146. </form>
  147. </div>
  148.     <?php include_once($dir."/help.php")?></div>
  149.     <?php
  150.     // Récapitulatif
  151. else    {
  152.  
  153.   ?>
  154. <div class="contentcontainer"><?php
  155. include_once($dir."/menurub.php");
  156. ?>
  157. <div id="content">
  158. <h2><?php echo formatTitleh2(_t('recap','title'))?></h2>
  159. <?php
  160. echo "<dl class=\"dl3\">\n";
  161. echo "<dt>"._t('resources','multi_name')."</dt>\n";
  162. echo "<dd>".$form_name."</dd>\n";
  163. echo "<dt>"._t('resources','multi_description')."</dt>\n";
  164. echo "<dd>".$form_description."</dd>\n";
  165. echo "<dt>"._t('resources','multi_situ')."</dt>\n";
  166. echo "<dd>".$display_localisation."</dd>\n";
  167. echo "<dt>"._t('resources','url')."</dt>\n";
  168. echo "<dd>".$form_url."</dd>\n";
  169. echo "</dl>\n";
  170. ?>
  171. <form id="addmulti" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  172.     method="post">
  173. <div><input name="rub" type="hidden" value="<?php echo $rub?>"
  174.     id="rub" /> <input name="todo" type="hidden"
  175.     value="<?php echo $todo?>" id="todo" /> <input name="type"
  176.     type="hidden" value="<?php echo $type?>" id="type" /> <input
  177.     name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  178. <input name="data_table" type="hidden" value="<?php echo $table?>"
  179.     id="data_table" /> <input name="retour" type="button"
  180.     value="<?php echo _t('btn','preview'?>" class="button" id="retour"
  181.     onclick="history.go(-1);" /> <input name="enregistrer" type="submit"
  182.     value="<?php echo _t('btn','save'?>" class="button" id="valider" /></div>
  183. </form>
  184. </div>
  185. <?php include_once($dir."/help.php")?></div>
  186. <?php
  187. }
  188. ?>

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