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. include_once("../lib/lib_common.php");
  20. $complete_type=strtoupper($mod_inc);
  21.  
  22. if(isset($_POST['id']))    $id=$_POST['id'];
  23. if(isset($_GET['id']))    $id=$_GET['id'];
  24.  
  25. if(isset($_POST['valider'])) {
  26.     $contents_object = new contents;
  27.     $result=$contents_object->DeleteContents($id, $complete_type,$sql_object);
  28.  
  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']);
  38.     $current_owner=$result[0]['publi_posted_by'];
  39.     
  40.     //////////// Check Droits utilisateur ////////////
  41.     if (!HaveRight('publication')) ReloadIndex('admin');
  42.     if (GetSessionElement('id')!=$current_owner && !IsSuperAdmin()) ReloadIndex('admin');
  43.     ///////////
  44.     
  45.     $requete= SQL_getOnePublicationParts($id);
  46.     $result=$sql_object->DBSelect($requete);
  47.     $current_part=FormatText($result[0]['publicon_title'], '2HTML');
  48. }
  49. if($type=='W') {
  50.     $requete= SQL_getWorkshopRepTitleAndGroup($parent);
  51.     $result=$sql_object->DBSelect($requete);
  52.     $current_title=FormatText($result[0]['workrep_title']).' ('.FormatText($result[0]['workshop_denomination']).')';
  53.     $current_workshop_id=$result[0]['workrep_workshop_id'];
  54.     
  55.     //////////// Check Droits utilisateur ////////////
  56.     if (!HaveRight('workshop')) ReloadIndex('admin');
  57.     if (!AuthUser4Workshop($current_workshop_id, $sql_object) && !IsSuperAdmin()) ReloadIndex('admin');
  58.     ///////////
  59.     
  60.     $requete= SQL_getOneWorkshopParts($id);
  61.     $result=$sql_object->DBSelect($requete);
  62.     $current_part=FormatText($result[0]['workrepcon_title'], '2HTML');
  63. }
  64. ?>
  65. <div id="chemin">
  66.     <ul>
  67.         <li>
  68.             <a href="index.php" class="chemin_home"><? echo _t('way','home'); ?></a>
  69.         </li>
  70.         <li>
  71.                <a href="<?php echo $rub_link; ?>" id="chemin_<? echo $rub; ?>" class="chemin_rub"><? echo _t('menu',$mod_inc); ?></a>
  72.         </li>
  73.         <li>
  74.             <span><? echo formatNavTitle(_t('contents',$mod_inc.'_type')." : ". $current_title); ?></span>
  75.         </li>
  76.     </ul>
  77. </div>
  78. <!--end barre haute -->
  79. <?php
  80. include_once(THEME_ADMIN_PATH."quickicons.php");
  81. ?>
  82. <div class="contentcontainer">
  83. <?php
  84. include_once($dir."/menurub.php");
  85. ?>
  86. <div id="content">
  87. <? echo "<h2>". formatTitleh2($current_title)."</h2>"; ?>
  88. <form id="suptheme" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
  89. <p class="info">
  90. <?php 
  91. echo _t('contents','supp_info')."'".$current_part."'\n";
  92. ?>
  93. </p>
  94. <p><?php echo _t('divers','sup_confirm'); ?></p>
  95. <div>
  96. <input name="id" type="hidden" value="<?php echo $id; ?>" />
  97. <input name="rub" type="hidden" value="<?php echo $rub; ?>" id="rub" />
  98. <input name="todo" type="hidden" value="<?php echo $todo; ?>" id="todo" />
  99. <input name="type" type="hidden" value="<?php echo $type; ?>" id="type" />
  100. <input name="parent" type="hidden" value="<?php echo $parent; ?>" id="parent" />
  101. <?php echo cancel_button($cancel_link); ?>
  102. <input name="valider" type="submit" value="<? echo _t('btn','valid') ?>" class="button" id="valider" />
  103. </div>
  104. </form>
  105. </div>
  106. <?php include_once($dir."/help.php"); ?>
  107. </div>

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