linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file list.php

Documentation is available at list.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 (!function_exists('AuthenthificationProcess')) {
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!hasRight('news')) ReloadIndex('admin');
  20. ////////////
  21.  
  22. if(!isset($_GET['statut']|| $_GET['statut']==-1$statut=-1;
  23. elseif($_GET['statut']!=-1$statut=$_GET['statut'];
  24.  
  25.  
  26. if(!isset($_GET['debut'])) $debut=0;
  27. else $debut=$_GET['debut'];
  28.  
  29. $mask_statut_1='';
  30. $mask_statut_2='';
  31. $mask_statut_3='';
  32. $mask_statut_4='';
  33. if($statut=='public'$mask_statut_1='selected="selected"';
  34. if($statut=='draft'$mask_statut_2='selected="selected"';
  35. if($statut=='archives_p'$mask_statut_3='selected="selected"';
  36. if($statut=='archives_a'$mask_statut_4='selected="selected"';
  37.  
  38. // Nombre d'enregistrement total dans la bdd
  39. $result_nb_req=$sql_object->DBSelect($req_count_news);
  40. $bdd_nb_news=$result_nb_req[0]['num_rows'];
  41. $bdd_nb_news_display $bdd_nb_news." "._t('news','nb_total')."<br />\n";
  42.  
  43. if($statut!=-1{
  44.   $link_back="<div class=\"filter\"><a href=\"".$rub_link."&amp;todo=list\">"._t('news','all')."</a></div>";
  45.   $req_count_news=SQL_getCountNewsList($statut);
  46.   $result_nb_req=$sql_object->DBSelect($req_count_news);
  47.   $count_request=$result_nb_req[0]['num_rows'];
  48.   $req_list_news=SQL_getNewsList($debutSELECT_LIMIT$statut);
  49.   $result_news_list=$sql_object->DBSelect($req_list_news);
  50. else {
  51.   $link_back='';
  52.   $count_request=$bdd_nb_news;
  53.   $req_list_news=SQL_getNewsList($debutSELECT_LIMIT$statut);
  54.   $result_news_list=$sql_object->DBSelect($req_list_news);
  55. }
  56.  
  57. if($count_request<=1$count_request_display _t('divers','query_result')." : ".$count_request." "._t('divers','record')."<br />\n";
  58. else $count_request_display _t('divers','query_result')." : ".$count_request." "._t('divers','records')."<br />\n";
  59.  
  60. $link_sup=$rub_link."&amp;todo=sup&amp;id=";
  61. $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  62. $link_det=$rub_link."&amp;todo=det&amp;id=";
  63. $link_statut=$rub_link."&amp;todo=list&amp;statut=";
  64. $link_self=$link_statut.$statut;
  65.  
  66.  
  67. // Liste des statuts disponibles
  68. $select_statut="<select name=\"statut_filter\" id=\"statut_filter\"  onchange=\"ChangeLocation(this)\">\n";
  69. $select_statut.="<option value=\"-1\">"._t('news','statut_filter')."</option>\n";
  70. $select_statut.="<option value=\"".$link_statut."public\"".$mask_statut_1.">".display_statut('P')."</option>\n";
  71. $select_statut.="<option value=\"".$link_statut."draft\"".$mask_statut_2.">".display_statut('D')."</option>\n";
  72. $select_statut.="<option value=\"".$link_statut."archives_p\"".$mask_statut_3.">".display_statut('PA')."</option>\n";
  73. $select_statut.="<option value=\"".$link_statut."archives_a\"".$mask_statut_4.">".display_statut('AA')."</option>\n";
  74. $select_statut.="</select>\n";
  75. ?>
  76. <div id="chemin">
  77. <ul>
  78.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a>
  79.     </li>
  80.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  81.         class="chemin_rub"><?php echo _t('menu','news')?></a></li>
  82.     <li><span><?php echo formatNavTitle(_t('news','list'))?></span></li>
  83. </ul>
  84. </div>
  85. <!--end barre haute -->
  86. <?php
  87. include_once(THEME_ADMIN_PATH."quickicons.php");
  88. ?>
  89. <div class="contentcontainer"><?php    include_once($dir."/menurub.php");    ?>
  90. <div id="content"><?php
  91. echo $link_back;
  92. ?>
  93. <div class="filterselect"><?php
  94. echo $select_statut;
  95. ?></div>
  96. <p><?php
  97. echo $bdd_nb_news_display;
  98. echo $count_request_display;
  99. ?></p>
  100. <?php
  101. echo linkin_page($link_self$count_request$debut);
  102.  
  103. if($result_news_list!=0{
  104.   echo "<table cellspacing=\"0\" cellpadding=\"3\" class=\"sortable\" id=\"sort-table\">\n";
  105.   echo "<thead>\n";
  106.   echo "<tr>\n";
  107.   echo "<td>"._t('news','title')."</td>\n";
  108.   echo "<td>"._t('divers','date_crea')."</td>\n";
  109.   echo "<td>".cutText(_t('divers','date_publi')131'')."</td>\n";
  110.   echo "<td>&nbsp;<span class=\"semnone\">"._t('divers','actions')."</span></td>\n";
  111.   echo "</tr>\n";
  112.   echo "</thead>\n";
  113.  
  114.   echo "<tbody>\n";
  115.  
  116.  
  117.   for($i=0$i<count($result_news_list)$i++{
  118.     $news_title=formatText(cutText($result_news_list[$i]['news_title'],53)'2HTML');
  119.     $news_owner=$result_news_list[$i]['news_posted_by'];
  120.     $news_statut=$result_news_list[$i]['news_statut'];
  121.     $news_published_date $news_statut=='D' _t('statut','draft'$result_news_list[$i]['news_published_date_display'];
  122.     echo "<tr id=\"news-".$result_news_list[$i]['news_id']."\">\n";
  123.     echo "<td><a href=\"".$link_det.$result_news_list[$i]['news_id']."\" title=\""._t('news','det')."\">".$news_title."</a></td>\n";
  124.     echo "<td>".$result_news_list[$i]['news_date_crea_display']."</td>\n";
  125.     echo "<td>".$news_published_date."</td>\n";
  126.     echo "<td style=\"width:50px\">\n";
  127.  
  128.     if (GetSessionElement('id'== $news_owner || IsSuperAdmin()) {
  129.       echo "<div class=\"iconetab\">\n";
  130.       echo "<a href=\"".$link_sup.$result_news_list[$i]['news_id']."\" class=\"ico_sup\" title=\""._t('news','sup')."\"></a>\n";
  131.       echo "<a href=\"".$link_mod.$result_news_list[$i]['news_id']."\" class=\"ico_mod\" title=\""._t('news','mod')."\"></a>\n";
  132.       echo "</div>\n";
  133.     else echo '';
  134.     echo "</td>\n";
  135.     echo "</tr>\n";
  136.   }
  137.  
  138.   echo "</tbody>";
  139.   echo "</table>";
  140. else {
  141.   echo "<div class=\"info\">"._t('news','noresult')."</div>";
  142. }
  143. echo linkin_page($link_self$count_request$debut);
  144.  
  145. ?></div>
  146.  
  147. <?php
  148. // Ability to drag'n drop items
  149. footerAddJS('../lib/js/jquery.tablednd_0_5.js');
  150. ?>
  151.  
  152. <?php include_once($dir."/help.php")?></div>

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