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

Source for file mod_biblio.php

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

Documentation generated on Sat, 08 Nov 2008 14:53:32 +0100 by phpDocumentor 1.4.1