ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 public. More...
 
 executeCommand ()
 
 cancelObject ()
 
 settingsObject ()
 Show settings public. More...
 
 saveSettingsObject ()
 Save settings public. More...
 
 getAdminTabs ()
 
 getTabs ()
 get tabs 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 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...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. 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
 getObjectService ()
 Get object service. More...
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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 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 576 of file class.ilObjSearchSettingsGUI.php.

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

Referenced by saveAdvancedLuceneSettingsObject().

577  {
578  $this->initSubTabs('lucene');
579  $this->tabs_gui->setTabActive('lucene_advanced_settings');
580 
581  include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchActivationTableGUI.php';
582  include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
583 
584  $table = new ilLuceneAdvancedSearchActivationTableGUI($this, 'advancedLuceneSettings');
585  $table->setTitle($this->lng->txt('lucene_advanced_settings_table'));
587 
588  $this->tpl->setContent($table->getHTML());
589  }
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelObject()

ilObjSearchSettingsGUI::cancelObject ( )

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

References ilUtil\sendInfo().

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.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSearchSettingsGUI::executeCommand ( )

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

References $ret, and ilObjectGUI\prepareOutput().

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
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSearchSettingsGUI::getAdminTabs ( )

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

References getTabs().

127  {
128  $this->getTabs();
129  }
+ Here is the call graph for this function:

◆ getTabs()

ilObjSearchSettingsGUI::getTabs ( )

get tabs public

Parameters
objecttabs gui object

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

References $DIC.

Referenced by getAdminTabs().

137  {
138  global $DIC;
139 
140  $rbacsystem = $DIC['rbacsystem'];
141 
142  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
143  $this->tabs_gui->addTarget(
144  "settings",
145  $this->ctrl->getLinkTarget($this, "settings"),
146  array("settings","", "view"),
147  "",
148  ""
149  );
150  }
151 
152  if ($rbacsystem->checkAccess('read', $this->object->getRefId())) {
153  $this->tabs_gui->addTarget(
154  'lucene_advanced_settings',
155  $this->ctrl->getLinkTarget($this, 'advancedLuceneSettings')
156  );
157  }
158 
159  if ($rbacsystem->checkAccess('read', $this->object->getRefId())) {
160  $this->tabs_gui->addTarget(
161  'lucene_settings_tab',
162  $this->ctrl->getLinkTarget($this, 'luceneSettings')
163  );
164  }
165 
166 
167  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
168  $this->tabs_gui->addTarget(
169  "perm_settings",
170  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
171  array("perm","info","owner"),
172  'ilpermissiongui'
173  );
174  }
175  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ initFormLuceneSettings()

ilObjSearchSettingsGUI::initFormLuceneSettings ( )
protected

Show lucene settings form.

Parameters

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

References ilObjectGUI\$access, $def, $GLOBALS, ilSearchSettings\getInstance(), ilSearchSettings\getLuceneMimeFilterDefinitions(), ilCheckboxInputGUI\setChecked(), ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), settings(), and ilCheckboxInputGUI\setValue().

Referenced by luceneSettingsObject(), and saveLuceneSettingsObject().

405  {
406  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
407  include_once './Services/Search/classes/class.ilSearchSettings.php';
408 
410 
411  $this->form = new ilPropertyFormGUI();
412  $this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel'));
413 
414  $this->form->setTitle($this->lng->txt('lucene_settings_title'));
415 
416  $access = $GLOBALS['DIC']->access();
417  if ($access->checkAccess('write', '', $this->object->getRefId())) {
418  $this->form->addCommandButton('saveLuceneSettings', $this->lng->txt('save'));
419  }
420 
421 
422 
423  // Item filter
424  $if = new ilCheckboxInputGUI($this->lng->txt('search_mime_filter_form'), 'mime_enabled');
425  $if->setValue(1);
426  $if->setChecked($this->settings->isLuceneMimeFilterEnabled());
427  $if->setInfo($this->lng->txt('search_mime_filter_form_info'));
428  $this->form->addItem($if);
429 
430  $mimes = $this->settings->getLuceneMimeFilter();
432  $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'mime[' . $mime . ']');
433  if (isset($mimes[$mime]) and $mimes[$mime]) {
434  $ch->setChecked(true);
435  }
436  $ch->setValue(1);
437  $if->addSubItem($ch);
438  }
439 
440  $prefix = new ilCheckboxInputGUI($this->lng->txt('lucene_prefix_wildcard'), 'prefix');
441  $prefix->setValue(1);
442  $prefix->setInfo($this->lng->txt('lucene_prefix_wildcard_info'));
443  $prefix->setChecked($this->settings->isPrefixWildcardQueryEnabled());
444  $this->form->addItem($prefix);
445 
446 
447  $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'), 'fragmentCount');
448  $numFrag->setRequired(true);
449  $numFrag->setSize(2);
450  $numFrag->setMaxLength(2);
451  $numFrag->setMinValue(1);
452  $numFrag->setMaxValue(10);
453  $numFrag->setInfo($this->lng->txt('lucene_num_frag_info'));
454  $numFrag->setValue($this->settings->getFragmentCount());
455  $this->form->addItem($numFrag);
456 
457  $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'), 'fragmentSize');
458  $sizeFrag->setRequired(true);
459  $sizeFrag->setSize(2);
460  $sizeFrag->setMaxLength(4);
461  $sizeFrag->setMinValue(10);
462  $sizeFrag->setMaxValue(1000);
463  $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info'));
464  $sizeFrag->setValue($this->settings->getFragmentSize());
465  $this->form->addItem($sizeFrag);
466 
467  $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'), 'maxSubitems');
468  $maxSub->setRequired(true);
469  $maxSub->setSize(2);
470  $maxSub->setMaxLength(2);
471  $maxSub->setMinValue(1);
472  $maxSub->setMaxValue(10);
473  $maxSub->setInfo($this->lng->txt('lucene_max_sub_info'));
474  $maxSub->setValue($this->settings->getMaxSubitems());
475  $this->form->addItem($maxSub);
476 
477  $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'), 'relevance');
478  $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance'));
479  $relevance->setInfo($this->lng->txt('lucene_show_relevance_info'));
480  $relevance->setValue(1);
481  $relevance->setChecked($this->settings->isRelevanceVisible());
482  $this->form->addItem($relevance);
483 
484  // begin-patch mime_filter
485  $subrel = new ilCheckboxInputGUI('', 'subrelevance');
486  $subrel->setOptionTitle($this->lng->txt('lucene_show_sub_relevance'));
487  $subrel->setValue(1);
488  $subrel->setChecked($this->settings->isSubRelevanceVisible());
489  $relevance->addSubItem($subrel);
490  // end-patch mime_filter
491 
492  $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'), 'last_index');
493  $last_index->setRequired(true);
494  $last_index->setShowTime(true);
495  $last_index->setDate($this->settings->getLastIndexTime());
496  $last_index->setInfo($this->lng->txt('lucene_last_index_time_info'));
497  $this->form->addItem($last_index);
498 
499  return true;
500  }
settings()
Definition: settings.php:2
This class represents a property form user interface.
This class represents a checkbox property in a property form.
This class represents a date/time property in a property form.
setChecked($a_checked)
Set Checked.
static getLuceneMimeFilterDefinitions()
This class represents a number property in a property form.
setValue($a_value)
Set Value.
$def
Definition: croninfo.php:21
setOptionTitle($a_optiontitle)
Set Option Title (optional).
setRequired($a_required)
Set Required.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 181 of file class.ilObjSearchSettingsGUI.php.

References ilObjectGUI\$access, $def, $DIC, $GLOBALS, $ilDB, $index, ilObjectGUI\$lng, PHPMailer\PHPMailer\$options, ilObjectGUI\$settings, $si, $type, $values, ilSearchSettings\getLuceneItemFilterDefinitions(), ilSearchSettings\INDEX_SEARCH, ilSearchSettings\LIKE_SEARCH, ilSearchSettings\LUCENE_SEARCH, ilSearchSettings\OPERATOR_AND, ilSearchSettings\OPERATOR_OR, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilSelectInputGUI\setValue(), and ilCheckboxInputGUI\setValue().

Referenced by settingsObject(), and updateSettingsObject().

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

Referenced by advancedLuceneSettingsObject(), and luceneSettingsObject().

617  {
618  switch ($a_section) {
619  case 'lucene':
620  $this->tabs_gui->addSubTabTarget(
621  'lucene_general_settings',
622  $this->ctrl->getLinkTarget($this, 'luceneSettings')
623  );
624 
625  break;
626  }
627  }
+ Here is the caller graph for this function:

◆ luceneSettingsObject()

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

Lucene settings.

Parameters

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

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

Referenced by saveLuceneSettingsObject().

389  {
390  $this->initSubTabs('lucene');
391  $this->tabs_gui->setTabActive('lucene_settings_tab');
392 
393  if (!$form instanceof ilPropertyFormGUI) {
394  $this->initFormLuceneSettings();
395  }
396  $this->tpl->setContent($this->form->getHTML());
397  }
This class represents a property form user interface.
initFormLuceneSettings()
Show lucene settings form.
+ 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 554 of file class.ilObjSearchSettingsGUI.php.

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

Referenced by saveLuceneSettingsObject(), and updateSettingsObject().

555  {
556  global $DIC;
557 
558  $ilSetting = $DIC['ilSetting'];
559 
560  if (!ilSearchSettings::getInstance()->enabledLucene()) {
561  return true;
562  }
563 
564  try {
565  include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
566  ilRpcClientFactory::factory('RPCAdministration')->refreshSettings(CLIENT_ID . '_' . $ilSetting->get('inst_id', 0));
567  } catch (Exception $exception) {
568  ilLoggerFactory::getLogger('src')->error('Refresh of lucene server settings failed with message: ' . $exception->getMessage());
569  throw $exception;
570  }
571  }
global $DIC
Definition: saml.php:7
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
global $ilSetting
Definition: privfeed.php:17
static getLogger($a_component_id)
Get component logger.
+ 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 594 of file class.ilObjSearchSettingsGUI.php.

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

595  {
596  $access = $GLOBALS['DIC']->access();
597 
598  if (!$access->checkAccess('write', '', $this->object->getRefId())) {
599  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
600  $GLOBALS['DIC']->ctrl()->redirect($this, 'settings');
601  }
602 
603 
605  foreach (ilLuceneAdvancedSearchFields::getFields() as $field => $translation) {
606  $settings->setActive($field, in_array($field, (array) $_POST['fid']) ? true : false);
607  }
608  $settings->save();
609  ilUtil::sendInfo($this->lng->txt('settings_saved'));
611  }
advancedLuceneSettingsObject()
show advanced settings
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getFields()
Return an array of all meta data fields.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ saveLuceneSettingsObject()

ilObjSearchSettingsGUI::saveLuceneSettingsObject ( )
protected

Save Lucene settings.

Returns

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

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

507  {
508  global $DIC;
509 
510  $ilBench = $DIC['ilBench'];
511  $ilLog = $DIC['ilLog'];
512  $ilSetting = $DIC['ilSetting'];
513 
514  $this->initFormLuceneSettings();
515 
517  $settings->setFragmentCount((int) $_POST['fragmentCount']);
518  $settings->setFragmentSize((int) $_POST['fragmentSize']);
519  $settings->setMaxSubitems((int) $_POST['maxSubitems']);
520  $settings->showRelevance((int) $_POST['relevance']);
521  $settings->enableLuceneOfflineFilter((int) $_POST['offline_filter']);
522  $settings->enableLuceneMimeFilter((int) $_POST['mime_enabled']);
523  $settings->setLuceneMimeFilter((array) $_POST['mime']);
524  $settings->showSubRelevance((int) $_POST['subrelevance']);
525  $settings->enablePrefixWildcardQuery((int) $_POST['prefix']);
526 
527  if ($this->form->checkInput()) {
528  $settings->setLastIndexTime($this->form->getItemByPostVar('last_index')->getDate());
529  $settings->update();
530 
531  // refresh lucene server
532  try {
533  $this->refreshLuceneSettings();
534  ilUtil::sendInfo($this->lng->txt('settings_saved'));
535  $this->luceneSettingsObject();
536  return true;
537  } catch (Exception $exception) {
538  ilUtil::sendFailure($exception->getMessage());
539  $this->luceneSettingsObject();
540  return false;
541  }
542  }
543 
544  ilUtil::sendInfo($this->lng->txt('err_check_input'));
545  $this->form->setValuesByPost();
546  $this->luceneSettingsObject($this->form);
547  return false;
548  }
global $DIC
Definition: saml.php:7
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initFormLuceneSettings()
Show lucene settings form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
luceneSettingsObject(ilPropertyFormGUI $form=null)
Lucene settings.
global $ilSetting
Definition: privfeed.php:17
global $ilBench
Definition: ilias.php:18
refreshLuceneSettings()
Refresh lucene server settings.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjSearchSettingsGUI::saveSettingsObject ( )

Save settings public.

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

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

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

◆ settingsObject()

ilObjSearchSettingsGUI::settingsObject ( )

Show settings public.

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

References $DIC, ilObjectGUI\$ilErr, and initFormSettings().

Referenced by updateSettingsObject().

68  {
69  global $DIC;
70 
71  $ilAccess = $DIC['ilAccess'];
72  $ilErr = $DIC['ilErr'];
73 
74  if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
75  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
76  }
77  $this->tabs_gui->setTabActive('settings');
78  $this->initFormSettings();
79  $this->tpl->setContent($this->form->getHTML());
80  return true;
81  }
global $DIC
Definition: saml.php:7
initFormSettings()
Init settings form.
+ 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 322 of file class.ilObjSearchSettingsGUI.php.

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

323  {
324  global $DIC;
325 
326  $ilAccess = $DIC['ilAccess'];
327 
328  $this->initFormSettings();
329  $this->form->checkInput();
330 
331  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
332  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
333  $GLOBALS['DIC']->ctrl()->redirect($this, 'settings');
334  }
335 
336  include_once './Services/Search/classes/class.ilSearchSettings.php';
338  $settings->setMaxHits((int) $_POST['max_hits']);
339 
340  switch ((int) $_POST['search_type']) {
342  $settings->enableIndex(false);
343  $settings->enableLucene(false);
344  break;
346  $settings->enableIndex(true);
347  $settings->enableLucene(false);
348  break;
350  $settings->enableIndex(false);
351  $settings->enableLucene(true);
352  break;
353  }
354 
355  $settings->setDefaultOperator((int) $_POST['operator']);
356  $settings->enableLuceneItemFilter((int) $_POST['if']);
357  $settings->setLuceneItemFilter((array) $_POST['filter']);
358 
359  $settings->setHideAdvancedSearch($_POST['hide_adv_search']);
360  $settings->setAutoCompleteLength($_POST['auto_complete_length']);
361  $settings->showInactiveUser($_POST["inactive_user"]);
362  $settings->showLimitedUser($_POST["limited_user"]);
363  $settings->enableDateFilter($_POST['cdate']);
364  $settings->enableLuceneUserSearch((int) $_POST['user_search_enabled']);
365  $settings->update();
366 
367 
368  // refresh lucene server
369  try {
370  $this->refreshLuceneSettings();
371  ilUtil::sendInfo($this->lng->txt('settings_saved'));
372  $this->settingsObject();
373  return true;
374  } catch (Exception $exception) {
375  ilUtil::sendFailure($exception->getMessage());
376  $this->settingsObject();
377  return false;
378  }
379 
380  unset($_SESSION['search_last_class']);
381  }
settingsObject()
Show settings public.
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
initFormSettings()
Init settings form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
refreshLuceneSettings()
Refresh lucene server settings.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

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