[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/components/com_search/ -> search.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Search
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17  /** ensure this file is being included by a parent file */
  18  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  19  
  20  class search_html {
  21      
  22  	function openhtml( $params ) {
  23          if ( $params->get( 'page_title' ) ) {
  24              ?>
  25              <div class="componentheading<?php echo $params->get( 'pageclass_sfx' ); ?>">
  26              <?php echo $params->get( 'header' ); ?>
  27              </div> 
  28              <?php 
  29          }
  30      }
  31  
  32  	function searchbox( $searchword, &$lists, $params ) {
  33          global $Itemid;
  34          ?>
  35          <form action="index.php" method="post">
  36          <table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>">
  37              <tr align="center">
  38                <td colspan="3"><?php echo T_('Search Keyword'); ?>:&nbsp;
  39                  <input type="text" name="searchword" maxlength="50" size="30" value="<?php echo stripslashes($searchword);?>" class="inputbox" />
  40                  &nbsp;<input type="submit" name="submit" value="<?php echo T_('Search');?>" class="button" /></td>
  41            </tr>
  42              <tr align="center">
  43                  <td colspan="3">
  44                  <?php echo $lists['searchphrase']; ?>
  45                  </td>
  46              </tr>
  47              <tr align="center">
  48                  <td colspan="3"><?php echo T_('Ordering');?>: <?php echo $lists['ordering'];?></td>
  49              </tr>
  50          </table>
  51          
  52          <input type="hidden" name="option" value="com_search" />
  53          <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>" />
  54          </form>
  55          <?php
  56      }
  57  
  58  	function searchintro( $searchword, $params ) {
  59          ?>
  60          <table class="searchintro<?php echo $params->get( 'pageclass_sfx' ); ?>">
  61          <tr>
  62              <td colspan="3" align="left">
  63              <?php echo T_('Search Keyword') . ' <strong>' . stripslashes($searchword) . '</strong>'; ?>    
  64          <?php
  65      }
  66  
  67  	function message( $message, $params ) {
  68          ?>
  69          <table class="searchintro<?php echo $params->get( 'pageclass_sfx' ); ?>">
  70          <tr>
  71              <td colspan="3" align="left">
  72              <?php eval ('echo "'.$message.'";');    ?>
  73              </td>
  74          </tr>
  75          </table>
  76          <?php
  77      }
  78  
  79  	function displaynoresult() {
  80          ?>
  81              </td>
  82          </tr>
  83          <?php
  84      }
  85  
  86  	function display( &$rows, $params ) {
  87          global $mosConfig_offset;
  88          
  89          $c             = count ($rows);
  90          $tabclass     = array("sectiontableentry1", "sectiontableentry2");
  91          $k             = 0;
  92                  
  93          // number of matches found
  94          printf( Tn_('returned %d match', 'returned %d matches',$c), $c );
  95          ?>
  96              </td>
  97          </tr>
  98          </table>
  99          <br />
 100          <table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>">
 101          <?php
 102          foreach ($rows as $row) {
 103              if ($row->created) {
 104                  $created = mosFormatDate ($row->created, '%d %B, %Y');
 105              } else {
 106                  $created = '';
 107              }
 108              ?>
 109              <tr class="<?php echo $tabclass[$k] . $params->get( 'pageclass_sfx' ); ?>">
 110                  <td>
 111                  <?php
 112                  if ($row->browsernav == 1) {
 113                      ?>
 114                      <a href="<?php echo sefRelToAbs($row->href); ?>" target="_blank">
 115                      <?php
 116                  } else {
 117                      ?>
 118                      <a href="<?php echo sefRelToAbs($row->href); ?>">
 119                      <?php
 120                  }
 121                  echo $row->title;
 122                  ?>
 123                  </a>
 124  <?php            if (isset($row->section)) {
 125                      if (trim($row->section)) {
 126  ?>
 127                  <span class="small<?php echo $params->get( 'pageclass_sfx' ); ?>">
 128                  (<?php echo $row->section; ?>)
 129                  </span>
 130  <?php
 131                      }
 132                  }
 133  ?>
 134                  </td>
 135              </tr>
 136              <tr class="<?php echo $tabclass[$k] . $params->get( 'pageclass_sfx' ); ?>">
 137                  <td>
 138                  <?php echo $row->text;?> &#133;
 139                  </td>
 140              </tr>
 141              <tr>
 142                  <td class="small<?php echo $params->get( 'pageclass_sfx' ); ?>">
 143                  <?php echo $created; ?>
 144                  </td>
 145              </tr>
 146              <tr>
 147                  <td>&nbsp;
 148                  
 149                  </td>
 150              </tr>
 151              <?php
 152              $k = 1 - $k;
 153          }
 154      }
 155  
 156  	function conclusion( $totalRows, $searchword ) {
 157          global $mosConfig_live_site;
 158          ?>
 159          <tr>
 160              <td colspan="3">&nbsp;
 161              
 162              </td>
 163          </tr>
 164          <tr>
 165              <td colspan="3">
 166              <?php
 167              printf('Total %d results found.  Search for %s with', $totalRows, "<strong>$searchword</strong>");
 168              ?>
 169              <a href="http://www.google.com/search?q=<?php echo stripslashes($searchword);?>" target="_blank">
 170              <img src="<?php echo $mosConfig_live_site;?>/images/M_images/google.png" border="0" align="texttop" />
 171              </a>
 172              </td>
 173          </tr>
 174          </table>    
 175          <?php
 176      }
 177  }
 178  ?>