File modules/cms/action/search/SearchQuicksearchAction.class.php
Last commit: Fri Feb 26 01:06:01 2021 +0100 Jan Dankert Refactoring accessing the request parameter values.
1 <?php 2 namespace cms\action\search; 3 use cms\action\Method; 4 use cms\action\SearchAction; 5 use cms\base\Configuration; 6 7 class SearchQuicksearchAction extends SearchAction implements Method { 8 public function view() { 9 $searchConfig = Configuration::subset('search')->subset('quicksearch'); 10 11 $text = $this->request->getText('search'); 12 13 $flag = $searchConfig->subset('flag'); 14 15 $searchFlags = 0; 16 17 // Always search for the id without a max length 18 if ( $flag->is('id' ) ) $searchFlags |= self::FLAG_ID; 19 20 if ( strlen($text) >= $searchConfig->get('maxlength',3 ) ) { 21 22 if ( $flag->is('name' ) ) $searchFlags |= self::FLAG_NAME; 23 if ( $flag->is('filename' ) ) $searchFlags |= self::FLAG_FILENAME; 24 if ( $flag->is('description') ) $searchFlags |= self::FLAG_DESCRIPTION; 25 if ( $flag->is('content' ) ) $searchFlags |= self::FLAG_VALUE; 26 } 27 28 $this->performSearch($text, $searchFlags); 29 } 30 31 32 public function post() { 33 } 34 }
Downloadmodules/cms/action/search/SearchQuicksearchAction.class.php
History Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.