plugin('translate'); // Prepare the property queries. $properties = isset($query['property']) ? $query['property'] : []; $properties = array_filter($properties, function ($value) { return isset($value['text']) ? '' !== trim($value['text']) : true; }); if (!$properties) { $properties[] = []; } if (isset($query['search'])) { unset($properties[0]['joiner']); array_unshift($properties, [ 'property' => '', 'type' => 'in', 'text' => $query['search'] ]); } $queryOption = function($value, array $search, $key, $text) { $selected = null; if (isset($search[$key]) && $value === $search[$key]) { $selected = ' selected'; } return sprintf('', $value, $selected, $text); }; $queryText = function(array $search, $index) { $text = isset($search['text']) ? $search['text'] : null; return sprintf('', $this->escapeHtml("property[$index][text]"), $this->escapeHtml($text), $this->escapeHtml($this->translate('Query text'))); } ?>
propertySelect([ 'name' => $stem . '[property]', 'attributes' => [ 'class' => 'query-property', 'value' => isset($property['property']) ? $property['property'] : null, 'aria-label' => $translate('Property'), ], 'options' => [ 'empty_option' => '[Any Property]', // @translate 'apply_templates' => $this->status()->isSiteRequest() ? $this->siteSetting('search_apply_templates') : false, ] ]); ?>