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 news
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!class_exists('auth')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!$l21auth->hasRight('news')) ReloadIndex('admin');
  20. ////////////
  21.  
  22. if(isset($_POST['id']))    $id=$_POST['id'];
  23. if(isset($_GET['id']))    $id=$_GET['id'];
  24. $link_det=$rub_link."&amp;todo=det&amp;id=".$id;
  25.  
  26.  
  27. if(isset($_POST['valider'])) {
  28.   $news_object new news;
  29.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  30.   $result=$news_object->DeleteNews($id$sql_object);
  31.   if($resultheader("Location: ".$link_confirm);
  32.   else  system_error();
  33. }
  34.  
  35. $requeteSQL_getNewsTitle($id);
  36. $result=$sql_object->DBSelect($requete);
  37. $news_title=FormatText($result[0]['news_title']);
  38. $news_owner=FormatText($result[0]['news_posted_by']);
  39.  
  40. //////////// Check Droits utilisateur ////////////
  41. if (!$l21auth->hasRight('news')) ReloadIndex('admin');
  42. if ($l21auth->GetSessionElement('id')!=$news_owner && !$l21auth->isSuperAdmin()) ReloadIndex('admin');
  43. ////////////
  44. ?>
  45.  
  46. <div id="chemin">
  47.     <ul>
  48.         <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  49.         <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','news')?></a></li>
  50.         <li><span><?php echo formatNavTitle(_t('news','sup')." : "$news_title)?></span></li>
  51.     </ul>
  52. </div>
  53. <!--end barre haute -->
  54. <?php
  55. include_once(THEME_ADMIN_PATH."quickicons.php");
  56. ?>
  57. <div class="contentcontainer"><?php
  58. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  59. ?>
  60. <div id="content">
  61.   <?php echo "<h2>"formatTitleh2($news_title)."</h2>"?>
  62.   <form id="suptheme" action="<?php echo $_SERVER['SCRIPT_NAME']?>"    method="post">
  63.     <p class="info"><i class="icon-trash"></i> <?php echo _t('divers','sup_confirm')?></p>
  64.     <div>
  65.       <input name="id" type="hidden" value="<?php echo $id?>" />
  66.       <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  67.       <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  68.       <?php echo cancel_button('javascript:history.go(-1);')?>
  69.       <input name="valider" type="submit" value="<?php echo _t('btn','valid')?>" class="button" id="valider" />
  70.     </div>
  71.   </form>
  72. </div>
  73. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>

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