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

Source for file list.php

Documentation is available at list.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage home
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  'Home' module is used into the back-office
  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. // Comments
  20. if(defined('MOD_COMMENT') && MOD_COMMENT == 1) {
  21.   include_once(themePath('../comment/display.php'));
  22.   include_once(themePath('../comment/'.SQL.'.inc.php'));
  23.   include_once('../class/class.comment.php');
  24.   if(COMMENT_MODERATION == 1) {
  25.     $status = array('D');
  26.     $comm = new comment();
  27.     $data = $comm->getAllByModule($status, $sql_object, false, 'date');
  28.     $nb_comments = count($data);
  29.     $html_comments = getMarkup($data, true);
  30.   } else {
  31.     $status = array('P');
  32.     $comm = new comment();
  33.     $data = $comm->getAllByModule($status, $sql_object, 10, 'date');
  34.     $nb_comments = count($data);
  35.     $html_comments = getMarkup($data, false);
  36.   }
  37.   echo getAjaxFunction();
  38. }
  39.  
  40.  
  41. if (isset($_COOKIE['linea21_lastcon'])) $date = date("Y-m-d", $_COOKIE['linea21_lastcon']);
  42. $result_yp = $sql_object -> DBSelect($req_yp);
  43. if ($result_yp[0]['yellowp_id']=="") $nb_yp=0;
  44. else $nb_yp = count($result_yp);
  45. $link_yp = "index.php?rub=yellowpages&amp;todo=det&amp;id=";
  46. $liste_yp = '';
  47.  
  48. if ($nb_yp<>0) {
  49.   for ($i = 0;$i < count($result_yp);$i++) {
  50.     $liste_yp .= "\t<li class=\"li2\"><a href=\"" . $link_yp . $result_yp[$i]['yellowp_id'] . "\" title=\"" . formatText($result_yp[$i]['yellowp_name'], '2ATT') . "\">" . formatText($result_yp[$i]['yellowp_name'], '2HTML') . "</a></li>\n\n";
  51.   }
  52. }else   $liste_yp .= "\t<li><div class=\"info\">" ._t('home','noupdate'). "</div></li>\n\n";
  53.  
  54.  
  55.  
  56. $result_sdi = $sql_object -> DBSelect($req_sdi);
  57. if ($result_sdi[0]['sdii_id']=="") $nb_dashboard=0;
  58. else $nb_dashboard = count($result_sdi);
  59. $liste_dashboard = '';
  60. $link_dashboard = "index.php?rub=dashboard&amp;todo=det&amp;id=";
  61. if ($nb_dashboard<>0) {
  62.   for ($i = 0;$i < count($result_sdi);$i++) {
  63.     $liste_dashboard .= "\t<li class=\"li2\"><a href=\"" . $link_dashboard . $result_sdi[$i]['sdii_id'] . "&amp;scale_id=" . $result_sdi[$i]['scale_id'] . "\" title=\"" . formatText($result_sdi[$i]['sdii_name'], '2ATT') . "\">" . formatText($result_sdi[$i]['sdii_name'], '2HTML') . "</a> <span class=\"scale\">   (" . formatText($result_sdi[$i]['scale_denomination'], '2HTML') . ") </span></li>\n\n";
  64.   }
  65. }else   $liste_dashboard .= "\t<li><div class=\"info\">" ._t('home','noupdate'). "</div></li>\n\n";
  66.  
  67. if (isset($_COOKIE['linea21_lastcon'])){
  68.   $req_user = SQL_getUser($date);
  69.   $resultu = $sql_object -> DBSelect($req_user);
  70.   if ($resultu[0]['user_id']=="") $nb_user=0;
  71.   else $nb_user = count($resultu);
  72.   $liste_user = '';
  73.   $link_user = "index.php?rub=user&amp;todo=det&amp;id=";
  74.   if ($nb_user<>0) {
  75.     for ($i = 0;$i < count($resultu);$i++) {
  76.       $liste_user .= "\t<li class=\"li2\"><a href=\"" . $link_user . $resultu[$i]['user_id'] . "\" title=\"" . formatText($resultu[$i]['user_login'], '2ATT') . "\">" . formatText($resultu[$i]['user_login'], '2HTML') . "</a></li>\n\n";
  77.     }
  78.   }else   $liste_user .= "\t<li><div class=\"info\">" ._t('home','noupdate'). "</div></li>\n\n";
  79. }
  80.  
  81. $result_news = $sql_object -> DBSelect($req_news);
  82. $liste_news = '';
  83. if ($result_news[0]['news_id']=="") $nb_news=0;
  84. else $nb_news = count($result_news);
  85. $link_news = "index.php?rub=news&amp;todo=det&amp;id=";
  86. if ($nb_news<>0) {
  87.   for ($i = 0;$i < count($result_news);$i++) {
  88.     $liste_news .= "\t<li class=\"li2\"><a href=\"" . $link_news . $result_news[$i]['news_id'] . "\" title=\"" . formatText($result_news[$i]['news_title'], '2ATT') . "\">" . formatText($result_news[$i]['news_title'], '2HTML') . "</a></li>\n\n";
  89.   }
  90. } else   $liste_news .= "\t<li><div class=\"info\">" ._t('home','noresult'). "</div></li>\n\n";
  91.  
  92.  
  93. $result_publi = $sql_object -> DBSelect($req_publi);
  94. $link_publi = "index.php?rub=publication&amp;todo=det&amp;id=";
  95. if ($result_publi[0]['publi_id']=="") $nb_publi=0;
  96. else $nb_publi = count($result_publi);
  97. if ($nb_publi<>0) $liste_publi = "\t<li class=\"li2\"><a href=\"" . $link_publi . $result_publi[0]['publi_id'] . "\" title=\"" . formatText($result_publi[0]['publi_title'], '2HTML') . "\">" . formatText($result_publi[0]['publi_title'], '2HTML') . "</a></li>\n\n";
  98. else  $liste_publi = "\t<li><div class=\"info\">" ._t('home','noresult'). "</div></li>\n\n";
  99.  
  100. $result_rep = $sql_object -> DBSelect($req_rep);
  101. if ($result_rep[0]['workrep_id']=="") $nb_rep=0;
  102. else $nb_rep = count($result_rep);
  103. $link_rep = "index.php?rub=workshoprep&amp;todo=det&amp;id=";
  104. if ($nb_rep<>0) $liste_rep = "\t<li class=\"li2\"><a href=\"" . $link_rep . $result_rep[0]['workrep_id'] . "\" title=\"" . formatText($result_rep[0]['workrep_title'], '2ATT') . "\">" . formatText($result_rep[0]['workrep_title'], '2HTML') . "</a></li>\n\n";
  105. else  $liste_rep = "\t<li><div class=\"info\">" ._t('home','noresult'). "</div></li>\n\n";
  106.  
  107. $rProjects = $sql_object->DBSelect(SQL_getProjects(), 'OBJECT');
  108. $lProjects = '';
  109. if ($rProjects == 0) $nbProjects=0;
  110. else $nbProjects = count($rProjects);
  111. $link_projects = "index.php?rub=project&amp;todo=det&amp;id=";
  112. if ($nbProjects > 0) {
  113.   for ($i = 0;$i < count($rProjects);$i++) {
  114.     $lProjects .= "\t<li class=\"li2\"><a href=\"" . $link_projects . $rProjects[$i]->project_id . "\" title=\"" . formatText($rProjects[$i]->project_name, '2ATT') . "\">" . formatText($rProjects[$i]->project_name, '2HTML') .' ('. $rProjects[$i]->project_estimated_date_display . ")</a></li>\n\n";
  115.   }
  116. } else   $lProjects .= "\t<li><div class=\"info\">" ._t('home','noresult'). "</div></li>\n\n";
  117.  
  118.  
  119. ?>
  120. <div id="chemin">
  121. <ul>
  122.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home') ?></a>
  123.     </li>
  124. </ul>
  125. </div>
  126. <!--end barre haute -->
  127. <?php
  128. include_once(THEME_ADMIN_PATH."quickicons.php");
  129.  
  130. ?>
  131. <div class="contentcontainer"><?php include_once($dir . "/menurub.php");
  132.  
  133. ?>
  134. <div id="content"><?php
  135. $listing = '';
  136. $listing .= "<div class=\"scale\">" . _t('home','accueil') . ": <a href=\"mailto:".MAIL_LINEA."\" title=\"".MAIL_LINEA."\">".MAIL_LINEA."</a></div>";
  137. $listing .= "<h2>" . _t('home','resume') . "</h2><br class=\"brendstep\" />";
  138.  
  139.  
  140. if (IsSuperAdmin() && defined('MOD_COMMENT') && MOD_COMMENT == 1) {
  141.   if(COMMENT_MODERATION == 1) {
  142.     $title = sprintf(_t('home','comment_to_moderate'), '<span id="cc">'.$nb_comments.'</span>');
  143.   } else {
  144.     $title = sprintf(_t('home','comment'), $nb_comments);
  145.   }
  146.   $listing .= "<div class=\"toggle_title\"><a href=\"#\" onclick=\"$('#comments').slideToggle(); return false;\">" . $title. "</a></div>";
  147.   $listing .= "<div class=\"contboxgray\" id=\"comments\" >\n";
  148.   if(!empty($html_comments)) $listing .= $html_comments;
  149.   else $listing .= "<div class=\"info\">"._t('home','noresult')."</div>";
  150.   $listing .= "</div>\n";
  151. }
  152.  
  153. if (hasRight('dashboard') && defined('MOD_DASHBOARD') && MOD_DASHBOARD == 1) {
  154.   $listing .= "<div class=\"toggle_title\"><a href=\"#\" onclick=\"$('#general').slideToggle(); return false;\">" . $nb_dashboard . " " . _t('home','dashboard') . "</a></div>";
  155.   $listing .= "<div class=\"contboxgray\" id=\"general\" style=\"display:none;\" >\n";
  156.   $listing .= "<ul>\n";
  157.   $listing .= $liste_dashboard;
  158.   $listing .= "</ul>\n";
  159.   $listing .= "</div>\n";
  160. }
  161.  
  162. if (IsSuperAdmin() && defined('MOD_PROJECT') && MOD_PROJECT == 1) {
  163.   $listing .= "<div class=\"toggle_title\"><a href=\"#\" onclick=\"$('#projects').slideToggle(); return false;\">" . _t('home','project') . "</a></div>";
  164.   $listing .= "<div class=\"contboxgray\" id=\"projects\" style=\"display:none;\" >\n";
  165.   $listing .= "<ul>\n";
  166.   $listing .= $lProjects;
  167.   $listing .= "</ul>\n";
  168.   $listing .= "</div>\n";
  169. }
  170.  
  171. if (hasRight('category_user') && defined('MOD_USER') && MOD_USER == 1){
  172.   if (isset($_COOKIE['linea21_lastcon'])){
  173.     $listing .= "<div class=\"toggle_title\"><a href=\"#\" onclick=\"$('#user').slideToggle(); return false;\">" . $nb_user . " " . _t('home','user') . "</a></div>";
  174.     $listing .= "<div class=\"contboxgray\" id=\"user\" style=\"display:none;\" >\n";
  175.     $listing .= "<ul>\n";
  176.     $listing .= $liste_user;
  177.     $listing .= "</ul>\n";
  178.     $listing .= "</div>\n";
  179.   }
  180. }
  181. if (IsSuperAdmin() && defined('MOD_YELLOWPAGES') && MOD_YELLOWPAGES == 1){
  182.   $listing .= "<div class=\"toggle_title\"><a href=\"#\" onclick=\"$('#yp').slideToggle(); return false;\">" . $nb_yp . " " . _t('home','yp') . "</a></div>";
  183.   $listing .= "<div class=\"contboxgray\" id=\"yp\" style=\"display:none;\" >\n";
  184.   $listing .= "<ul>\n";
  185.   $listing .= $liste_yp;
  186.   $listing .= "</ul>\n";
  187.   $listing .= "</div>\n";
  188. }
  189. if (hasRight('news') && defined('MOD_NEWS') && MOD_NEWS == 1){
  190.   $listing .= "<h3>" . _t('home','news') . "</h3>";
  191.   $listing .= "<div class=\"contboxgray\">\n";
  192.   $listing .= "<ul>\n";
  193.   $listing .= $liste_news;
  194.   $listing .= "</ul>\n";
  195.   $listing .= "</div>\n";
  196. }
  197. if (hasRight('publication') && defined('MOD_PUBLICATION') && MOD_PUBLICATION == 1) {
  198.   $listing .= "<h3>" . _t('home','publi') . "</h3>";
  199.   $listing .= "<div class=\"contboxgray\">\n";
  200.   $listing .= "<ul>\n";
  201.   $listing .= $liste_publi;
  202.   $listing .= "</ul>\n";
  203.   $listing .= "<div class=\"scale\">" . formatText($result_publi[0]['publi_resume'], '2HTML') . "</div>";
  204.   $listing .= "</div>\n";
  205. }
  206. if (hasRight('workshop') && defined('MOD_WORKSHOP') && MOD_WORKSHOP == 1){
  207.   $listing .= "<h3>" . _t('home','report') . "</h3>";
  208.   $listing .= "<div class=\"contboxgray\">\n";
  209.   $listing .= "<ul>\n";
  210.   $listing .= $liste_rep;
  211.   $listing .= "</ul>\n";
  212.   $listing .= "<div class=\"scale\">" . formatText($result_rep[0]['workrep_resume'], '2HTML') . "</div>";
  213.   $listing .= "</div>\n";
  214. }
  215.  
  216. echo $listing;
  217.  
  218. ?></div>
  219. <?php include_once($dir . "/help.php");
  220.  
  221. ?></div>

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