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 comment
  5.  * @author Simon Georget <simon@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 (!IsSuperAdmin()) ReloadIndex('admin');
  20. ////////////
  21.  
  22.  
  23. if(isset($_GET['statut']&& $_GET['statut'!= -1{
  24.   $status=$_GET['statut'];
  25.   $status_q=array($_GET['statut']);
  26. else {
  27.   $status = -1;
  28.   $status_q array('P''D''E');
  29. }
  30.  
  31. if(isset($_GET['module']) ) {
  32.   $module=$_GET['module'];
  33. else {
  34.   $module'all';
  35. }
  36.  
  37. if(!isset($_GET['debut'])) $debut=0;
  38. else $debut=$_GET['debut'];
  39.  
  40. $mask_statut_1='';
  41. $mask_statut_2='';
  42. $mask_statut_3='';
  43. $mask_statut_4='';
  44. $mask_statut_5='';
  45. $mask_statut_6='';
  46. $mask_statut_7='';
  47.  
  48. if($status=='public'$mask_statut_1='selected="selected"';
  49. if($status=='draft'$mask_statut_2='selected="selected"';
  50.  
  51.  
  52. // Nombre d'enregistrement total dans la bdd
  53. $r $sql_object->DBSelect(SQL_getTotalCountNumber());
  54. $nb=$r[0]['nb'];
  55. $nb_comments sprintf(_t('comment','nb_total')$nb);
  56.  
  57. $comm new comment();
  58.  
  59. if($module=='all'{
  60.   // tous les commentaires sont retournĂ©s !!!
  61.   // et la pagination est effectuĂ©e ici via array_slice()
  62.   // @todo Optimiser
  63.   $data $comm->getAllByModule($status_q$sql_objectfalse'date');
  64.   (count($data== && $data == 0?  $nb_q_comments $nb_q_comments count($data);
  65.   $data array_slice($data$debutSELECT_LIMIT);
  66.   $html_comments getMarkup($datatrue);
  67. else {
  68.   $data $comm->getByModule(array('module' => $module'status' => $status_q'limit' => false)$sql_object);
  69.   (count($data== && $data == 0?  $nb_q_comments $nb_q_comments count($data);
  70.   $data array_slice($data$debutSELECT_LIMIT);
  71.   $html_comments getMarkup($datatrue);
  72. }
  73.  
  74. echo getAjaxFunction()// for ajax call
  75.  
  76. if($module != 'all' || $status != -1{
  77.   $link_back="<div class=\"filter\"><a href=\"".$rub_link."&amp;todo=list\">"._t('comment','all')."</a></div>";
  78. else {
  79.   $link_back='';
  80. }
  81.  
  82.  
  83.  
  84. if($nb_q_comments<=1$query_count _t('divers','query_result')." : ".$nb_q_comments." "._t('divers','record')."<br />\n";
  85. else $query_count _t('divers','query_result')." : ".$nb_q_comments." "._t('divers','records')."<br />\n";
  86.  
  87. $link_status=$rub_link."&amp;todo=list&amp;module=".$module."&amp;statut=";
  88. $link_module=$rub_link."&amp;todo=list&amp;statut=".$status."&amp;module=";
  89. $link_self=$rub_link."&amp;todo=list&amp;statut=".$status."&amp;module=".$module;
  90.  
  91. // Liste des modules disponibles
  92. if($module=='news'$mask_statut_1 'selected="selected"';
  93. if($module=='project'$mask_statut_2 'selected="selected"';
  94. if($module=='publication'$mask_statut_3 'selected="selected"';
  95. if($module=='report'$mask_statut_4 'selected="selected"';
  96. if($module=='indicator'$mask_statut_5 'selected="selected"';
  97. if($module=='files'$mask_statut_6 'selected="selected"';
  98. if($module=='contribute'$mask_statut_7 'selected="selected"';
  99. $select_module="<select name=\"statut_filter\" id=\"statut_filter\"  onchange=\"ChangeLocation(this)\">\n";
  100. $select_module.="<option value=\"-1\">"._t('comment','module_filter')."</option>\n";
  101. $select_module.="<option value=\"".$link_module."news\"".$mask_statut_1."> -- ".ucfirst(_t('comment_map''news'))."</option>\n";
  102. $select_module.="<option value=\"".$link_module."project\"".$mask_statut_2."> -- ".ucfirst(_t('comment_map''project'))."</option>\n";
  103. $select_module.="<option value=\"".$link_module."publication\"".$mask_statut_3."> -- ".ucfirst(_t('comment_map''publication'))."</option>\n";
  104. $select_module.="<option value=\"".$link_module."report\"".$mask_statut_4."> -- ".ucfirst(_t('comment_map''report'))."</option>\n";
  105. $select_module.="<option value=\"".$link_module."indicator\"".$mask_statut_5."> -- ".ucfirst(_t('comment_map''indicator'))."</option>\n";
  106. $select_module.="<option value=\"".$link_module."files\"".$mask_statut_6."> -- ".ucfirst(_t('comment_map''files'))."</option>\n";
  107. $select_module.="<option value=\"".$link_module."contribute\"".$mask_statut_7."> -- ".ucfirst(_t('comment_map''contribute'))."</option>\n";
  108. $select_module.="</select>\n";
  109. ?>
  110. <div id="chemin">
  111. <ul>
  112.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  113.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  114.         class="chemin_rub"><?php echo _t('menu','comment')?></a></li>
  115.     <li><span><?php echo formatNavTitle(_t('comment','list'))?></span></li>
  116. </ul>
  117. </div>
  118. <!--end barre haute -->
  119. <?php
  120. include_once(THEME_ADMIN_PATH."quickicons.php");
  121. ?>
  122. <div class="contentcontainer"><?php    include_once($dir."/menurub.php");    ?>
  123.   <div id="content">
  124.   <div class="filter">
  125.         <a href="<?php echo $link_status?>D"><?php echo ucfirst(_t('comment''awaiting'))?></a> |
  126.         <a href="<?php echo $link_status?>P"><?php echo ucfirst(_t('comment''all_approved'))?></a> |
  127.         <a href="<?php echo $link_status?>E"><?php echo ucfirst(_t('comment''all_disapproved'))?></a> |
  128.         <a href="index.php?rub=comment&amp;todo=list"><?php echo _t('comment','all')?></a>
  129.     </div>
  130.   <div class="filterselect"><?php echo $select_module?></div>
  131.   <p>
  132.     <?php
  133.     echo $nb_comments.'<br />';
  134.     echo $query_count;
  135.     ?>
  136.   </p>
  137.   <?php
  138.   echo linkin_page($link_self$nb_q_comments$debut);
  139.   echo '<div id="comments">';
  140.   if(!empty($html_comments)) echo $html_comments;
  141.   else echo "<div class=\"info\">"._t('comment','noresult')."</div>";
  142.   echo '</div>';
  143.   echo linkin_page($link_self$nb_q_comments$debut);
  144.   ?>
  145. </div>
  146. <?php include_once($dir."/help.php")?></div>

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