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 content
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  'Content' 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. $complete_type=strtoupper($mod_inc);
  20.  
  21. if(isset($_POST['id']))    $id=$_POST['id'];
  22. if(isset($_GET['id']))    $id=$_GET['id'];
  23.  
  24. if(isset($_POST['valider'])) {
  25.   $contents_object new contents;
  26.   $result=$contents_object->DeleteContents($id$complete_type,$sql_object);
  27.  
  28.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&type=".$type."&id=".$parent;
  29.   if($resultheader("Location: ".$link_confirm);
  30.   else  system_error();
  31. }
  32.  
  33. if($type=='P'{
  34.   $requeteSQL_getPublicationTitle($parent);
  35.   $result=$sql_object->DBSelect($requete);
  36.   $current_title=FormatText($result[0]['publi_title']);
  37.   $current_owner=$result[0]['publi_posted_by'];
  38.  
  39.   //////////// Check Droits utilisateur ////////////
  40.   if (!$l21auth->hasRight('publication')) ReloadIndex('admin');
  41.   if ($l21auth->GetSessionElement('id')!=$current_owner && !$l21auth->isSuperAdmin()) ReloadIndex('admin');
  42.   ///////////
  43.  
  44.   $requeteSQL_getOnePublicationParts($id);
  45.   $result=$sql_object->DBSelect($requete);
  46.   $current_part=FormatText($result[0]['publicon_title']'2HTML');
  47. }
  48. if($type=='W'{
  49.   $requeteSQL_getWorkshopRepTitleAndGroup($parent);
  50.   $result=$sql_object->DBSelect($requete);
  51.   $current_title=FormatText($result[0]['workrep_title']).' ('.FormatText($result[0]['workshop_denomination']).')';
  52.   $current_workshop_id=$result[0]['workrep_workshop_id'];
  53.  
  54.   //////////// Check Droits utilisateur ////////////
  55.   if (!$l21auth->hasRight('workshop')) ReloadIndex('admin');
  56.   if (!$l21auth->isWorkgroupOrganiser($l21auth->GetSessionElement('id')$sql_object$current_workshop_id&& !$l21auth->isSuperAdmin()) ReloadIndex('admin');
  57.   ///////////
  58.  
  59.   $requeteSQL_getOneWorkshopParts($id);
  60.   $result=$sql_object->DBSelect($requete);
  61.   $current_part=FormatText($result[0]['workrepcon_title']'2HTML');
  62. }
  63. ?>
  64. <div id="chemin">
  65. <ul>
  66.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  67.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu',$mod_inc)?></a></li>
  68.     <li><span><?php echo formatNavTitle(_t('contents',$mod_inc.'_type')." : "$current_title)?></span></li>
  69. </ul>
  70. </div>
  71. <!--end barre haute -->
  72. <?php
  73. include_once(THEME_ADMIN_PATH."quickicons.php");
  74. ?>
  75. <div class="contentcontainer"><?php
  76. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  77. ?>
  78. <div id="content">
  79. <?php echo "<h2>"formatTitleh2($current_title)."</h2>"?>
  80. <form id="suptheme" action="<?php echo $_SERVER['SCRIPT_NAME']?>"    method="post">
  81.   <p class="info">
  82.   <i class="icon-trash"></i> <?php echo _t('contents','supp_info')."'".$current_part."'\n"?>
  83.   </p>
  84.   <p>
  85.     <?php echo _t('divers','sup_confirm')?>
  86.   </p>
  87.   <div>
  88.     <input name="id" type="hidden" value="<?php echo $id?>" />
  89.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  90.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  91.     <input name="type" type="hidden" value="<?php echo $type?>" id="type" />
  92.     <input name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  93.     <?php echo cancel_button($cancel_link)?>
  94.     <input name="valider" type="submit" value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  95.   </div>
  96. </form>
  97. </div>
  98. <?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