Title = 'Vyhledávání'; $this->Description = 'Hledání v obsahu'; $this->ParentClass = 'PagePortal'; } function Show(): string { $Output = ''; if (array_key_exists('t', $_GET)) $Text = $_GET['t']; else $Text = ''; $Output .= '
'; if ($Text != '') foreach (ModuleSearch::Cast($this->System->GetModule('Search'))->Items as $Item) { $Columns = ''; $Condition = ''; foreach ($Item['Columns'] as $Column) { $Columns .= ', `'.$Column.'`'; $Condition .= ' OR (`'.$Column.'` LIKE "%'.$Text.'%")'; } $Columns = substr($Columns, 2); $Condition = substr($Condition, 3); $DbResult = $this->Database->Select($Item['Table'], $Columns, $Condition.' LIMIT '. ModuleSearch::Cast($this->System->GetModule('Search'))->MaxItemCount); if ($DbResult->num_rows > 0) $Output .= ''.$Item['Name'].'';
foreach ($Item['Columns'] as $Column)
$Output .= $Row[$Column].'
';
$Output .= '