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 (!hasRight('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 (!hasRight('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.   $form_url=$result[0]['multires_media_uri'];
  54. }
  55. ?>
  56.  
  57. <div id="chemin">
  58. <ul>
  59.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a>
  60.     </li>
  61.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  62.         class="chemin_rub"><?php echo _t('menu',$mod_inc)?></a></li>
  63.     <li><span><?php echo formatNavTitle(_t('resources',$mod_inc.'_type')." : "$current_title)?></span>
  64.     </li>
  65. </ul>
  66. </div>
  67. <!--end barre haute -->
  68. <?php
  69.  
  70. if(isset($_POST['enregistrer'])) {
  71.   $data_table=unserialize(urldecode($_POST['data_table']));
  72.   $result=$resources_object->ModifyMultiRes($id$data_table$sql_object);
  73.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&type=".$type."&id=".$parent;
  74.   if($resultheader("Location: ".$link_confirm);
  75.   else  system_error();
  76. }
  77.  
  78. if(isset($_POST['valider'])) {
  79.   $table[0]=$_POST['multi_name'];
  80.   $table[1]=$_POST['multi_description'];
  81.   $table[2]=$_POST['multi_url'];
  82.  
  83.   $integrity=$resources_object->CheckDataIntegrity($table,'MULTI');
  84.  
  85.   if(is_string($integrity)) {
  86.     $text_format='2FIELD';
  87.   else {
  88.     $text_format='2HTML';
  89.   }
  90.   $form_name=formatText($_POST['multi_name']$text_format);
  91.   $form_description=formatText($_POST['multi_description']$text_format);
  92.   $form_url=formatText($_POST['multi_url']$text_format);
  93.  
  94.   $table=urlencode(serialize($table));
  95. }
  96.  
  97.  
  98. include_once(THEME_ADMIN_PATH."quickicons.php");
  99.  
  100. ?>
  101.  
  102. <?php
  103. if(!isset($integrity|| is_string($integrity)) {
  104.   ?>
  105.  <script type="text/javascript">
  106.     $(document).ready(function(){
  107.         $("#browse_server").click(function() {
  108.              BrowseServer('multi_url');
  109.              return false;
  110.             });
  111.     });
  112.  </script>
  113. <div class="contentcontainer"><?php
  114. include_once($dir."/menurub.php");
  115. ?>
  116. <div id="content">
  117. <?php
  118. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  119. ?>
  120. <h2><?php echo formatTitleh2($current_title)?></h2>
  121. <form id="modmulti" action="<?php echo $_SERVER['SCRIPT_NAME']?>"    method="post">
  122.   <p>
  123.     <label for="multi_name"><?php echo ucfirst(_t('resources','multi_name'))?> : *</label>
  124.     <input name="multi_name" type="text" class="textfield" id="multi_name" maxlength="200" value="<?php echo $form_name?>" />
  125.   </p>
  126.   <p>
  127.       <label for="multi_description"><?php echo ucfirst(_t('resources','multi_description'))?>: *</label>
  128.       <textarea id="multi_description" name="multi_description" class="largetextfield" <?php echo AREA_SETTINGS?>><?php echo $form_description?></textarea>
  129.   </p>
  130.   <p>
  131.       <label for="multi_url"><?php echo _t('resources','url')?> : *</label>
  132.       <input name="multi_url" type="text" class="textfield-shorten" id="multi_url" maxlength="255" value="<?php echo $form_url?>" />
  133.     <a id="browse_server" href="../library/access.php?langCode=<?php echo U_L?>" title="<?php echo _t('filemanager','browse')?>"><span><?php echo _t('filemanager','browse')?></span></a>
  134.   </p>
  135.   <div>
  136.     <input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  137.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  138.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  139.     <input name="type" type="hidden" value="<?php echo $type?>" id="type" />
  140.     <input name="parent" type="hidden" value="<?php echo $parent?>" id="parent" /> 
  141.     <?php echo cancel_button($cancel_link)?> 
  142.     <input name="valider" type="submit" value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  143.   </div>
  144. </form>
  145. </div>
  146. <?php include_once($dir."/help.php")?></div>
  147. <?php
  148. // Récapitulatif
  149. else    {
  150.  
  151.   ?>
  152. <div class="contentcontainer"><?php
  153. include_once($dir."/menurub.php");
  154. ?>
  155. <div id="content">
  156. <h2><?php echo formatTitleh2(_t('recap','title'))?></h2>
  157. <?php
  158. echo "<dl class=\"dl3\">\n";
  159. echo "<dt>".ucfirst(_t('resources','multi_name'))."</dt>\n";
  160. echo "<dd>".$form_name."</dd>\n";
  161. echo "<dt>".ucfirst(_t('resources','multi_description'))."</dt>\n";
  162. echo "<dd>".$form_description."</dd>\n";
  163. echo "<dt>"._t('resources','url')."</dt>\n";
  164. echo "<dd>".$form_url."</dd>\n";
  165. echo "</dl>\n";
  166. ?>
  167. <form id="modmulti" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  168.   <div>
  169.     <input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  170.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  171.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  172.     <input name="type" type="hidden" value="<?php echo $type?>" id="type" />
  173.     <input name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  174.     <input name="data_table" type="hidden" value="<?php echo $table?>" id="data_table" /> 
  175.     <?php echo cancel_button($cancel_link)?>
  176.     <input name="retour" type="button" value="<?php echo _t('btn','preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  177.     <input name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>" class="button" id="valider" />
  178.   </div>
  179. </form>
  180. </div>
  181. <?php include_once($dir."/help.php")?>
  182. </div>
  183. <?php
  184. }
  185. ?>

Documentation generated on Thu, 03 May 2012 15:06:39 +0200 by phpDocumentor 1.4.1