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

Source for file display.php

Documentation is available at display.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage search
  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. include_once(override('../search/' SQL '.inc.php'));
  12.  
  13. /**
  14.  * MatchDataFormat()
  15.  *
  16.  * @param string $keywords 
  17.  * @param string $searchtype 
  18.  * @return string $formatted_keywords
  19.  */
  20. if(!function_exists('MatchDataFormat')) {
  21.  
  22.   function MatchDataFormat($keywords$searchtype)
  23.   {
  24.     $keywords trim(addslashes($keywords));
  25.     switch ($searchtype{
  26.       case 'one':
  27.         if(strtolower(SQL)=='pgsql'{
  28.           $words explode(' '$keywords);
  29.           $formatted_keywords '';
  30.           $op='';
  31.           foreach($words as $value{
  32.             $formatted_keywords .= $op $value;
  33.             $op=' | ';
  34.           }
  35.           trim($formatted_keywords);
  36.         }
  37.         if(strtolower(SQL)=='mysql'{
  38.           $formatted_keywords $keywords;
  39.         }
  40.         break;
  41.       case 'all':
  42.         $words explode(' '$keywords);
  43.         $formatted_keywords '';
  44.         $op='';
  45.         foreach($words as $value{
  46.           $formatted_keywords .= $op $value;
  47.           if(strtolower(SQL)=='pgsql'$op=' & ';
  48.           if(strtolower(SQL)=='mysql'$op=' + ';
  49.         }
  50.         trim($formatted_keywords);
  51.         break;
  52.       case 'exp':
  53.         if(strtolower(SQL)=='pgsql'{
  54.           $words explode(' '$keywords);
  55.           $formatted_keywords '';
  56.           $op='';
  57.           foreach($words as $value{
  58.             $formatted_keywords .= $op $value;
  59.             $op=' & ';
  60.           }
  61.           trim($formatted_keywords);
  62.         }
  63.         if(strtolower(SQL)=='mysql'{
  64.           $formatted_keywords '"' $keywords '"';
  65.         }
  66.         break;
  67.       default:
  68.         if(strtolower(SQL)=='pgsql'{
  69.           $words explode(' '$keywords);
  70.           $formatted_keywords '';
  71.           $op='';
  72.           foreach($words as $value{
  73.             $formatted_keywords .= $op $value;
  74.             $op=' | ';
  75.           }
  76.           trim($formatted_keywords);
  77.         }
  78.         if(strtolower(SQL)=='mysql'{
  79.           $formatted_keywords $keywords;
  80.         }
  81.         break;
  82.     }
  83.     return $formatted_keywords;
  84.   }
  85. }
  86.  
  87. if(!function_exists('GetStatus')) {
  88.  
  89.   function GetStatus($short_status)
  90.   {
  91.     $write ' - ';
  92.     switch ($short_status{
  93.       case 'PA':
  94.         $write .= _t('statut','PA');
  95.         break;
  96.       case 'AA':
  97.         $write .= _t('statut','AA');
  98.         break;
  99.       case 'P':
  100.         $write '';
  101.         break;
  102.       case 'Y':
  103.         $write '';
  104.         break;
  105.       case 'D':
  106.         $write .= _t('statut','draft');
  107.         break;
  108.       default:
  109.         $write '';
  110.     }
  111.     return $write;
  112.   }
  113. }
  114.  
  115. /**
  116.  * DisplayPublicResults()
  117.  *
  118.  * @param string $keywords 
  119.  * @param string $searchtype 
  120.  * @return void (echo)
  121.  ***/
  122. if(!function_exists('DisplayPublicResults')) {
  123.  
  124.   function DisplayPublicResults($keywords$searchtype)
  125.   {
  126.     $type 'PUBLIC';
  127.     if(defined('MOD_PROJECT'&& MOD_PROJECT == trueDisplaySearchProject($keywords$type$searchtype);
  128.     if(defined('MOD_NEWS'&& MOD_NEWS == trueDisplaySearchNews($keywords$type$searchtype);
  129.     //echo '<hr />';
  130.     if(defined('MOD_PUBLICATION'&& MOD_PUBLICATION == trueDisplaySearchPublication($keywords$type$searchtype);
  131.     // echo '<hr />';
  132.     if(defined('MOD_PUBLICATION'&& MOD_PUBLICATION == trueDisplaySearchPubliContents($keywords$type$searchtype);
  133.     //echo '<hr />';
  134.     if(defined('MOD_WORKSHOP'&& MOD_WORKSHOP == trueDisplaySearchWorkshop($keywords$type$searchtype);
  135.     // echo '<hr />';
  136.     if(defined('MOD_WORKSHOP'&& MOD_WORKSHOP == trueDisplaySearchWorkshopRep($keywords$type$searchtype);
  137.     // echo '<hr />';
  138.     if(defined('MOD_WORKSHOP'&& MOD_WORKSHOP == trueDisplaySearchWorkshopRepContents($keywords$type$searchtype);
  139.     // echo '<hr />';
  140.     if(defined('MOD_WORKSHOP'&& MOD_WORKSHOP == trueDisplaySearchWorkshopCalendar($keywords$type$searchtype);
  141.     // echo '<hr />';
  142.     if(defined('MOD_WORKSHOP'&& MOD_WORKSHOP == trueDisplaySearchWorkshopCom($keywords$type$searchtype);
  143.     //echo '<hr />';
  144.     if(defined('MOD_SDI'&& MOD_SDI == trueDisplaySearchSdi($keywords$type$searchtype);
  145.     //echo '<hr />';
  146.     if(defined('MOD_YELLOWPAGES'&& MOD_YELLOWPAGES == trueDisplaySearchYellowpages($keywords$type$searchtype);
  147.   }
  148. }
  149.  
  150. /**
  151.  * DisplaySearchComment()
  152.  * Affiche les projets répondant à la requête sur $keywords
  153.  *
  154.  * @param string $keywords 
  155.  * @return string $content
  156.  */
  157. if(!function_exists('DisplaySearchComment')) {
  158.  
  159.   function DisplaySearchComment($keywords$type$searchtype)
  160.   {
  161.     $data $GLOBALS['sql_object']->DBSelect(SQL_comment_search(MatchDataFormat($keywords$searchtype)$type));
  162.     
  163.     // no search on comments from public app
  164.     if($type == 'PUBLIC'return true;
  165.     
  166.     $content '<div id="MatchComment">';
  167.     $content .= '<h3>' _t('search','comment_module''</h3>' END_LINE;
  168.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  169.     else {
  170.       $content .= '<ul>' END_LINE;
  171.       for($i 0$i count($data)$i++{
  172.         if ($type == 'PUBLIC'{
  173.           $link HrefMaker(array('rub' => $GLOBALS['links'][U_L]['project']['linkvalue']'id' => $data[$i]['project_id']'name' => $data[$i]['project_name']));
  174.           $published_display _t('statut','published_on'' ' $data[$i]['date_display'];
  175.         }
  176.         if ($type == 'ADMIN'{
  177.           $link 'index.php?rub=comment&amp;todo=det&amp;id=' $data[$i]['comment_id'];
  178.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  179.         }
  180.         if(!empty($data[$i]['comment_name'])) $uname formatText($data[$i]['comment_name']'2HTML');
  181.         else $uname formatText($data[$i]['user_login']'2HTML');
  182.         
  183.         $title $data[$i]['comment_body'];
  184.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  185.  
  186.         $content .= '<li class="matches">' END_LINE;
  187.         $content .= '<a href="' $link '" title="' formatText(cutText($title300)'2ATT''" >' formatText(cutText($title200)'2HTML''</a>';
  188.         $content .= '<br />';
  189.         $content .= '<span class="infocomp">' ._t('divers''by')' '$uname .' - '$published_display GetStatus($data[$i]['comment_status']'</span>';
  190.         $content .= $pertinence;
  191.         $content .= '</li>' END_LINE;
  192.       }
  193.       $content .= '</ul>' END_LINE;
  194.     }
  195.     $content .= '</div>' END_LINE;
  196.     echo $content;
  197.   }
  198. }
  199.  
  200. /**
  201.  * DisplaySearchProject()
  202.  * Affiche les projets répondant à la requête sur $keywords
  203.  *
  204.  * @param string $keywords 
  205.  * @return string $content
  206.  */
  207. if(!function_exists('DisplaySearchProject')) {
  208.  
  209.   function DisplaySearchProject($keywords$type$searchtype)
  210.   {
  211.     $data $GLOBALS['sql_object']->DBSelect(SQL_project_search(MatchDataFormat($keywords$searchtype)$type));
  212.  
  213.     $content '<div id="MatchProject">';
  214.     $content .= '<h3>' _t('search','project_module''</h3>' END_LINE;
  215.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  216.     else {
  217.       $content .= '<ul>' END_LINE;
  218.       for($i 0$i count($data)$i++{
  219.         if ($type == 'PUBLIC'{
  220.           $link_news HrefMaker(array('rub' => $GLOBALS['links'][U_L]['project']['linkvalue']'id' => $data[$i]['project_id']'name' => $data[$i]['project_name']));
  221.           $published_display _t('statut','published_on'' ' $data[$i]['date_display'];
  222.         }
  223.         if ($type == 'ADMIN'{
  224.           $link_news 'index.php?rub=project&amp;todo=det&amp;id=' $data[$i]['project_id'];
  225.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  226.         }
  227.  
  228.         $news_title formatText($data[$i]['project_name']'2HTML');
  229.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  230.  
  231.         $content .= '<li class="matches">' END_LINE;
  232.         $content .= '<a href="' $link_news '" title="' formatText($GLOBALS['links'][U_L]['project']['desc'' : ' $news_title'2ATT''" >' $news_title '</a>';
  233.         $content .= '<br />';
  234.         $content .= '<span class="infocomp">' $published_display GetStatus($data[$i]['statut']'</span>';
  235.         $content .= $pertinence;
  236.         $content .= '</li>' END_LINE;
  237.       }
  238.       $content .= '</ul>' END_LINE;
  239.     }
  240.     $content .= '</div>' END_LINE;
  241.     echo $content;
  242.   }
  243. }
  244.  
  245. /**
  246.  * DisplaySearchPage()
  247.  * Affiche les pages répondant à la requête sur $keywords
  248.  *
  249.  * @param string $keywords 
  250.  * @return string $content
  251.  */
  252. if(!function_exists('DisplaySearchPage')) {
  253.  
  254.     function DisplaySearchPage($keywords$type$searchtype)
  255.     {
  256.         $data $GLOBALS['sql_object']->DBSelect(SQL_page_search(MatchDataFormat($keywords$searchtype)$type));
  257.  
  258.         $content '<div id="MatchNews">';
  259.         $content .= '<h3>' _t('search','page_module''</h3>' END_LINE;
  260.         if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  261.         else {
  262.             $content .= '<ul>' END_LINE;
  263.             for($i 0$i count($data)$i++{
  264. // @todo see if necessary to implement or not                
  265. //                 if ($type == 'PUBLIC') {
  266. //                     $link = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['page']['linkvalue'], 'id' => $data[$i]['news_id'], 'name' => $data[$i]['news_title']));
  267. //                     $published_display = _t('statut','published_on') . ' ' . $data[$i]['date_display'];
  268. //                 }
  269.                 if ($type == 'ADMIN'{
  270.                     $link 'index.php?rub=page&amp;todo=det&amp;id=' $data[$i]['page_id'];
  271.                     $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  272.                 }
  273.  
  274.                 $title formatText($data[$i]['page_title']'2HTML');
  275.                 $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  276.  
  277.                 $content .= '<li class="matches">' END_LINE;
  278.                 $content .= '<a href="' $link '" title="' formatText($GLOBALS['links'][U_L]['news']['desc'' : ' $title'2ATT''" >' $title '</a>';
  279.                 $content .= '<br />';
  280.                 $content .= '<span class="infocomp">' $published_display GetStatus($data[$i]['statut']'</span>';
  281.                 $content .= $pertinence;
  282.                 $content .= '</li>' END_LINE;
  283.             }
  284.             $content .= '</ul>' END_LINE;
  285.         }
  286.         $content .= '</div>' END_LINE;
  287.         echo $content;
  288.     }
  289. }
  290.  
  291. /**
  292.  * DisplaySearchNews()
  293.  * Affiche les news répondant à la requête sur $keywords
  294.  *
  295.  * @param string $keywords 
  296.  * @return string $content
  297.  */
  298. if(!function_exists('DisplaySearchNews')) {
  299.  
  300.   function DisplaySearchNews($keywords$type$searchtype)
  301.   {
  302.     $data $GLOBALS['sql_object']->DBSelect(SQL_news_search(MatchDataFormat($keywords$searchtype)$type));
  303.  
  304.     $content '<div id="MatchNews">';
  305.     $content .= '<h3>' _t('search','news_module''</h3>' END_LINE;
  306.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  307.     else {
  308.       $content .= '<ul>' END_LINE;
  309.       for($i 0$i count($data)$i++{
  310.         if ($type == 'PUBLIC'{
  311.           $link_news HrefMaker(array('rub' => $GLOBALS['links'][U_L]['news']['linkvalue']'id' => $data[$i]['news_id']'name' => $data[$i]['news_title']));
  312.           $published_display _t('statut','published_on'' ' $data[$i]['date_display'];
  313.         }
  314.         if ($type == 'ADMIN'{
  315.           $link_news 'index.php?rub=news&amp;todo=det&amp;id=' $data[$i]['news_id'];
  316.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  317.         }
  318.  
  319.         $news_title formatText($data[$i]['news_title']'2HTML');
  320.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  321.  
  322.         $content .= '<li class="matches">' END_LINE;
  323.         $content .= '<a href="' $link_news '" title="' formatText($GLOBALS['links'][U_L]['news']['desc'' : ' $news_title'2ATT''" >' $news_title '</a>';
  324.         $content .= '<br />';
  325.         $content .= '<span class="infocomp">' $published_display GetStatus($data[$i]['statut']'</span>';
  326.         $content .= $pertinence;
  327.         $content .= '</li>' END_LINE;
  328.       }
  329.       $content .= '</ul>' END_LINE;
  330.     }
  331.     $content .= '</div>' END_LINE;
  332.     echo $content;
  333.   }
  334. }
  335.  
  336. /**
  337.  * DisplaySearchNews()
  338.  * Affiche les news répondant à la requête sur $keywords
  339.  *
  340.  * @param string $keywords 
  341.  * @return string $content
  342.  */
  343. if(!function_exists('DisplaySearchNewsletter')) {
  344.  
  345.   function DisplaySearchNewsletter($keywords$type$searchtype)
  346.   {
  347.     $data $GLOBALS['sql_object']->DBSelect(SQL_newsletter_search(MatchDataFormat($keywords$searchtype)$type));
  348.  
  349.     $content '<div id="MatchNewsletter">';
  350.     $content .= '<h3>' _t('search','newsletter_module''</h3>' END_LINE;
  351.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  352.     else {
  353.       $content .= '<ol>' END_LINE;
  354.       for($i 0$i count($data)$i++{
  355.         /**
  356.          * * NON IMPLEMENTE
  357.          * if ($type == 'PUBLIC') {
  358.          * $link_news = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['news']['linkvalue'], 'id' => $data[$i]['news_id']));
  359.          * $published_display = _t('statut','published_on') . ' ' . $data[$i]['date_display'];
  360.          * }
  361.          */
  362.  
  363.         if ($type == 'ADMIN'{
  364.           $link_newsletter 'index.php?rub=newsletter&amp;todo=det&amp;id=' $data[$i]['newsletter_id'];
  365.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  366.         }
  367.         $newsletter_title formatText($data[$i]['newsletter_title']'2HTML');
  368.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  369.  
  370.         $content .= '<li class="matches">' END_LINE;
  371.         $content .= '<a href="' $link_newsletter '" title="' formatText($newsletter_title'2ATT''" >' $newsletter_title '</a>';
  372.         $content .= '<br />';
  373.         $content .= '<span class="infocomp">' $published_display GetStatus($data[$i]['statut']'</span>';
  374.         $content .= $pertinence;
  375.         $content .= '</li>' END_LINE;
  376.       }
  377.       $content .= '</ol>' END_LINE;
  378.     }
  379.     $content .= '</div>' END_LINE;
  380.     echo $content;
  381.   }
  382. }
  383.  
  384. /**
  385.  * DisplaySearchPublication()
  386.  * Affiche les publications répondant à la requête sur $keywords
  387.  * Requête éffectuée sur le titre et le résumé des publications
  388.  *
  389.  * @param string $keywords 
  390.  * @return string $content
  391.  */
  392. if(!function_exists('DisplaySearchPublication')) {
  393.  
  394.   function DisplaySearchPublication($keywords$type$searchtype)
  395.   {
  396.     $data $GLOBALS['sql_object']->DBSelect(SQL_publication_search(MatchDataFormat($keywords$searchtype)$type));
  397.  
  398.     $content '<div id="MatchPubli">';
  399.     $content .= '<h3>' _t('search','publication_module''</h3>' END_LINE;
  400.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  401.     else {
  402.       $content .= '<ul>' END_LINE;
  403.       for($i 0$i count($data)$i++{
  404.         if ($type == 'PUBLIC'{
  405.           $link_publi HrefMaker(array('rub' => $GLOBALS['links'][U_L]['publication']['linkvalue']'id' => $data[$i]['publi_id']'name' => $data[$i]['publi_title']));
  406.           $published_display _t('statut','published_on'' ' $data[$i]['date_display'];
  407.         }
  408.         if ($type == 'ADMIN'{
  409.           $link_publi 'index.php?rub=publication&amp;todo=det&amp;id=' $data[$i]['publi_id'];
  410.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  411.         }
  412.  
  413.         $publi_title formatText($data[$i]['publi_title']'2HTML');
  414.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  415.  
  416.         $content .= '<li class="matches">' END_LINE;
  417.         $content .= '<a href="' $link_publi '" title="' formatText($GLOBALS['links'][U_L]['publication']['desc'' : ' $publi_title'2ATT''" >' $publi_title '</a>';
  418.         $content .= '<br />';
  419.         $content .= '<span class="infocomp">' $published_display GetStatus($data[$i]['statut']'</span>';
  420.         $content .= $pertinence;
  421.         $content .= '</li>' END_LINE;
  422.       }
  423.       $content .= '</ul>' END_LINE;
  424.     }
  425.     $content .= '</div>' END_LINE;
  426.     echo $content;
  427.   }
  428. }
  429.  
  430. /**
  431.  * DisplaySearchPubliContents()
  432.  * Affiche les publications répondant à la requête sur $keywords
  433.  * Requête éffectuée sur le contenu des publications ( titre & body )
  434.  *
  435.  * @param string $keywords 
  436.  * @return string $content
  437.  */
  438. if(!function_exists('DisplaySearchPubliContents')) {
  439.  
  440.   function DisplaySearchPubliContents($keywords$type$searchtype)
  441.   {
  442.     $data $GLOBALS['sql_object']->DBSelect(SQL_publication_content_search(MatchDataFormat($keywords$searchtype)$type));
  443.  
  444.     $content '<div id="MatchPubliContents">';
  445.     $content .= '<h4>' _t('search','det_publication_module''</h4>' END_LINE;
  446.     //if (count($data) == 1 && $data == 0) $content .= '<p>' . _t('search','no_result') . '</p>' . END_LINE;
  447.     if (count($data== && $data == 0return true;
  448.     else {
  449.       $content .= '<ul>' END_LINE;
  450.       for($i 0$i count($data)$i++{
  451.         if ($type == 'PUBLIC'{
  452.           $link_publi_det HrefMaker(array('rub' => $GLOBALS['links'][U_L]['publication-part']['linkvalue']'id' => $data[$i]['publicon_id']'parentid' => $data[$i]['publi_id']'name' => $data[$i]['publicon_title']));
  453.           $link_publi HrefMaker(array('rub' => $GLOBALS['links'][U_L]['publication']['linkvalue']'id' => $data[$i]['publi_id']'name' => $data[$i]['publi_title']));
  454.           $published_display _t('statut','published_on'' ' $data[$i]['date_display'];
  455.         }
  456.         if ($type == 'ADMIN'{
  457.           $link_publi_det 'index.php?rub=contents&amp;todo=det&amp;parent=' $data[$i]['publi_id''&amp;type=P&amp;id=' $data[$i]['publicon_id'];
  458.           $link_publi 'index.php?rub=publication&amp;todo=det&amp;id=' $data[$i]['publi_id'];
  459.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  460.         }
  461.  
  462.         $publicon_title formatText($data[$i]['publicon_title']'2HTML');
  463.         $publi_title formatText($data[$i]['publi_title']'2HTML');
  464.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  465.  
  466.         $content .= '<li class="matches">' END_LINE;
  467.         $content .= '<a href="' $link_publi_det '" title="' formatText($GLOBALS['links'][U_L]['publication-part']['desc'' : ' $publicon_title'2ATT''" >' $publicon_title '</a>';
  468.         $content .= '<br />';
  469.         $content .= '<span class="infocomp">' _t('name','publication_module'' : ';
  470.         $content .= '<a href="' $link_publi '" title="' formatText($GLOBALS['links'][U_L]['publication']['desc'' : ' $publi_title'2ATT''" >' $publi_title '</a>';
  471.         $content .= ' - ' $published_display GetStatus($data[$i]['statut']);
  472.         $content .= '</span>';
  473.         $content .= $pertinence;
  474.         $content .= '</li>' END_LINE;
  475.       }
  476.       $content .= '</ul>' END_LINE;
  477.     }
  478.     $content .= '</div>' END_LINE;
  479.     echo $content;
  480.   }
  481. }
  482.  
  483. /**
  484.  * DisplaySearchWorkshop()
  485.  * Affiche les groupes de travail répondant à la requête sur $keywords
  486.  * Requête éffectuée sur le libellé et le résumé des groupes de travail
  487.  *
  488.  * @param string $keywords 
  489.  * @return string $content
  490.  */
  491. if(!function_exists('DisplaySearchWorkshop')) {
  492.  
  493.   function DisplaySearchWorkshop($keywords$type$searchtype)
  494.   {
  495.     $data $GLOBALS['sql_object']->DBSelect(SQL_workshop_search(MatchDataFormat($keywords$searchtype)$type));
  496.  
  497.     $content '<div id="MatchWorkshop">';
  498.     $content .= '<h3>' _t('search','workshop_module''</h3>' END_LINE;
  499.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  500.     else {
  501.       $content .= '<ul>' END_LINE;
  502.       for($i 0$i count($data)$i++{
  503.         if ($type == 'PUBLIC'{
  504.           $link_workshop HrefMaker(array('rub' => $GLOBALS['links'][U_L]['workgroup']['linkvalue']'id' => $data[$i]['workshop_id']'name' => $data[$i]['workshop_denomination']));
  505.         }
  506.         if ($type == 'ADMIN'{
  507.           $link_workshop 'index.php?rub=workshop&amp;todo=det&amp;id=' $data[$i]['workshop_id'];
  508.         }
  509.  
  510.         $workshop_title formatText($data[$i]['workshop_denomination']'2HTML');
  511.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  512.  
  513.         $content .= '<li class="matches">' END_LINE;
  514.         $content .= '<a href="' $link_workshop '" title="' formatText($GLOBALS['links'][U_L]['workgroup']['desc'' : ' $workshop_title'2ATT''" >' $workshop_title '</a>';
  515.         $statut GetStatus($data[$i]['statut']);
  516.         if (!empty($statut)) $content .= '<span class="infocomp">(' $statut ')</span>';
  517.         $content .= $pertinence;
  518.         $content .= '</li>' END_LINE;
  519.       }
  520.       $content .= '</ul>' END_LINE;
  521.     }
  522.     $content .= '</div>' END_LINE;
  523.     echo $content;
  524.   }
  525. }
  526.  
  527. /**
  528.  * DisplaySearchWorkshopRep()
  529.  * Affiche les groupes de travail répondant à la requête sur $keywords
  530.  * Requête éffectuée sur le contenu des rapports de groupes de travail ( titre & body )
  531.  *
  532.  * @param string $keywords 
  533.  * @return string $content
  534.  */
  535. if(!function_exists('DisplaySearchWorkshopRep')) {
  536.  
  537.   function DisplaySearchWorkshopRep($keywords$type$searchtype)
  538.   {
  539.     $data $GLOBALS['sql_object']->DBSelect(SQL_workrep_search(MatchDataFormat($keywords$searchtype)$type));
  540.  
  541.     $content '<div id="MatchWorkshopRep">';
  542.     $content .= '<h4>' _t('search','workshoprep_module''</h4>' END_LINE;
  543.     //if (count($data) == 1 && $data == 0) $content .= '<p>' . _t('search','no_result') . '</p>' . END_LINE;
  544.     if (count($data== && $data == 0return true;
  545.     else {
  546.       $content .= '<ul>' END_LINE;
  547.       for($i 0$i count($data)$i++{
  548.         if ($type == 'PUBLIC'{
  549.           $link_workrep HrefMaker(array('rub' => $GLOBALS['links'][U_L]['report']['linkvalue']'id' => $data[$i]['workrep_id']'name' => $data[$i]['workrep_title']));
  550.           $link_workshop HrefMaker(array('rub' => $GLOBALS['links'][U_L]['workgroup']['linkvalue']'id' => $data[$i]['workshop_id']'name' => $data[$i]['workshop_denomination']));
  551.           $published_display _t('statut','published_on'' ' $data[$i]['date_display'];
  552.         }
  553.         if ($type == 'ADMIN'{
  554.           $link_workrep 'index.php?rub=workshoprep&amp;todo=det&amp;id=' $data[$i]['workrep_id'];
  555.           $link_workshop 'index.php?rub=workshop&amp;todo=det&amp;id=' $data[$i]['workshop_id'];
  556.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  557.         }
  558.  
  559.         $workrep_title formatText($data[$i]['workrep_title']'2HTML');
  560.         $workshop_title formatText($data[$i]['workshop_denomination']'2HTML');
  561.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  562.         $published_display $data[$i]['date_display'];
  563.  
  564.         $content .= '<li class="matches">' END_LINE;
  565.         $content .= '<a href="' $link_workrep '" title="' formatText($GLOBALS['links'][U_L]['report']['desc'' : ' $workrep_title'2ATT''" >' $workrep_title '</a>';
  566.         $content .= '<br />';
  567.         $content .= '<span class="infocomp">(' _t('name','workshop_module'' : ';
  568.         $content .= '<a href="' $link_workshop '" title="' formatText($GLOBALS['links'][U_L]['workgroup']['desc'' : ' $workshop_title'2ATT''" >' $workshop_title '</a>';
  569.         $content .= ' - ' $published_display GetStatus($data[$i]['statut']')';
  570.         $content .= '</span>';
  571.         $content .= $pertinence;
  572.         $content .= '</li>' END_LINE;
  573.       }
  574.       $content .= '</ul>' END_LINE;
  575.     }
  576.     $content .= '</div>' END_LINE;
  577.     echo $content;
  578.   }
  579. }
  580.  
  581. /**
  582.  * DisplaySearchWorkshopRepContents()
  583.  * Affiche les groupes de travail répondant à la requête sur $keywords
  584.  * Requête éffectuée sur le contenu des rapports de groupes de travail ( titre & body )
  585.  *
  586.  * @param string $keywords 
  587.  * @return string $content
  588.  */
  589. if(!function_exists('DisplaySearchWorkshopRepContents')) {
  590.  
  591.   function DisplaySearchWorkshopRepContents($keywords$type$searchtype)
  592.   {
  593.     $data $GLOBALS['sql_object']->DBSelect(SQL_workrep_content_search(MatchDataFormat($keywords$searchtype)$type));
  594.  
  595.     $content '<div id="MatchWorkshopContents">';
  596.     $content .= '<h5>' _t('search','workshoprepcon_module''</h5>' END_LINE;
  597.     //if (count($data) == 1 && $data == 0) $content .= '<p>' . _t('search','no_result') . '</p>' . END_LINE;
  598.     if (count($data== && $data == 0return true;
  599.     else {
  600.       $content .= '<ul>' END_LINE;
  601.       for($i 0$i count($data)$i++{
  602.         if ($type == 'PUBLIC'{
  603.           $link_workrep_det HrefMaker(array('rub' => $GLOBALS['links'][U_L]['report-part']['linkvalue']'id' => $data[$i]['workrepcon_id']'parentid' => $data[$i]['workrep_id']'name' => $data[$i]['workrepcon_title']));
  604.           $link_workrep HrefMaker(array('rub' => $GLOBALS['links'][U_L]['report']['linkvalue']'id' => $data[$i]['workrep_id']'name' => $data[$i]['workrep_title']));
  605.           $published_display _t('statut','published_on'' ' $data[$i]['date_display'];
  606.         }
  607.         if ($type == 'ADMIN'{
  608.           $link_workrep_det 'index.php?rub=contents&amp;todo=det&amp;parent=' $data[$i]['workrep_id''&amp;type=W&amp;id=' $data[$i]['workrepcon_id'];
  609.           $link_workrep 'index.php?rub=workshoprep&amp;todo=det&amp;id=' $data[$i]['workrep_id'];
  610.           $published_display _t('divers','date_crea'' ' $data[$i]['date_display'];
  611.         }
  612.  
  613.         $workrepcon_title formatText($data[$i]['workrepcon_title']'2HTML');
  614.         $workrep_title formatText($data[$i]['workrep_title']'2HTML');
  615.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  616.  
  617.         $content .= '<li class="matches">' END_LINE;
  618.         $content .= '<a href="' $link_workrep_det '" title="' formatText($GLOBALS['links'][U_L]['publication-part']['desc'' : ' $workrepcon_title'2ATT''" >' $workrepcon_title '</a>';
  619.         $content .= '<br />';
  620.         $content .= '<span class="infocomp">(' _t('name','workshoprep_module'' : ';
  621.         $content .= '<a href="' $link_workrep '" title="' formatText($GLOBALS['links'][U_L]['report']['desc'' : ' $workrep_title'2ATT''" >' $workrep_title '</a>';
  622.         $content .= ' - ' $published_display GetStatus($data[$i]['statut']')';
  623.         $content .= '</span>';
  624.         $content .= $pertinence;
  625.         $content .= '</li>' END_LINE;
  626.       }
  627.       $content .= '</ul>' END_LINE;
  628.     }
  629.     $content .= '</div>' END_LINE;
  630.     echo $content;
  631.   }
  632. }
  633.  
  634. /**
  635.  * DisplaySearchWorkshopCalendar()
  636.  * Affiche les groupes de travail répondant à la requête sur $keywords
  637.  * Requête éffectuée sur les tâches du calendrier de groupes de travail ( libellé & contenu des tâches )
  638.  *
  639.  * @param string $keywords 
  640.  * @return string $content
  641.  */
  642. if(!function_exists('DisplaySearchWorkshopCalendar')) {
  643.  
  644.   function DisplaySearchWorkshopCalendar($keywords$type$searchtype)
  645.   {
  646.     $data $GLOBALS['sql_object']->DBSelect(SQL_workshop_calendar_search(MatchDataFormat($keywords$searchtype)$type));
  647.  
  648.     $content '<div id="MatchWorkshopCal">';
  649.     $content .= '<h4>' _t('search','workshopcal_module''</h4>' END_LINE;
  650.     //if (count($data) == 1 && $data == 0) $content .= '<p>' . _t('search','no_result') . '</p>' . END_LINE;
  651.     if (count($data== && $data == 0return true;
  652.     else {
  653.       $content .= '<ul>' END_LINE;
  654.       for($i 0$i count($data)$i++{
  655.         if ($type == 'PUBLIC'{
  656.           $link_workcal HrefMaker(array('rub' => $GLOBALS['links'][U_L]['calendar']['linkvalue']'id' => $data[$i]['workcal_workshop_id']'name' => $data[$i]['workcal_task']));
  657.           $link_workshop HrefMaker(array('rub' => $GLOBALS['links'][U_L]['workgroup']['linkvalue']'id' => $data[$i]['workcal_workshop_id']'name' => $data[$i]['workshop_denomination']));
  658.         }
  659.         if ($type == 'ADMIN'{
  660.           $link_workcal 'index.php?rub=workshop&amp;todo=list_cal&amp;id=' $data[$i]['workcal_workshop_id'];
  661.           $link_workshop 'index.php?rub=workshop&amp;todo=det&amp;id=' $data[$i]['workcal_workshop_id'];
  662.         }
  663.  
  664.         $workcal_title formatText($data[$i]['workcal_task']'2HTML');
  665.         $workshop_title formatText($data[$i]['workshop_denomination']'2HTML');
  666.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  667.  
  668.         $content .= '<li class="matches">' END_LINE;
  669.         $content .= '<a href="' $link_workcal '" title="' formatText($GLOBALS['links'][U_L]['calendar']['desc'' : ' $workcal_title'2ATT''" >' $workcal_title '</a>';
  670.         $content .= '<br />';
  671.         $content .= '<span class="infocomp">(' _t('name','workshop_module'' : ';
  672.         $content .= '<a href="' $link_workshop '" title="' formatText($GLOBALS['links'][U_L]['workgroup']['desc'' : ' $workshop_title'2ATT''" >' $workshop_title '</a>';
  673.         if (!empty($statut)) $content .= $statut;
  674.         $content .= ')';
  675.         $content .= '</span>';
  676.         $content .= $pertinence;
  677.         $content .= '</li>' END_LINE;
  678.       }
  679.       $content .= '</ul>' END_LINE;
  680.     }
  681.     $content .= '</div>' END_LINE;
  682.     echo $content;
  683.   }
  684. }
  685.  
  686. /**
  687.  * DisplaySearchWorkshopCom()
  688.  * Affiche les groupes de travail répondant à la requête sur $keywords
  689.  * Requête éffectuée sur les discussions du calendrier de groupes de travail ( titre & contenu )
  690.  *
  691.  * @param string $keywords 
  692.  * @return string $content
  693.  */
  694. if(!function_exists('DisplaySearchWorkshopCom')) {
  695.  
  696.   function DisplaySearchWorkshopCom($keywords$type$searchtype)
  697.   {
  698.     $data $GLOBALS['sql_object']->DBSelect(SQL_workshop_com_search(MatchDataFormat($keywords$searchtype)$type));
  699.  
  700.     $content '<div id="MatchWorkshopCom">';
  701.     $content .= '<h4>' _t('search','workshopcom_module''</h4>' END_LINE;
  702.     //if (count($data) == 1 && $data == 0) $content .= '<p>' . _t('search','no_result') . '</p>' . END_LINE;
  703.     if (count($data== && $data == 0return true;
  704.     else {
  705.       $content .= '<ul>' END_LINE;
  706.       for($i 0$i count($data)$i++{
  707.         if ($data[$i]['workcom_parent'!= 0$id_com $data[$i]['workcom_parent'];
  708.         else $id_com $data[$i]['workcom_id';
  709.         if ($type == 'PUBLIC'{
  710.           $link_workcom HrefMaker(array('rub' => $GLOBALS['links'][U_L]['topic']['linkvalue']'id' => $id_com'parentid' => $data[$i]['workcom_workshop_id']'name' => $data[$i]['workcom_subject']));
  711.           $link_workshop HrefMaker(array('rub' => $GLOBALS['links'][U_L]['workgroup']['linkvalue']'id' => $data[$i]['workcom_workshop_id']'name' => $data[$i]['workshop_denomination']));
  712.         }
  713.         if ($type == 'ADMIN'{
  714.           $link_workcom 'index.php?rub=workshop&amp;todo=det_com&amp;id=' $data[$i]['workcom_workshop_id''&amp;com_id=' $id_com;
  715.           $link_workshop 'index.php?rub=workshop&amp;todo=det&amp;id=' $data[$i]['workcom_workshop_id'];
  716.         }
  717.  
  718.         $workcom_title formatText($data[$i]['workcom_subject']'2HTML');
  719.         $workshop_title formatText($data[$i]['workshop_denomination']'2HTML');
  720.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  721.  
  722.         if ($type == 'ADMIN' || ($type == 'PUBLIC' && $GLOBALS['l21auth']->isWorkgroupUser($data[$i]['workcom_workshop_id']$GLOBALS['sql_object']))) {
  723.           $content .= '<li class="matches">' END_LINE;
  724.           $content .= '<a href="' $link_workcom '" title="' formatText($GLOBALS['links'][U_L]['topic']['desc'' : ' $workcom_title'2ATT''" >' $workcom_title '</a>';
  725.           $content .= '<br />';
  726.           $content .= '<span class="infocomp">(' _t('name','workshop_module'' : ';
  727.           $content .= '<a href="' $link_workshop '" title="' formatText($GLOBALS['links'][U_L]['workgroup']['desc'' : ' $workshop_title'2ATT''" >' $workshop_title '</a>';
  728.           if (!empty($statut)) $content .= $statut;
  729.           $content .= ')';
  730.           $content .= '</span>';
  731.           $content .= $pertinence;
  732.           $content .= '</li>' END_LINE;
  733.         else $content .= '';
  734.       }
  735.       $content .= '</ul>' END_LINE;
  736.  
  737.       if ($content == '<ul></ul>'return '';
  738.     }
  739.     $content .= '</div>' END_LINE;
  740.  
  741.     echo $content;
  742.   }
  743. }
  744.  
  745. /**
  746.  * DisplaySearchSdi()
  747.  * Affiche les indicateurs répondant à la requête sur $keywords
  748.  * Requête éffectuée sur les informations générales des indicateurs
  749.  *
  750.  * @param string $keywords 
  751.  * @return string $content
  752.  */
  753. if(!function_exists('DisplaySearchSdi')) {
  754.  
  755.   function DisplaySearchSdi($keywords$type$searchtype)
  756.   {
  757.     $data $GLOBALS['sql_object']->DBSelect(SQL_sdi_search(MatchDataFormat($keywords$searchtype)$type));
  758.     
  759.     if(isset($_REQUEST['rub']&& $_REQUEST['rub']=='dashboard'{
  760.         $rub 'dashboard';
  761.     else {
  762.         $rub 'sdi';
  763.     
  764.  
  765.     $content '<div id="MatchSdi">';
  766.     $content .= '<h3>' _t('search','sdi_module''</h3>' END_LINE;
  767.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  768.     else {
  769.       $content .= '<ul>' END_LINE;
  770.       for($i 0$i count($data)$i++{
  771.         if ($type == 'PUBLIC'$link_sdi HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard']['linkvalue']'id' => $data[$i]['sdii_id']'parentid' => 1'name' => $data[$i]['sdii_name']));
  772.         if ($type == 'ADMIN'$link_sdi 'index.php?rub='.$rub.'&amp;todo=det&amp;id=' $data[$i]['sdii_id'];
  773.  
  774.         $news_title formatText($data[$i]['sdii_name']'2HTML');
  775.         $pertinence FormatPertinenceIndice($data[$i]['pertinence']);
  776.         $published_display $data[$i]['date_display'];
  777.  
  778.         $content .= '<li class="matches">' END_LINE;
  779.         $content .= '<a href="' $link_sdi '" title="' formatText($GLOBALS['links'][U_L]['dashboard']['desc'' : ' $news_title'2ATT''" >' $news_title '</a>';
  780.         $content .= '<br />';
  781.         $content .= '<span class="infocomp">( ' _t('statut','published_on'' ' $published_display GetStatus($data[$i]['statut']')</span>';
  782.         $content .= $pertinence;
  783.         $content .= '</li>' END_LINE;
  784.       }
  785.       $content .= '</ul>' END_LINE;
  786.     }
  787.     $content .= '</div>' END_LINE;
  788.     echo $content;
  789.   }
  790. }
  791.  
  792. /**
  793.  * DisplaySearchYellowpages()
  794.  * Affiche les organisations de l'annuaire répondant à la requête sur $keywords
  795.  *
  796.  * @param string $keywords 
  797.  * @return string $content
  798.  */
  799. if(!function_exists('DisplaySearchYellowpages')) {
  800.  
  801.   function DisplaySearchYellowpages($keywords$type$searchtype)
  802.   {
  803.     $data $GLOBALS['sql_object']->DBSelect(SQL_yellowpages_search(MatchDataFormat($keywords$searchtype)$type$searchtype));
  804.  
  805.     $content '<div id="MatchYellowpages">';
  806.     $content .= '<h3>' _t('search','yellowpages_module''</h3>' END_LINE;
  807.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  808.     else {
  809.       $content .= '<ul>' END_LINE;
  810.       for($i 0$i count($data)$i++{
  811.         if ($type == 'PUBLIC'$link_yp HrefMaker(array('rub' => $GLOBALS['links'][U_L]['directory-detail']['linkvalue']'id' => $data[$i]['yellowp_id']'name' => $data[$i]['yellowp_name']));
  812.         if ($type == 'ADMIN'$link_yp 'index.php?rub=yellowpages&amp;todo=det&amp;id=' $data[$i]['yellowp_id'];
  813.  
  814.         $yp_title formatText($data[$i]['yellowp_name']'2HTML');
  815.         $pertinence _t('divers','none');
  816.         $published_display $data[$i]['date_display'];
  817.  
  818.         $content .= '<li class="matches">' END_LINE;
  819.         $content .= '<a href="' $link_yp '" title="' formatText($GLOBALS['links'][U_L]['directory-detail']['desc'' : ' $yp_title'2ATT''" >' $yp_title '</a>';
  820.         $content .= '<span class="infocomp">(' _t('divers','date_crea'' : ' $published_display GetStatus($data[$i]['statut']')</span>';
  821.         $content .= '</li>' END_LINE;
  822.       }
  823.       $content .= '</ul>' END_LINE;
  824.     }
  825.     $content .= '</div>' END_LINE;
  826.     echo $content;
  827.   }
  828. }
  829.  
  830. /**
  831.  * DisplaySearchUser()
  832.  * Affiche les utilisateurs répondant à la requête sur $keywords
  833.  *
  834.  * @param string $keywords 
  835.  * @return string $content
  836.  */
  837. if(!function_exists('DisplaySearchUser')) {
  838.  
  839.   function DisplaySearchUser($keywords$type$searchtype)
  840.   {
  841.     $data $GLOBALS['sql_object']->DBSelect(SQL_user_search(MatchDataFormat($keywords$searchtype)$type$searchtype));
  842.  
  843.     $content '<div id="MatchUser">';
  844.     $content .= '<h3>' _t('search','user_module''</h3>' END_LINE;
  845.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  846.     else {
  847.       $content .= '<ul>' END_LINE;
  848.       for($i 0$i count($data)$i++{
  849.         if ($type == 'PUBLIC'$link_user HrefMaker(array('rub' => $GLOBALS['links'][U_L]['user-profile']['linkvalue']'id' => $data[$i]['user_id']'name' => $data[$i]['user_login']));
  850.         if ($type == 'ADMIN'$link_user 'index.php?rub=user&amp;todo=det&amp;id=' $data[$i]['user_id'];
  851.  
  852.         $user_title formatText($data[$i]['user_login']);
  853.         $pertinence _t('divers','none');
  854.         $published_display $data[$i]['date_display'];
  855.  
  856.         $content .= '<li class="matches">' END_LINE;
  857.         $content .= '<a href="' $link_user '" title="' formatText($GLOBALS['links'][U_L]['user-profile']['desc'' : ' $user_title'2ATT''" >' $user_title '</a>';
  858.         $content .= '<span class="infocomp">(' _t('divers','date_crea'' : ' $published_display GetStatus($data[$i]['statut']')</span>';
  859.         $content .= '</li>' END_LINE;
  860.       }
  861.       $content .= '</ul>' END_LINE;
  862.     }
  863.     $content .= '</div>' END_LINE;
  864.     echo $content;
  865.   }
  866. }
  867.  
  868. /**
  869.  * DisplaySearchTheme()
  870.  * Affiche les theme répondant à la requête sur $keywords
  871.  *
  872.  * @param string $keywords 
  873.  * @return string $content
  874.  */
  875. if(!function_exists('DisplaySearchTheme')) {
  876.  
  877.   function DisplaySearchTheme($keywords$type$searchtype)
  878.   {
  879.     $data $GLOBALS['sql_object']->DBSelect(SQL_theme_search(MatchDataFormat($keywords$searchtype)$type$searchtype));
  880.  
  881.     $content '<div id="MatchTheme">';
  882.     $content .= '<h3>' _t('search','theme_module''</h3>' END_LINE;
  883.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  884.     else {
  885.       $content .= '<ul>' END_LINE;
  886.       for($i 0$i count($data)$i++{
  887.         if ($type == 'ADMIN'$link_theme 'index.php?rub=theme&amp;todo=det&amp;id=' $data[$i]['theme_id'];
  888.  
  889.         $theme_title formatText($data[$i]['theme_name']);
  890.         $pertinence _t('divers','none');
  891.         $published_display $data[$i]['date_display'];
  892.  
  893.         $content .= '<li class="matches">' END_LINE;
  894.         $content .= '<a href="' $link_theme '">' $theme_title '</a>';
  895.         $content .= '<span class="infocomp">(' _t('divers','date_crea'' : ' $published_display GetStatus($data[$i]['statut']')</span>';
  896.         $content .= '</li>' END_LINE;
  897.       }
  898.       $content .= '</ul>' END_LINE;
  899.     }
  900.     $content .= '</div>' END_LINE;
  901.     echo $content;
  902.   }
  903. }
  904.  
  905. /**
  906.  * DisplaySearchScale()
  907.  * Affiche les échelles répondant à la requête sur $keywords
  908.  *
  909.  * @param string $keywords 
  910.  * @return string $content
  911.  */
  912. if(!function_exists('DisplaySearchScale')) {
  913.  
  914.   function DisplaySearchScale($keywords$type$searchtype)
  915.   {
  916.     $data $GLOBALS['sql_object']->DBSelect(SQL_scale_search(MatchDataFormat($keywords$searchtype)$type$searchtype));
  917.  
  918.     $content '<div id="MatchScale">';
  919.     $content .= '<h3>' _t('search','scale_module''</h3>' END_LINE;
  920.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  921.     else {
  922.       $content .= '<ul>' END_LINE;
  923.       for($i 0$i count($data)$i++{
  924.         if ($type == 'ADMIN'$link_scale 'index.php?rub=scale&amp;todo=det&amp;id=' $data[$i]['scale_id'];
  925.  
  926.         $scale_title formatText($data[$i]['scale_denomination']);
  927.         $pertinence _t('divers','none');
  928.         $published_display $data[$i]['date_display'];
  929.  
  930.         $content .= '<li class="matches">' END_LINE;
  931.         $content .= '<a href="' $link_scale '" title="' formatText($scale_title'2ATT''">' $scale_title '</a>';
  932.         $content .= '<span class="infocomp">(' _t('divers','date_crea'' : ' $published_display GetStatus($data[$i]['statut']')</span>';
  933.         $content .= '</li>' END_LINE;
  934.       }
  935.       $content .= '</ul>' END_LINE;
  936.     }
  937.     $content .= '</div>' END_LINE;
  938.     echo $content;
  939.   }
  940. }
  941.  
  942. /**
  943.  * DisplaySearchLevel()
  944.  * Affiche les niveaux répondant à la requête sur $keywords
  945.  *
  946.  * @param string $keywords 
  947.  * @return string $content
  948.  */
  949. if(!function_exists('DisplaySearchLevel')) {
  950.  
  951.   function DisplaySearchLevel($keywords$type$searchtype)
  952.   {
  953.     $data $GLOBALS['sql_object']->DBSelect(SQL_level_search(MatchDataFormat($keywords$searchtype)$type$searchtype));
  954.  
  955.     $content '<div id="MatchLevel">';
  956.     $content .= '<h3>' _t('search','level_module''</h3>' END_LINE;
  957.     if (count($data== && $data == 0$content .= '<p>' _t('search','no_result''</p>' END_LINE;
  958.     else {
  959.       $content .= '<ul>' END_LINE;
  960.       for($i 0$i count($data)$i++{
  961.         if ($type == 'ADMIN'$link_level 'index.php?rub=level&amp;todo=det&amp;id=' $data[$i]['level_id'];
  962.  
  963.         $level_title formatText($data[$i]['level_name']);
  964.         $pertinence _t('divers','none');
  965.         $published_display $data[$i]['date_display'];
  966.  
  967.         $content .= '<li class="matches">' END_LINE;
  968.         $content .= '<a href="' $link_level '" title="' formatText($level_title'2ATT''">' $level_title '</a>';
  969.         $content .= '<span class="infocomp">(' _t('divers','date_crea'' : ' $published_display GetStatus($data[$i]['statut']')</span>';
  970.         $content .= '</li>' END_LINE;
  971.       }
  972.       $content .= '</ul>' END_LINE;
  973.     }
  974.     $content .= '</div>' END_LINE;
  975.     echo $content;
  976.   }
  977. }
  978.  
  979. /**
  980.  * DisplayQueryTime()
  981.  * Affiche le temps d'execution des requêtes
  982.  *
  983.  * @param float $start_time 
  984.  * @param float $end_time 
  985.  * @return string $content (echo)
  986.  */
  987. if(!function_exists('DisplayQueryTime')) {
  988.  
  989.   function DisplayQueryTime($start_time$end_time)
  990.   {
  991.     $content '<div id="QueryTime">' END_LINE;
  992.     $content .= _t('search','query_time'' ' (substr($end_time $start_time05)) ' ' _t('search','query_seconds');
  993.     $content .= '</div>' END_LINE;
  994.     echo $content;
  995.   }
  996. }
  997.  
  998. if(!function_exists('DisplayAdvancedSearchForm')) {
  999.  
  1000.   {
  1001.     $action $GLOBALS['links'][U_L]['search-result']['linkvalue'];
  1002.     $content  '<form action="index.php" method="get">';
  1003.     $content .= '<div id="searchcontent">';
  1004.     $content .= '<label for="advsearch" class="labelised">' _t('search','keywords''</label>';
  1005.     $content .= '<input type="text" maxlength="200"  class="textfield" name="search" id="advsearch" style="margin-right:30px" />';
  1006.     $content .= '<input id="rub_search2" name="rub" type="hidden" value="'.$action.'" />';
  1007.     $content .= '<div style="margin:1.8em 0 0 17em">';
  1008.     $content .= '<input type="radio" name="searchtype" id="searchtype_1" value="one" checked="checked "/><label class="labelised autowidth" for="searchtype_1">' _t('search','one_of_them''</label>';
  1009.     $content .= '<input type="radio" name="searchtype" id="searchtype_2" value="all" /><label class="labelised autowidth" for="searchtype_2">' _t('search','all_of_them''</label>';
  1010.     $content .= '<input type="radio" name="searchtype" id="searchtype_3" value="exp" /><label class="labelised autowidth" for="searchtype_3">' _t('search','expression''</label>';
  1011.     $content .= '</div>';
  1012.     $content .='<input type="submit" value="ok" name="valid" id="validadvsearch" class="submitbut" />'.END_LINE;
  1013.     $content .= '</div>';
  1014.     $content .= '</form>';
  1015.  
  1016.     echo $content;
  1017.   }
  1018. }
  1019.  
  1020. if(!function_exists('FormatPertinenceIndice')) {
  1021.  
  1022.   function FormatPertinenceIndice($float{
  1023.     $pertinence_i ($float != 0number_format(round($float3)3','' '_t('search','score_not_good');
  1024.     $pertinence' <span class="pertinence">- <abbr title="'.formatText(_t('search','score')'2ATT').'">' _t('search','score_abbr''</abbr> : ' $pertinence_i '</span>';
  1025.  
  1026.  
  1027.     return $pertinence;
  1028.   }
  1029. }
  1030. ?>

Documentation generated on Thu, 20 Mar 2014 16:47:34 +0100 by phpDocumentor 1.4.1