X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fwidget%2Fsearch%2FSearchFormWidget.php;h=62ee9cb6f1e846a3d8b9bc28287a51491d3399a6;hp=7c28b5efe75ec279f8f0d966e3f56916edcf283e;hb=e5ef0fd0c6607dd34f6dee69d716b159662a0a34;hpb=60fbf0d875c27dc6608c97ce1f96e1df3d88b788 diff --git a/includes/widget/search/SearchFormWidget.php b/includes/widget/search/SearchFormWidget.php index 7c28b5efe7..62ee9cb6f1 100644 --- a/includes/widget/search/SearchFormWidget.php +++ b/includes/widget/search/SearchFormWidget.php @@ -40,6 +40,7 @@ class SearchFormWidget { * @param int $totalResults The total estimated results found * @param int $offset Current offset in search results * @param bool $isPowerSearch Is the 'advanced' section open? + * @param array $options Widget options * @return string HTML */ public function render( @@ -48,7 +49,8 @@ class SearchFormWidget { $numResults, $totalResults, $offset, - $isPowerSearch + $isPowerSearch, + array $options = [] ) { $user = $this->specialSearch->getUser(); @@ -63,7 +65,7 @@ class SearchFormWidget { ] ) . '
' . - $this->shortDialogHtml( $profile, $term, $numResults, $totalResults, $offset ) . + $this->shortDialogHtml( $profile, $term, $numResults, $totalResults, $offset, $options ) . '
' . "
" . "
" . @@ -81,12 +83,20 @@ class SearchFormWidget { * @param int $numResults The number of results shown * @param int $totalResults The total estimated results found * @param int $offset Current offset in search results + * @param array $options Widget options * @return string HTML */ - protected function shortDialogHtml( $profile, $term, $numResults, $totalResults, $offset ) { + protected function shortDialogHtml( + $profile, + $term, + $numResults, + $totalResults, + $offset, + array $options = [] + ) { $html = ''; - $searchWidget = new SearchInputWidget( [ + $searchWidget = new SearchInputWidget( $options + [ 'id' => 'searchText', 'name' => 'search', 'autofocus' => trim( $term ) === '',