ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjSearchSettingsGUI Class Reference
+ Inheritance diagram for ilObjSearchSettingsGUI:
+ Collaboration diagram for ilObjSearchSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 settingsObject ()
 Show settings @access public. More...
 
 saveSettingsObject ()
 Save settings @access public. More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getTabs ()
 get tabs @access public More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Protected Member Functions

 initFormSettings ()
 Init settings form. More...
 
 updateSettingsObject ()
 Update Settings. More...
 
 luceneSettingsObject (ilPropertyFormGUI $form=null)
 Lucene settings. More...
 
 initFormLuceneSettings ()
 Show lucene settings form. More...
 
 saveLuceneSettingsObject ()
 Save Lucene settings. More...
 
 refreshLuceneSettings ()
 Refresh lucene server settings. More...
 
 advancedLuceneSettingsObject ()
 show advanced settings More...
 
 saveAdvancedLuceneSettingsObject ()
 Save advanced settings. More...
 
 initSubTabs ($a_section)
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Definition at line 17 of file class.ilObjSearchSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjSearchSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor @access public.

Definition at line 23 of file class.ilObjSearchSettingsGUI.php.

24 {
25 $this->type = "seas";
26 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
27
28 $this->lng->loadLanguageModule('search');
29 }

Member Function Documentation

◆ advancedLuceneSettingsObject()

ilObjSearchSettingsGUI::advancedLuceneSettingsObject ( )
protected

show advanced settings

Definition at line 558 of file class.ilObjSearchSettingsGUI.php.

559 {
560 $this->initSubTabs('lucene');
561 $this->tabs_gui->setTabActive('lucene_advanced_settings');
562
563 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchActivationTableGUI.php';
564 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
565
566 $table = new ilLuceneAdvancedSearchActivationTableGUI($this, 'advancedLuceneSettings');
567 $table->setTitle($this->lng->txt('lucene_advanced_settings_table'));
569
570 $this->tpl->setContent($table->getHTML());
571 }
if(empty($password)) $table
Definition: pwgen.php:24

References $table, ilLuceneAdvancedSearchSettings\getInstance(), and initSubTabs().

Referenced by saveAdvancedLuceneSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelObject()

ilObjSearchSettingsGUI::cancelObject ( )

cancel action and go back to previous page @access public

Reimplemented from ilObjectGUI.

Definition at line 57 of file class.ilObjSearchSettingsGUI.php.

58 {
59 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
60 $this->ctrl->redirect($this, "settings");
61 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjSearchSettingsGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 31 of file class.ilObjSearchSettingsGUI.php.

32 {
33 $next_class = $this->ctrl->getNextClass($this);
34 $cmd = $this->ctrl->getCmd();
35 $this->prepareOutput();
36
37 switch ($next_class) {
38 case 'ilpermissiongui':
39 $this->tabs_gui->setTabActive('perm_settings');
40 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
41 $perm_gui = new ilPermissionGUI($this);
42 $ret =&$this->ctrl->forwardCommand($perm_gui);
43 break;
44
45 default:
46 if ($cmd == "" || $cmd == "view") {
47 $cmd = "settings";
48 }
49 $cmd .= "Object";
50 $this->$cmd();
51
52 break;
53 }
54 return true;
55 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6

References $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSearchSettingsGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 121 of file class.ilObjSearchSettingsGUI.php.

122 {
123 $this->getTabs();
124 }
getTabs()
get tabs @access public

References getTabs().

+ Here is the call graph for this function:

◆ getTabs()

ilObjSearchSettingsGUI::getTabs ( )

get tabs @access public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 131 of file class.ilObjSearchSettingsGUI.php.

132 {
133 global $rbacsystem;
134
135 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
136 $this->tabs_gui->addTarget(
137 "settings",
138 $this->ctrl->getLinkTarget($this, "settings"),
139 array("settings","", "view"),
140 "",
141 ""
142 );
143 }
144
145 if ($rbacsystem->checkAccess('read', $this->object->getRefId())) {
146 $this->tabs_gui->addTarget(
147 'lucene_advanced_settings',
148 $this->ctrl->getLinkTarget($this, 'advancedLuceneSettings')
149 );
150 }
151
152 if ($rbacsystem->checkAccess('read', $this->object->getRefId())) {
153 $this->tabs_gui->addTarget(
154 'lucene_settings_tab',
155 $this->ctrl->getLinkTarget($this, 'luceneSettings')
156 );
157 }
158
159
160 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
161 $this->tabs_gui->addTarget(
162 "perm_settings",
163 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
164 array("perm","info","owner"),
165 'ilpermissiongui'
166 );
167 }
168 }

References ilObjectGUI\$rbacsystem.

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ initFormLuceneSettings()

ilObjSearchSettingsGUI::initFormLuceneSettings ( )
protected

Show lucene settings form.

Parameters

return

Definition at line 392 of file class.ilObjSearchSettingsGUI.php.

393 {
394 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
395 include_once './Services/Search/classes/class.ilSearchSettings.php';
396
398
399 $this->form = new ilPropertyFormGUI();
400 $this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel'));
401
402 $this->form->setTitle($this->lng->txt('lucene_settings_title'));
403
404 $access = $GLOBALS['DIC']->access();
405 if ($access->checkAccess('write', '', $this->object->getRefId())) {
406 $this->form->addCommandButton('saveLuceneSettings', $this->lng->txt('save'));
407 }
408
409
410
411 // Item filter
412 $if = new ilCheckboxInputGUI($this->lng->txt('search_mime_filter_form'), 'mime_enabled');
413 $if->setValue(1);
414 $if->setChecked($this->settings->isLuceneMimeFilterEnabled());
415 $if->setInfo($this->lng->txt('search_item_filter_form_info'));
416 $this->form->addItem($if);
417
418 $mimes = $this->settings->getLuceneMimeFilter();
420 $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'mime[' . $mime . ']');
421 if (isset($mimes[$mime]) and $mimes[$mime]) {
422 $ch->setChecked(true);
423 }
424 $ch->setValue(1);
425 $if->addSubItem($ch);
426 }
427
428 $prefix = new ilCheckboxInputGUI($this->lng->txt('lucene_prefix_wildcard'), 'prefix');
429 $prefix->setValue(1);
430 $prefix->setInfo($this->lng->txt('lucene_prefix_wildcard_info'));
431 $prefix->setChecked($this->settings->isPrefixWildcardQueryEnabled());
432 $this->form->addItem($prefix);
433
434
435 $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'), 'fragmentCount');
436 $numFrag->setRequired(true);
437 $numFrag->setSize(2);
438 $numFrag->setMaxLength(2);
439 $numFrag->setMinValue(1);
440 $numFrag->setMaxValue(10);
441 $numFrag->setInfo($this->lng->txt('lucene_num_frag_info'));
442 $numFrag->setValue($this->settings->getFragmentCount());
443 $this->form->addItem($numFrag);
444
445 $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'), 'fragmentSize');
446 $sizeFrag->setRequired(true);
447 $sizeFrag->setSize(2);
448 $sizeFrag->setMaxLength(4);
449 $sizeFrag->setMinValue(10);
450 $sizeFrag->setMaxValue(1000);
451 $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info'));
452 $sizeFrag->setValue($this->settings->getFragmentSize());
453 $this->form->addItem($sizeFrag);
454
455 $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'), 'maxSubitems');
456 $maxSub->setRequired(true);
457 $maxSub->setSize(2);
458 $maxSub->setMaxLength(2);
459 $maxSub->setMinValue(1);
460 $maxSub->setMaxValue(10);
461 $maxSub->setInfo($this->lng->txt('lucene_max_sub_info'));
462 $maxSub->setValue($this->settings->getMaxSubitems());
463 $this->form->addItem($maxSub);
464
465 $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'), 'relevance');
466 $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance'));
467 $relevance->setInfo($this->lng->txt('lucene_show_relevance_info'));
468 $relevance->setValue(1);
469 $relevance->setChecked($this->settings->isRelevanceVisible());
470 $this->form->addItem($relevance);
471
472 // begin-patch mime_filter
473 $subrel = new ilCheckboxInputGUI('', 'subrelevance');
474 $subrel->setOptionTitle($this->lng->txt('lucene_show_sub_relevance'));
475 $subrel->setValue(1);
476 $subrel->setChecked($this->settings->isSubRelevanceVisible());
477 $relevance->addSubItem($subrel);
478 // end-patch mime_filter
479
480 $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'), 'last_index');
481 $last_index->setRequired(true);
482 $last_index->setShowTime(true);
483 $last_index->setDate($this->settings->getLastIndexTime());
484 $last_index->setInfo($this->lng->txt('lucene_last_index_time_info'));
485 $this->form->addItem($last_index);
486
487 return true;
488 }
This class represents a checkbox property in a property form.
This class represents a date/time property in a property form.
This class represents a number property in a property form.
This class represents a property form user interface.
static getLuceneMimeFilterDefinitions()
$def
Definition: croninfo.php:21
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
settings()
Definition: settings.php:2

References ilObjectGUI\$access, $def, $GLOBALS, ilSearchSettings\getInstance(), ilSearchSettings\getLuceneMimeFilterDefinitions(), and settings().

Referenced by luceneSettingsObject(), and saveLuceneSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjSearchSettingsGUI::initFormSettings ( )
protected

Init settings form.

Returns
void

Definition at line 174 of file class.ilObjSearchSettingsGUI.php.

175 {
176 global $lng,$ilDB,$DIC;
177
178 $access = $GLOBALS['DIC']->access();
179
180 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
181 include_once './Services/Search/classes/class.ilSearchSettings.php';
182
184
185 $this->form = new ilPropertyFormGUI();
186 $this->form->setFormAction($this->ctrl->getFormAction($this, 'updateSettings'));
187
188 if ($access->checkAccess('write', '', $this->object->getRefId())) {
189 $this->form->addCommandButton('updateSettings', $this->lng->txt('save'));
190 }
191 $this->form->setTitle($this->lng->txt('seas_settings'));
192
193 // Max hits
194 $hits = new ilSelectInputGUI($this->lng->txt('seas_max_hits'), 'max_hits');
195 $hits->setValue($settings->getMaxHits());
196 $hits->setRequired(true);
197 for ($value = 5; $value <= 50; $value += 5) {
198 $values[$value] = $value;
199 }
200 $hits->setOptions($values);
201 $hits->setInfo($this->lng->txt('seas_max_hits_info'));
202 $this->form->addItem($hits);
203
204
205 // Search type
206 $type = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_type');
207
208 if ($settings->enabledLucene()) {
210 } elseif ($settings->enabledIndex()) {
212 } else {
214 }
215 $type->setRequired(true);
216 $this->form->addItem($type);
217
218 // Default operator
219 $operator = new ilRadioGroupInputGUI($this->lng->txt('lucene_default_operator'), 'operator');
220 $operator->setRequired(true);
221 $operator->setInfo($this->lng->txt('lucene_default_operator_info'));
222 $operator->setValue($settings->getDefaultOperator());
223
224 $and = new ilRadioOption($this->lng->txt('lucene_and'), ilSearchSettings::OPERATOR_AND);
225 $operator->addOption($and);
226
227 $or = new ilRadioOption($this->lng->txt('lucene_or'), ilSearchSettings::OPERATOR_OR);
228 $operator->addOption($or);
229 $this->form->addItem($operator);
230
231 // user search
232 $us = new ilCheckboxInputGUI($this->lng->txt('search_user_search_form'), 'user_search_enabled');
233 $us->setInfo($this->lng->txt('search_user_search_info_form'));
234 $us->setValue(1);
235 $us->setChecked($settings->isLuceneUserSearchEnabled());
236 $this->form->addItem($us);
237
238
239 // Item filter
240 $if = new ilCheckboxInputGUI($this->lng->txt('search_item_filter_form'), 'if');
241 $if->setValue(1);
242 $if->setChecked($settings->isLuceneItemFilterEnabled());
243 $if->setInfo($this->lng->txt('search_item_filter_form_info'));
244 $this->form->addItem($if);
245
246 $filter = $settings->getLuceneItemFilter();
248 $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'filter[' . $obj . ']');
249 if (isset($filter[$obj]) and $filter[$obj]) {
250 $ch->setChecked(true);
251 }
252 $ch->setValue(1);
253 $if->addSubItem($ch);
254 }
255
256 $cdate = new ilCheckboxInputGUI($this->lng->txt('search_cdate_filter'), 'cdate');
257 $cdate->setInfo($this->lng->txt('search_cdate_filter_info'));
258 $cdate->setChecked($settings->isDateFilterEnabled());
259 $cdate->setValue(1);
260 $this->form->addItem($cdate);
261
262 // hide advanced search
263 $cb = new ilCheckboxInputGUI($lng->txt("search_hide_adv_search"), "hide_adv_search");
264 $cb->setChecked($settings->getHideAdvancedSearch());
265 $this->form->addItem($cb);
266
267
268
269 $direct = new ilRadioOption($this->lng->txt('search_direct'), ilSearchSettings::LIKE_SEARCH, $this->lng->txt('search_like_info'));
270 $type->addOption($direct);
271
272 if ($ilDB->supportsFulltext()) {
273 $index = new ilRadioOption($this->lng->txt('search_index'), ilSearchSettings::INDEX_SEARCH, $this->lng->txt('search_full_info'));
274 $type->addOption($index);
275 }
276
277 $lucene = new ilRadioOption($this->lng->txt('search_lucene'), ilSearchSettings::LUCENE_SEARCH, $this->lng->txt('java_server_info'));
278 $type->addOption($lucene);
279
280
281 // number of auto complete entries
282 $options = array(
283 5 => 5,
284 10 => 10,
285 20 => 20,
286 30 => 30
287 );
288 $si = new ilSelectInputGUI($lng->txt("search_auto_complete_length"), "auto_complete_length");
289 $si->setOptions($options);
290 $val = ($settings->getAutoCompleteLength() > 0)
291 ? $settings->getAutoCompleteLength()
292 : 10;
293 $si->setValue($val);
294 $this->form->addItem($si);
295
296 $inactive_user = new ilCheckboxInputGUI($this->lng->txt('search_show_inactive_user'), 'inactive_user');
297 $inactive_user->setInfo($this->lng->txt('search_show_inactive_user_info'));
298 $inactive_user->setChecked($settings->isInactiveUserVisible());
299 $this->form->addItem($inactive_user);
300
301 $limited_user = new ilCheckboxInputGUI($this->lng->txt('search_show_limited_user'), 'limited_user');
302 $limited_user->setInfo($this->lng->txt('search_show_limited_user_info'));
303 $limited_user->setChecked($settings->isLimitedUserVisible());
304 $this->form->addItem($limited_user);
305 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
This class represents a property in a property form.
This class represents an option in a radio group.
static getLuceneItemFilterDefinitions()
Get lucene item filter definitions.
This class represents a selection list property in a property form.
$index
Definition: metadata.php:60
$type
global $DIC
Definition: saml.php:7
global $ilDB

References ilObjectGUI\$access, $def, $DIC, $GLOBALS, $ilDB, $index, ilObjectGUI\$lng, $options, ilObjectGUI\$settings, $si, $type, ilSearchSettings\getLuceneItemFilterDefinitions(), ilSearchSettings\INDEX_SEARCH, ilSearchSettings\LIKE_SEARCH, ilSearchSettings\LUCENE_SEARCH, ilSearchSettings\OPERATOR_AND, and ilSearchSettings\OPERATOR_OR.

Referenced by settingsObject(), and updateSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSubTabs()

ilObjSearchSettingsGUI::initSubTabs (   $a_section)
protected

Definition at line 598 of file class.ilObjSearchSettingsGUI.php.

599 {
600 switch ($a_section) {
601 case 'lucene':
602 $this->tabs_gui->addSubTabTarget(
603 'lucene_general_settings',
604 $this->ctrl->getLinkTarget($this, 'luceneSettings')
605 );
606
607 break;
608 }
609 }

Referenced by advancedLuceneSettingsObject(), and luceneSettingsObject().

+ Here is the caller graph for this function:

◆ luceneSettingsObject()

ilObjSearchSettingsGUI::luceneSettingsObject ( ilPropertyFormGUI  $form = null)
protected

Lucene settings.

Parameters

return

Definition at line 376 of file class.ilObjSearchSettingsGUI.php.

377 {
378 $this->initSubTabs('lucene');
379 $this->tabs_gui->setTabActive('lucene_settings_tab');
380
381 if (!$form instanceof ilPropertyFormGUI) {
382 $this->initFormLuceneSettings();
383 }
384 $this->tpl->setContent($this->form->getHTML());
385 }
initFormLuceneSettings()
Show lucene settings form.
if(isset($_POST['submit'])) $form

References $form, initFormLuceneSettings(), and initSubTabs().

Referenced by saveLuceneSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshLuceneSettings()

ilObjSearchSettingsGUI::refreshLuceneSettings ( )
protected

Refresh lucene server settings.

Exceptions
Exception

Definition at line 538 of file class.ilObjSearchSettingsGUI.php.

539 {
540 global $ilSetting;
541
542 if (!ilSearchSettings::getInstance()->enabledLucene()) {
543 return true;
544 }
545
546 try {
547 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
548 ilRpcClientFactory::factory('RPCAdministration')->refreshSettings(CLIENT_ID . '_' . $ilSetting->get('inst_id', 0));
549 } catch (Exception $exception) {
550 ilLoggerFactory::getLogger('src')->error('Refresh of lucene server settings failed with message: ' . $exception->getMessage());
551 throw $exception;
552 }
553 }
static getLogger($a_component_id)
Get component logger.
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
global $ilSetting
Definition: privfeed.php:17

References $ilSetting, ilRpcClientFactory\factory(), ilSearchSettings\getInstance(), and ilLoggerFactory\getLogger().

Referenced by saveLuceneSettingsObject(), and updateSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAdvancedLuceneSettingsObject()

ilObjSearchSettingsGUI::saveAdvancedLuceneSettingsObject ( )
protected

Save advanced settings.

Definition at line 576 of file class.ilObjSearchSettingsGUI.php.

577 {
578 $access = $GLOBALS['DIC']->access();
579
580 if (!$access->checkAccess('write', '', $this->object->getRefId())) {
581 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
582 $GLOBALS['DIC']->ctrl()->redirect($this, 'settings');
583 }
584
585
587 foreach (ilLuceneAdvancedSearchFields::getFields() as $field => $translation) {
588 $settings->setActive($field, in_array($field, (array) $_POST['fid']) ? true : false);
589 }
590 $settings->save();
591 ilUtil::sendInfo($this->lng->txt('settings_saved'));
593 }
$_POST["username"]
static getFields()
Return an array of all meta data fields.
advancedLuceneSettingsObject()
show advanced settings
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_POST, ilObjectGUI\$access, $GLOBALS, ilObjectGUI\$settings, advancedLuceneSettingsObject(), ilLuceneAdvancedSearchFields\getFields(), ilLuceneAdvancedSearchSettings\getInstance(), ilUtil\sendFailure(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveLuceneSettingsObject()

ilObjSearchSettingsGUI::saveLuceneSettingsObject ( )
protected

Save Lucene settings.

Returns

Definition at line 494 of file class.ilObjSearchSettingsGUI.php.

495 {
497
498 $this->initFormLuceneSettings();
499
501 $settings->setFragmentCount((int) $_POST['fragmentCount']);
502 $settings->setFragmentSize((int) $_POST['fragmentSize']);
503 $settings->setMaxSubitems((int) $_POST['maxSubitems']);
504 $settings->showRelevance((int) $_POST['relevance']);
505 $settings->enableLuceneOfflineFilter((int) $_POST['offline_filter']);
506 $settings->enableLuceneMimeFilter((int) $_POST['mime_enabled']);
507 $settings->setLuceneMimeFilter((array) $_POST['mime']);
508 $settings->showSubRelevance((int) $_POST['subrelevance']);
509 $settings->enablePrefixWildcardQuery((int) $_POST['prefix']);
510
511 if ($this->form->checkInput()) {
512 $settings->setLastIndexTime($this->form->getItemByPostVar('last_index')->getDate());
513 $settings->update();
514
515 // refresh lucene server
516 try {
517 $this->refreshLuceneSettings();
518 ilUtil::sendInfo($this->lng->txt('settings_saved'));
519 $this->luceneSettingsObject();
520 return true;
521 } catch (Exception $exception) {
522 ilUtil::sendFailure($exception->getMessage());
523 $this->luceneSettingsObject();
524 return false;
525 }
526 }
527
528 ilUtil::sendInfo($this->lng->txt('err_check_input'));
529 $this->form->setValuesByPost();
530 $this->luceneSettingsObject($this->form);
531 return false;
532 }
luceneSettingsObject(ilPropertyFormGUI $form=null)
Lucene settings.
refreshLuceneSettings()
Refresh lucene server settings.
global $ilBench
Definition: ilias.php:18

References $_POST, $ilBench, $ilLog, $ilSetting, ilObjectGUI\$settings, ilSearchSettings\getInstance(), initFormLuceneSettings(), luceneSettingsObject(), refreshLuceneSettings(), ilUtil\sendFailure(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjSearchSettingsGUI::saveSettingsObject ( )

Save settings @access public.

Definition at line 84 of file class.ilObjSearchSettingsGUI.php.

85 {
86 include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
87
88 global $rbacsystem;
89
90 if (!$rbacsystem->checkAccess('write', $this->object->getRefId())) {
91 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
92 }
93
94 $this->object->initSettingsObject();
95 $this->object->settings_obj->setMaxHits((int) $_POST['max_hits']);
96 $this->object->settings_obj->enableIndex($_POST['search_index']);
97 $this->object->settings_obj->enableLucene($_POST['search_lucene']);
98 $this->object->settings_obj->setHideAdvancedSearch($_POST['hide_adv_search']);
99 $this->object->settings_obj->setAutoCompleteLength($_POST['auto_complete_length']);
100 $this->object->settings_obj->setDefaultOperator((int) $_POST['operator']);
101 $this->object->settings_obj->enableLuceneItemFilter((int) $_POST['if']);
102 $this->object->settings_obj->setLuceneItemFilter((array) $_POST['filter']);
103
104
105 $rpc_settings = ilRPCServerSettings::getInstance();
106 if ($this->object->settings_obj->enabledLucene() and !$rpc_settings->pingServer()) {
107 ilUtil::sendInfo($this->lng->txt('search_no_connection_lucene'), true);
108 $this->ctrl->redirect($this, 'settings');
109
110 return false;
111 }
112
113 $this->object->settings_obj->update();
114
115 ilUtil::sendInfo($this->lng->txt('settings_saved'), true);
116 $this->ctrl->redirect($this, 'settings');
117
118 return true;
119 }
static getInstance()
Get singelton instance.
redirection script todo: (a better solution should control the processing via a xml file)

References $_POST, ilObjectGUI\$rbacsystem, ilRPCServerSettings\getInstance(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ settingsObject()

ilObjSearchSettingsGUI::settingsObject ( )

Show settings @access public.

Definition at line 67 of file class.ilObjSearchSettingsGUI.php.

68 {
69 global $ilAccess,$ilErr;
70
71 if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
72 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
73 }
74 $this->tabs_gui->setTabActive('settings');
75 $this->initFormSettings();
76 $this->tpl->setContent($this->form->getHTML());
77 return true;
78 }

References ilObjectGUI\$ilErr, and initFormSettings().

Referenced by updateSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSettingsObject()

ilObjSearchSettingsGUI::updateSettingsObject ( )
protected

Update Settings.

Returns
void

Definition at line 312 of file class.ilObjSearchSettingsGUI.php.

313 {
314 global $ilAccess;
315
316 $this->initFormSettings();
317 $this->form->checkInput();
318
319 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
320 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
321 $GLOBALS['DIC']->ctrl()->redirect($this, 'settings');
322 }
323
324 include_once './Services/Search/classes/class.ilSearchSettings.php';
326 $settings->setMaxHits((int) $_POST['max_hits']);
327
328 switch ((int) $_POST['search_type']) {
330 $settings->enableIndex(false);
331 $settings->enableLucene(false);
332 break;
334 $settings->enableIndex(true);
335 $settings->enableLucene(false);
336 break;
338 $settings->enableIndex(false);
339 $settings->enableLucene(true);
340 break;
341 }
342
343 $settings->setDefaultOperator((int) $_POST['operator']);
344 $settings->enableLuceneItemFilter((int) $_POST['if']);
345 $settings->setLuceneItemFilter((array) $_POST['filter']);
346
347 $settings->setHideAdvancedSearch($_POST['hide_adv_search']);
348 $settings->setAutoCompleteLength($_POST['auto_complete_length']);
349 $settings->showInactiveUser($_POST["inactive_user"]);
350 $settings->showLimitedUser($_POST["limited_user"]);
351 $settings->enableDateFilter($_POST['cdate']);
352 $settings->enableLuceneUserSearch((int) $_POST['user_search_enabled']);
353 $settings->update();
354
355
356 // refresh lucene server
357 try {
358 $this->refreshLuceneSettings();
359 ilUtil::sendInfo($this->lng->txt('settings_saved'));
360 $this->settingsObject();
361 return true;
362 } catch (Exception $exception) {
363 ilUtil::sendFailure($exception->getMessage());
364 $this->settingsObject();
365 return false;
366 }
367
368 unset($_SESSION['search_last_class']);
369 }
$_SESSION["AccountId"]
settingsObject()
Show settings @access public.

References $_POST, $_SESSION, $GLOBALS, ilObjectGUI\$settings, ilSearchSettings\getInstance(), ilSearchSettings\INDEX_SEARCH, initFormSettings(), ilSearchSettings\LIKE_SEARCH, ilSearchSettings\LUCENE_SEARCH, refreshLuceneSettings(), ilUtil\sendFailure(), ilUtil\sendInfo(), and settingsObject().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: