diff --git a/modules/backend/widgets/Search.php b/modules/backend/widgets/Search.php index c8b11b231..0fab52e0c 100644 --- a/modules/backend/widgets/Search.php +++ b/modules/backend/widgets/Search.php @@ -1,6 +1,6 @@ config->prompt)) { - $this->placeholder = trans($this->config->prompt); - } - - if (isset($this->config->partial)) { - $this->customPartial = $this->config->partial; - } - - if (isset($this->config->growable)) { - $this->growable = $this->config->growable; - } + $this->fillFromConfig([ + 'prompt', + 'partial', + 'growable', + ]); /* * Add CSS class styles @@ -81,8 +78,8 @@ class Search extends WidgetBase { $this->prepareVars(); - if ($this->customPartial) { - return $this->controller->makePartial($this->customPartial); + if ($this->partial) { + return $this->controller->makePartial($this->partial); } else { return $this->makePartial('search'); @@ -95,7 +92,7 @@ class Search extends WidgetBase public function prepareVars() { $this->vars['cssClasses'] = implode(' ', $this->cssClasses); - $this->vars['placeholder'] = $this->placeholder; + $this->vars['placeholder'] = Lang::get($this->prompt); $this->vars['value'] = $this->getActiveTerm(); }