diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2023-04-19 10:57:56 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2023-04-19 10:57:56 +0000 |
| commit | 6396bbb3c9bbad618c5b4832545ac4f3ccfe3468 (patch) | |
| tree | fd651e0e0c6ad31ad91d9990666555df47f46db4 /lib | |
| parent | dbc22a10dd185b4d3cc70ff827f8693e30636f0d (diff) | |
add min-length to quicksearch, closes #2561
Closes #2561
Merge request studip/studip!1728
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/classes/QuickSearch.class.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/classes/QuickSearch.class.php b/lib/classes/QuickSearch.class.php index 69a80f7..d3983a3 100644 --- a/lib/classes/QuickSearch.class.php +++ b/lib/classes/QuickSearch.class.php @@ -94,6 +94,7 @@ class QuickSearch private $inputClass = null; private $inputStyle = null; private $specialQuery = null; + private $minLength = 3; /** @@ -264,6 +265,20 @@ class QuickSearch } /** + * Set the minimum length to start searching + * + * @param int $minLength + * + * @return QuickSearch + */ + public function setMinLength(int $minLength) + { + $this->minLength = $minLength; + + return $this; + } + + /** * disables the select-box, which is displayed for non-JS users who will * choose with this box, which item they want to have. * @@ -384,6 +399,7 @@ class QuickSearch $template->set_attribute('count_QS', self::$count_QS); $template->set_attribute('id', $this->getId()); $template->set_attribute('query_id', $query_id); + $template->set_attribute('minLength', $this->minLength); $template->set_attribute('search_button_name', $this->search_button_name); $template->set_attribute('reset_button_name', $this->reset_button_name); $template->set_attribute('extendedLayout', $this->hasExtendedLayout()); |
