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

Source for file sup.php

Documentation is available at sup.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. include_once("../lib/lib_common.php"); 
  20.  
  21. if(isset($_POST['id']))    $id=$_POST['id'];
  22. if(isset($_GET['id']))    $id=$_GET['id'];
  23.  
  24. if(isset($_POST['valider'])) {
  25.     $resources_object = new resources;
  26.     if($res=='biblio') $result=$resources_object->DeleteBiblioRes($id, $sql_object);
  27.     if($res=='multi') $result=$resources_object->DeleteMultiRes($id, $sql_object);
  28.     if($res=='link') $result=$resources_object->DeleteLinkRes($id, $sql_object);
  29.     $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&type=".$type."&id=".$parent;
  30.     if($result) header("Location: ".$link_confirm);
  31.     else  system_error();
  32. }
  33.  
  34. if($type=='P') {
  35.     $requete= SQL_getPublicationTitle($parent);
  36.     $result=$sql_object->DBSelect($requete);
  37.     $current_title=FormatText($result[0]['publi_title'], '2HTML');
  38.     $publi_owner=$result[0]['publi_posted_by'];
  39.     
  40.     //////////// Check Droits utilisateur ////////////
  41.     if (!HaveRight('publication')) ReloadIndex('admin');
  42.     if (GetSessionElement('id')!=$publi_owner && !IsSuperAdmin()) ReloadIndex('admin');
  43.     ///////////
  44.     
  45.  
  46. }
  47. if($type=='W') {
  48.     $requete= SQL_getWorkshopRepTitleAndGroup($parent);
  49.     $result=$sql_object->DBSelect($requete);
  50.     $current_title=FormatText($result[0]['workrep_title'].' ('.$result[0]['workshop_denomination'].')', '2HTML');
  51.     $workshop_id=$result[0]['workrep_workshop_id'];
  52.     
  53.     //////////// Check Droits utilisateur ////////////
  54.     if (!HaveRight('workshop')) ReloadIndex('admin');
  55.     if (!AuthUser4Workshop($workshop_id, $sql_object) && !IsSuperAdmin()) ReloadIndex('admin');
  56.     ///////////
  57.     
  58. }
  59.  
  60. if($res=='link') {
  61.     $requete= SQL_getLinkInfo($id);
  62.     $result=$sql_object->DBSelect($requete);
  63.     $current_info=FormatText($result[0]['linkres_mask'], '2HTML');
  64.     $type_display=_t('resources','link_res');
  65. }
  66. if($res=='multi') {
  67.     $requete= SQL_getMultiInfo($id);
  68.     $result=$sql_object->DBSelect($requete);
  69.     $current_info=FormatText($result[0]['multires_name'], '2HTML');
  70.     $type_display=_t('resources','multi_res');
  71. }
  72. if($res=='biblio') {
  73.     $requete= SQL_getBiblioInfo($id);
  74.     $result=$sql_object->DBSelect($requete);
  75.     $current_info=FormatText($result[0]['bibliores_title']." <span class=\"text_det_it\">(".$result[0]['bibliores_author'].")</span>", '2HTML');
  76.     $type_display=_t('resources','biblio_res');
  77. }
  78. ?>
  79. <div id="chemin">
  80.     <ul>
  81.         <li>
  82.             <a href="index.php" class="chemin_home"><? echo _t('way','home'); ?></a>
  83.         </li>
  84.         <li>
  85.                <a href="<?php echo $rub_link; ?>" id="chemin_<? echo $rub; ?>" class="chemin_rub"><? echo _t('menu',$mod_inc); ?></a>
  86.         </li>
  87.         <li>
  88.             <span><? echo formatNavTitle(_t('resources',$mod_inc.'_type')." : ". $current_title); ?></span>
  89.         </li>
  90.     </ul>
  91. </div>
  92. <!--end barre haute -->
  93. <?php
  94. include_once(THEME_ADMIN_PATH."quickicons.php");
  95. ?>
  96. <div class="contentcontainer">
  97. <?php
  98. include_once($dir."/menurub.php");
  99. ?>
  100. <div id="content">
  101. <? echo "<h2>".formatTitleh2($current_title)."</h2>"; ?>
  102. <form id="suptheme" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
  103. <p class="info">
  104. <?php 
  105. echo _t('resources','supp_info')."'".$type_display."' "._t('resources','next')." \n";
  106. echo $current_info."\n"; 
  107. ?>
  108. </p>
  109. <p><?php echo _t('divers','sup_confirm'); ?></p>
  110. <div>
  111. <input name="id" type="hidden" value="<?php echo $id; ?>" />
  112. <input name="rub" type="hidden" value="<?php echo $rub; ?>" id="rub" />
  113. <input name="res" type="hidden" value="<?php echo $res; ?>" id="res" />
  114. <input name="todo" type="hidden" value="<?php echo $todo; ?>" id="todo" />
  115. <input name="parent" type="hidden" value="<?php echo $parent; ?>" id="parent" />
  116. <input name="type" type="hidden" value="<?php echo $type; ?>" id="type" />
  117. <?php echo cancel_button($cancel_link); ?>
  118. <input name="valider" type="submit" value="<? echo _t('btn','valid') ?>" class="button" id="valider" />
  119. </div>
  120. </form>
  121. </div>
  122. <?php include_once($dir."/help.php"); ?>
  123. </div>

Documentation generated on Fri, 16 Oct 2009 09:39:23 +0200 by phpDocumentor 1.4.1