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 (!function_exists('AuthenthificationProcess')) {
  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($result) header("Location: ".$link_confirm);
  30.   else  system_error();
  31. }
  32.  
  33. if($type=='P') {
  34.   $requete= SQL_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 (!hasRight('publication')) ReloadIndex('admin');
  41.   if (GetSessionElement('id')!=$current_owner && !IsSuperAdmin()) ReloadIndex('admin');
  42.   ///////////
  43.  
  44.   $requete= SQL_getOnePublicationParts($id);
  45.   $result=$sql_object->DBSelect($requete);
  46.   $current_part=FormatText($result[0]['publicon_title'], '2HTML');
  47. }
  48. if($type=='W') {
  49.   $requete= SQL_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 (!hasRight('workshop')) ReloadIndex('admin');
  56.   if (!AuthUser4Workshop($current_workshop_id, $sql_object) && !IsSuperAdmin()) ReloadIndex('admin');
  57.   ///////////
  58.  
  59.   $requete= SQL_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>
  67.     </li>
  68.     <li><a href="<?php echo $rub_link; ?>" id="chemin_<?php echo $rub; ?>"
  69.         class="chemin_rub"><?php echo _t('menu',$mod_inc); ?></a></li>
  70.     <li><span><?php echo formatNavTitle(_t('contents',$mod_inc.'_type')." : ". $current_title); ?></span>
  71.     </li>
  72. </ul>
  73. </div>
  74. <!--end barre haute -->
  75. <?php
  76. include_once(THEME_ADMIN_PATH."quickicons.php");
  77. ?>
  78. <div class="contentcontainer"><?php
  79. include_once($dir."/menurub.php");
  80. ?>
  81. <div id="content">
  82. <?php echo "<h2>". formatTitleh2($current_title)."</h2>"; ?>
  83. <form id="suptheme" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>"    method="post">
  84.   <p class="info">
  85.   <?php 
  86.     echo _t('contents','supp_info')."'".$current_part."'\n";
  87.   ?>
  88.   </p>
  89.   <p>
  90.     <?php echo _t('divers','sup_confirm'); ?>
  91.   </p>
  92.   <div>
  93.     <input name="id" type="hidden" value="<?php echo $id; ?>" />
  94.     <input name="rub" type="hidden" value="<?php echo $rub; ?>" id="rub" />
  95.     <input name="todo" type="hidden" value="<?php echo $todo; ?>" id="todo" />
  96.     <input name="type" type="hidden" value="<?php echo $type; ?>" id="type" />
  97.     <input name="parent" type="hidden" value="<?php echo $parent; ?>" id="parent" />
  98.     <?php echo cancel_button($cancel_link); ?>
  99.     <input name="valider" type="submit" value="<?php echo _t('btn','valid') ?>" class="button" id="valider" />
  100.   </div>
  101. </form>
  102. </div>
  103. <?php include_once($dir."/help.php"); ?></div>

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