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

Source for file mod_multi.php

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

Documentation generated on Fri, 01 Apr 2011 09:33:23 +0200 by phpDocumentor 1.4.1