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 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. <div id="chemin">
  12. <ul>
  13.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home');?></a>
  14.     </li>
  15.     <li><a href="<?php echo $rub_link; ?>" id="chemin_<?php echo $rub; ?>"
  16.         class="chemin_rub"><?php echo _t('menu','search');?></a></li>
  17.     <li><span><?php echo formatNavTitle(_t('menu_alt',$rub)) ?></span></li>
  18. </ul>
  19. </div>
  20. <!--end barre haute -->
  21.  
  22. <?php
  23. include_once(THEME_ADMIN_PATH."quickicons.php");
  24. ?>
  25. <div class="contentcontainer"><?php include_once($dir . "/menurub.php"); ?>
  26. <div id="content"><?php
  27. if (!isset($_POST['valid'])) {
  28.   echo '<h2>' . _t('menu','search') . '</h2>' . END_LINE;
  29.  
  30.   ?>
  31. <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
  32. <div id="searchcontent"><label for="search"><?php echo _t('search','keywords');?></label>
  33. <input type="text" maxlength="150" class="textfield" name="search"
  34.     id="search" style="margin-right: 30px" /> <br class="brendstep" />
  35. <div style="margin:3em 200px"><input type="radio" name="searchtype"
  36.     id="searchtype_1" value="one" checked="checked" /><span class="radio"><?php echo _t('search','one_of_them');?></span>
  37. <input type="radio" name="searchtype" id="searchtype_2" value="all" /><span
  38.     class="radio"><?php echo _t('search','all_of_them');?></span> <input
  39.     type="radio" name="searchtype" id="searchtype_3" value="exp" /><span
  40.     class="radio"><?php echo _t('search','expression');?></span></div>
  41. <input type="hidden" name="rub" id="rubsearch"
  42.     value="<?php echo $rub;?>" /> <br class="brendstep" />
  43. <input type="submit" value="<?php echo _t('search','text_button');?>"
  44.     size="15" name="valid" class="button" id="validsearch" /></div>
  45. </form>
  46.   <?php
  47. } else {
  48.   $type = 'ADMIN';
  49.   include_once($dir . "/display.php");
  50.   if (!isset($_REQUEST['search']) || strlen($_REQUEST['search']) <= 3)
  51.   {
  52.     echo '<div class="info">'.END_LINE;
  53.     echo _t('search','min_length');
  54.     echo  '</div>'.END_LINE;
  55.   } else {
  56.     if (isset($_REQUEST['searchincome'])) $str = trim($_REQUEST['searchincome']);
  57.     else $str = $_REQUEST['search'];
  58.     if (!isset($_REQUEST['searchtype'])) $searchtype = 'one';
  59.     else $searchtype = $_REQUEST['searchtype'];
  60.     if($searchtype=='one') $display_method=_t('search','one_of_them');
  61.     if($searchtype=='all') $display_method=_t('search','all_of_them');
  62.     if($searchtype=='exp') $display_method=_t('search','expression');
  63.     echo '<h2>' . _t('search','result') . '</h2>' . END_LINE;
  64.  
  65.     echo '<div id="KeyWords">'.END_LINE;
  66.     echo _t('search','keywords');
  67.     echo formatText($str, '2HTML').'<br />'.END_LINE;
  68.     echo _t('search','method');
  69.     echo $display_method.'<br />'.END_LINE;
  70.     echo '</div>'.END_LINE;
  71.     $start_time = getmicrotime();
  72.     if ($rub == 'home') $rub = 'all';
  73.     switch ($rub) {
  74.       case 'project':
  75.         IsSuperAdmin() ? DisplaySearchProject($str, $type, $searchtype) : ReloadIndex('admin');
  76.         break;
  77.       case 'news':
  78.         HaveRight('news') ? DisplaySearchNews($str, $type, $searchtype) : ReloadIndex('admin');
  79.         break;
  80.       case 'newsletter':
  81.         IsSuperAdmin() ? DisplaySearchNewsletter($str, $type, $searchtype) : ReloadIndex('admin');
  82.         break;
  83.       case 'publication':
  84.         HaveRight('publication') ? DisplaySearchPublication($str, $type, $searchtype) : ReloadIndex('admin');
  85.         HaveRight('publication') ? DisplaySearchPubliContents($str, $type, $searchtype) : ReloadIndex('admin');
  86.         break;
  87.       case 'workshop':
  88.         HaveRight('workshop') ? DisplaySearchWorkshop($str, $type, $searchtype) : ReloadIndex('admin');
  89.         HaveRight('workshop') ? DisplaySearchWorkshopRep($str, $type, $searchtype) : ReloadIndex('admin');
  90.         HaveRight('workshop') ? DisplaySearchWorkshopRepContents($str, $type, $searchtype) : ReloadIndex('admin');
  91.         HaveRight('workshop') ? DisplaySearchWorkshopCalendar($str, $type, $searchtype) : ReloadIndex('admin');
  92.         HaveRight('workshop') ? DisplaySearchWorkshopCom($str, $type, $searchtype) : ReloadIndex('admin');
  93.         break;
  94.       case 'workshoprep':
  95.         HaveRight('workshop') ? DisplaySearchWorkshopRep($str, $type, $searchtype) : ReloadIndex('admin');
  96.         HaveRight('workshop') ? DisplaySearchWorkshopRepContents($str, $type, $searchtype) : ReloadIndex('admin');
  97.         break;
  98.       case 'dashboard':
  99.         HaveRight('dashboard') ? DisplaySearchSdi($str, $type, $searchtype) : ReloadIndex('admin');
  100.         break;
  101.       case 'sdi':
  102.         HaveRight('dashboard') ? DisplaySearchSdi($str, $type, $searchtype) : ReloadIndex('admin');
  103.         break;
  104.       case 'yellowpages':
  105.         IsSuperAdmin() ? DisplaySearchYellowpages($str, $type, $searchtype) : ReloadIndex('admin');
  106.         break;
  107.       case 'user':
  108.         IsSuperAdmin() ? DisplaySearchUser($str, $type, $searchtype) : ReloadIndex('admin');
  109.         break;
  110.       case 'theme':
  111.         IsSuperAdmin() ? DisplaySearchTheme($str, $type, $searchtype) : ReloadIndex('admin');
  112.         break;
  113.       case 'scale':
  114.         IsSuperAdmin() ? DisplaySearchScale($str, $type, $searchtype) : ReloadIndex('admin');
  115.         break;
  116.       case 'level':
  117.         IsSuperAdmin() ? DisplaySearchLevel($str, $type, $searchtype) : ReloadIndex('admin');
  118.         break;
  119.       case 'all':
  120.         if (IsSuperAdmin()) DisplaySearchProject($str, $type, $searchtype);
  121.         echo '<hr />';
  122.         if (HaveRight('news')) DisplaySearchNews($str, $type, $searchtype);
  123.         echo '<hr />';
  124.         if (IsSuperAdmin()) DisplaySearchNewsletter($str, $type, $searchtype);
  125.         echo '<hr />';
  126.         if (HaveRight('publication')) DisplaySearchPublication($str, $type, $searchtype);
  127.         if (HaveRight('publication')) DisplaySearchPubliContents($str, $type, $searchtype);
  128.         echo '<hr />';
  129.         if (HaveRight('workshop')) DisplaySearchWorkshop($str, $type, $searchtype);
  130.         if (HaveRight('workshop')) DisplaySearchWorkshopRep($str, $type, $searchtype);
  131.         if (HaveRight('workshop')) DisplaySearchWorkshopRepContents($str, $type, $searchtype);
  132.         if (HaveRight('workshop')) DisplaySearchWorkshopCalendar($str, $type, $searchtype);
  133.         if (HaveRight('workshop')) DisplaySearchWorkshopCom($str, $type, $searchtype);
  134.         echo '<hr />';
  135.         if (HaveRight('dashboard')) DisplaySearchSdi($str, $type, $searchtype);
  136.         echo '<hr />';
  137.         if (IsSuperAdmin()) DisplaySearchYellowpages($str, $type, $searchtype);
  138.         echo '<hr />';
  139.         if (IsSuperAdmin()) DisplaySearchUser($str, $type, $searchtype);
  140.         echo '<hr />';
  141.         if (IsSuperAdmin()) DisplaySearchTheme($str, $type, $searchtype);
  142.         echo '<hr />';
  143.         if (IsSuperAdmin()) DisplaySearchScale($str, $type, $searchtype);
  144.         echo '<hr />';
  145.         if (IsSuperAdmin()) DisplaySearchLevel($str, $type, $searchtype);
  146.         echo '<hr />';
  147.         break;
  148.       default:
  149.     }
  150.     $end_time = getmicrotime();
  151.     DisplayQueryTime($start_time, $end_time);
  152.     logfile(LOG_KEYWORDS,array($str, $type, $searchtype, $rub, i2c_realip()));
  153.   }
  154. }
  155.  
  156. ?></div>
  157. <?php include_once($dir."/help.php"); ?></div>

Documentation generated on Fri, 01 Apr 2011 09:32:37 +0200 by phpDocumentor 1.4.1