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

Documentation generated on Thu, 20 Mar 2014 16:49:32 +0100 by phpDocumentor 1.4.1