Changeset 880 for trunk/Modules/Search


Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Search/Search.php

    r861 r880  
    4848      '</table></div>'.
    4949      '</form>';
    50     return($Output);
     50    return $Output;
    5151  }
    5252}
     
    5757  {
    5858    $this->Title = T('Search');
    59     if(array_key_exists('text', $_GET)) $Search = $_GET['text'];
    60     else if(array_key_exists('text', $_POST)) $Search = $_POST['text'];
     59    if (array_key_exists('text', $_GET)) $Search = $_GET['text'];
     60    else if (array_key_exists('text', $_POST)) $Search = $_POST['text'];
    6161    else $Search = '';
    6262    $SearchHTML = urlencode($Search);
    6363
    6464    $Output = '<table class="BaseTable"><tr><th>'.T('Section').'</th><th>'.T('Found count').'</th></tr>';
    65     foreach($this->System->ModuleManager->Modules['Search']->SearchItems as $SearchItem)
     65    foreach ($this->System->ModuleManager->Modules['Search']->SearchItems as $SearchItem)
    6666    {
    6767      $ColumnQuery = array();
    68       foreach($SearchItem['Columns'] as $Column)
     68      foreach ($SearchItem['Columns'] as $Column)
    6969      {
    7070        $ColumnQuery[] = '(`'.$Column.'` LIKE "%'.$Search.'%")';
    7171      }
    7272      $ColumnQuery = implode(' OR ', $ColumnQuery);
    73       if($SearchItem['Query'] != '')
     73      if ($SearchItem['Query'] != '')
    7474      {
    7575        $DbResult = $this->Database->query('SELECT COUNT(*) FROM '.$SearchItem['Query'].' WHERE '.$ColumnQuery);
     
    8282
    8383    $Output .= '</table>';
    84     return($Output);
     84    return $Output;
    8585  }
    8686}
Note: See TracChangeset for help on using the changeset viewer.