164 : StandardForm
165 {
167 $field_factory = $this->
factory->input()->field();
168
169
170 $values = [];
171 for ($value = 5; $value <= 50; $value += 5) {
172 $values[$value] = $value;
173 }
174 $hits = $field_factory->select(
175 $this->
lng->txt(
'seas_max_hits'),
176 $values,
177 $this->lng->txt('seas_max_hits_info')
178 )->withValue($settings->getMaxHits())
179 ->withRequired(true);
180
181
182 $type = $field_factory->radio(
183 $this->
lng->txt(
'seas_search_type')
184 )->withOption(
186 $this->
lng->txt(
'search_direct'),
187 $this->lng->txt('search_like_info')
188 )->withOption(
190 $this->
lng->txt(
'search_lucene'),
191 $this->lng->txt('java_server_info')
192 )->withRequired(true);
193
194 if ($settings->enabledLucene()) {
196 } else {
198 }
199
200
201 $operator = $field_factory->radio(
202 $this->
lng->txt(
'lucene_default_operator'),
203 $this->lng->txt('lucene_default_operator_info')
204 )->withOption(
206 $this->
lng->txt(
'lucene_and')
207 )->withOption(
209 $this->
lng->txt(
'lucene_or')
210 )->withRequired(true)
211 ->withValue((string) $settings->getDefaultOperator());
212
213
214 $filter = $settings->getLuceneItemFilter();
215 $checks = [];
217 $checks[$obj] = $field_factory->checkbox(
218 $this->
lng->txt($def[
'trans'])
219 )->withValue(isset($filter[$obj]) && $filter[$obj]);
220 }
221
222 $item_filter = $field_factory->optionalGroup(
223 $checks,
224 $this->
lng->txt(
'search_item_filter_form'),
225 $this->lng->txt('search_item_filter_form_info')
226 );
227 if (!$settings->isLuceneItemFilterEnabled()) {
228 $item_filter = $item_filter->withValue(null);
229 }
230
231
232 $cdate = $field_factory->checkbox(
233 $this->
lng->txt(
'search_cdate_filter'),
234 $this->lng->txt('search_cdate_filter_info')
235 )->withValue($settings->isDateFilterEnabled());
236
237
239 0 => 0,
240 5 => 5,
241 10 => 10,
242 20 => 20,
243 30 => 30
244 ];
245 $auto_complete = $field_factory->select(
246 $this->
lng->txt(
'search_auto_complete_length'),
248 $this->lng->txt('search_auto_complete_length_info'),
249 )->withRequired(true)->withValue($settings->getAutoCompleteLength());
250
251
252 $inactive_user = $field_factory->checkbox(
253 $this->
lng->txt(
'search_show_inactive_user'),
254 $this->lng->txt('search_show_inactive_user_info')
255 )->withValue($settings->isInactiveUserVisible());
256
257
258 $limited_user = $field_factory->checkbox(
259 $this->
lng->txt(
'search_show_limited_user'),
260 $this->lng->txt('search_show_limited_user_info')
261 )->withValue($settings->isLimitedUserVisible());
262
263 $section = $this->
factory->input()->field()->section(
264 [
265 'search_type' => $type,
266 'max_hits' => $hits,
267 'operator' => $operator
268 ],
269 $this->
lng->txt(
'seas_settings')
270 )->withDisabled($read_only);
271
272 $filter_section = $this->
factory->input()->field()->section(
273 [
274 'filter' => $item_filter,
275 'cdate' => $cdate
276 ],
277 $this->
lng->txt(
'search_filter_settings_section')
278 )->withDisabled($read_only);
279
280 $user_section = $this->
factory->input()->field()->section(
281 [
282 'auto_complete_length' => $auto_complete,
283 'inactive_user' => $inactive_user,
284 'limited_user' => $limited_user
285 ],
286 $this->
lng->txt(
'user_search_settings_section')
287 )->withDisabled($read_only);
288
289 if ($read_only) {
290 $action = $this->
ctrl->getFormAction($this,
'permDenied');
291 } else {
292 $action = $this->
ctrl->getFormAction($this,
'update');
293 }
294
295 return $this->
factory->input()->container()->form()->standard(
296 $action,
297 [
298 'section' => $section,
299 'filter_section' => $filter_section,
300 'user_section' => $user_section
301 ]
302 );
303 }
static getLuceneItemFilterDefinitions()
Get lucene item filter definitions.