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

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