diff options
-rw-r--r-- | inc/Ui/Search.php | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/inc/Ui/Search.php b/inc/Ui/Search.php index da030d5a2..bff33cae5 100644 --- a/inc/Ui/Search.php +++ b/inc/Ui/Search.php @@ -2,6 +2,8 @@ namespace dokuwiki\Ui; +use \dokuwiki\Form\Form; + class Search extends Ui { protected $query; @@ -38,6 +40,8 @@ class Search extends Ui { $searchHTML = ''; + $searchHTML .= $this->getSearchFormHTML($this->query); + $searchHTML .= $this->getSearchIntroHTML($this->query); $searchHTML .= $this->getPageLookupHTML($this->pageLookupResults); @@ -48,6 +52,28 @@ class Search extends Ui } /** + * Get a form which can be used to adjust/refine the search + * + * @param string $query + * + * @return string + */ + protected function getSearchFormHTML($query) + { + global $lang; + + $searchForm = (new Form())->attrs(['method' => 'get']); + $searchForm->setHiddenField('do', 'search'); + + $searchForm->addFieldsetOpen(); + $searchForm->addTextInput('id', '')->val($query); + $searchForm->addButton('', $lang['btn_search'])->attr('type', 'submit'); + $searchForm->addFieldsetClose(); + + return $searchForm->toHTML(); + } + + /** * Build the intro text for the search page * * @param string $query the search query @@ -69,7 +95,6 @@ class Search extends Ui return $intro; } - /** * Build HTML for a list of pages with matching pagenames * |