ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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 ()
 
 saveAdvancedLuceneSettingsObject ()
 
 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...
 
 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...
 
 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
 
 $ilias
 
 $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
 $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

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

573 {
574 $this->initSubTabs('lucene');
575 $this->tabs_gui->setTabActive('lucene_advanced_settings');
576
577 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchActivationTableGUI.php';
578 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
579
580 $table = new ilLuceneAdvancedSearchActivationTableGUI($this,'advancedLuceneSettings');
581 $table->setTitle($this->lng->txt('lucene_advanced_settings_table'));
583
584 $this->tpl->setContent($table->getHTML());
585 }

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

60 {
61 ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
62 $this->ctrl->redirect($this, "settings");
63 }
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 {
39 case 'ilpermissiongui':
40 $this->tabs_gui->setTabActive('perm_settings');
41 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
42 $perm_gui = new ilPermissionGUI($this);
43 $ret =& $this->ctrl->forwardCommand($perm_gui);
44 break;
45
46 default:
47 if($cmd == "" || $cmd == "view")
48 {
49 $cmd = "settings";
50 }
51 $cmd .= "Object";
52 $this->$cmd();
53
54 break;
55 }
56 return true;
57 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

References $cmd, $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 126 of file class.ilObjSearchSettingsGUI.php.

127 {
128 $this->getTabs();
129 }
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 136 of file class.ilObjSearchSettingsGUI.php.

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

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ initFormLuceneSettings()

ilObjSearchSettingsGUI::initFormLuceneSettings ( )
protected

Show lucene settings form.

Parameters

return

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

396 {
397 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
398 include_once './Services/Search/classes/class.ilSearchSettings.php';
399
401
402 $this->form = new ilPropertyFormGUI();
403 $this->form->setFormAction($this->ctrl->getFormAction($this,'cancel'));
404
405 $this->form->setTitle($this->lng->txt('lucene_settings_title'));
406 $this->form->addCommandButton('saveLuceneSettings',$this->lng->txt('save'));
407 $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
408
409
410 // Offline filter
411 /*
412 $offline = new ilCheckboxInputGUI($this->lng->txt('lucene_offline_filter_setting'),'offline_filter');
413 $offline->setInfo($this->lng->txt('lucene_offline_filter_setting_info'));
414 $offline->setValue(1);
415 $offline->setChecked($this->settings->isLuceneOfflineFilterEnabled());
416 $this->form->addItem($offline);
417 */
418
419
420 // Item filter
421 $if = new ilCheckboxInputGUI($this->lng->txt('search_mime_filter_form'),'mime_enabled');
422 $if->setValue(1);
423 $if->setChecked($this->settings->isLuceneMimeFilterEnabled());
424 $if->setInfo($this->lng->txt('search_item_filter_form_info'));
425 $this->form->addItem($if);
426
427 $mimes = $this->settings->getLuceneMimeFilter();
428 foreach(ilSearchSettings::getLuceneMimeFilterDefinitions() as $mime => $def)
429 {
430 $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']),'mime['.$mime.']');
431 if(isset($mimes[$mime]) and $mimes[$mime])
432 {
433 $ch->setChecked(true);
434 }
435 $ch->setValue(1);
436 $if->addSubItem($ch);
437 }
438
439 $prefix = new ilCheckboxInputGUI($this->lng->txt('lucene_prefix_wildcard'),'prefix');
440 $prefix->setValue(1);
441 $prefix->setInfo($this->lng->txt('lucene_prefix_wildcard_info'));
442 $prefix->setChecked($this->settings->isPrefixWildcardQueryEnabled());
443 $this->form->addItem($prefix);
444
445
446 $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'),'fragmentCount');
447 $numFrag->setRequired(true);
448 $numFrag->setSize(2);
449 $numFrag->setMaxLength(2);
450 $numFrag->setMinValue(1);
451 $numFrag->setMaxValue(10);
452 $numFrag->setInfo($this->lng->txt('lucene_num_frag_info'));
453 $numFrag->setValue($this->settings->getFragmentCount());
454 $this->form->addItem($numFrag);
455
456 $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'),'fragmentSize');
457 $sizeFrag->setRequired(true);
458 $sizeFrag->setSize(2);
459 $sizeFrag->setMaxLength(4);
460 $sizeFrag->setMinValue(10);
461 $sizeFrag->setMaxValue(1000);
462 $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info'));
463 $sizeFrag->setValue($this->settings->getFragmentSize());
464 $this->form->addItem($sizeFrag);
465
466 $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'),'maxSubitems');
467 $maxSub->setRequired(true);
468 $maxSub->setSize(2);
469 $maxSub->setMaxLength(2);
470 $maxSub->setMinValue(1);
471 $maxSub->setMaxValue(10);
472 $maxSub->setInfo($this->lng->txt('lucene_max_sub_info'));
473 $maxSub->setValue($this->settings->getMaxSubitems());
474 $this->form->addItem($maxSub);
475
476 $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'),'relevance');
477 $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance'));
478 $relevance->setInfo($this->lng->txt('lucene_show_relevance_info'));
479 $relevance->setValue(1);
480 $relevance->setChecked($this->settings->isRelevanceVisible());
481 $this->form->addItem($relevance);
482
483 // begin-patch mime_filter
484 $subrel = new ilCheckboxInputGUI('','subrelevance');
485 $subrel->setOptionTitle($this->lng->txt('lucene_show_sub_relevance'));
486 $subrel->setValue(1);
487 $subrel->setChecked($this->settings->isSubRelevanceVisible());
488 $relevance->addSubItem($subrel);
489 // end-patch mime_filter
490
491 $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'),'last_index');
492 $last_index->setRequired(true);
493 $last_index->setShowTime(true);
494 $last_index->setDate($this->settings->getLastIndexTime());
495 $last_index->setInfo($this->lng->txt('lucene_last_index_time_info'));
496 $this->form->addItem($last_index);
497
498 return true;
499 }
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()
settings()
Definition: settings.php:2

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

172 {
173 global $lng,$ilDB;
174
175 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
176 include_once './Services/Search/classes/class.ilSearchSettings.php';
177
178 $settings = new ilSearchSettings();
179
180 $this->form = new ilPropertyFormGUI();
181 $this->form->setFormAction($this->ctrl->getFormAction($this,'updateSettings'));
182 $this->form->addCommandButton('updateSettings',$this->lng->txt('save'));
183 $this->form->setTitle($this->lng->txt('seas_settings'));
184
185 // Max hits
186 $hits = new ilSelectInputGUI($this->lng->txt('seas_max_hits'),'max_hits');
187 $hits->setValue($settings->getMaxHits());
188 $hits->setRequired(true);
189 for($value = 5; $value <= 50; $value += 5)
190 {
191 $values[$value] = $value;
192 }
193 $hits->setOptions($values);
194 $hits->setInfo($this->lng->txt('seas_max_hits_info'));
195 $this->form->addItem($hits);
196
197
198 // Search type
199 $type = new ilRadioGroupInputGUI($this->lng->txt('search_type'),'search_type');
200
201 if($settings->enabledLucene())
202 {
203 $type->setValue(ilSearchSettings::LUCENE_SEARCH);
204 }
205 elseif($settings->enabledIndex())
206 {
207 $type->setValue(ilSearchSettings::INDEX_SEARCH);
208 }
209 else
210 {
211 $type->setValue(ilSearchSettings::LIKE_SEARCH);
212 }
213 $type->setRequired(true);
214 $this->form->addItem($type);
215
216 // Default operator
217 $operator = new ilRadioGroupInputGUI($this->lng->txt('lucene_default_operator'),'operator');
218 $operator->setRequired(true);
219 $operator->setInfo($this->lng->txt('lucene_default_operator_info'));
220 $operator->setValue($settings->getDefaultOperator());
221
222 $and = new ilRadioOption($this->lng->txt('lucene_and'),ilSearchSettings::OPERATOR_AND);
223 $operator->addOption($and);
224
225 $or = new ilRadioOption($this->lng->txt('lucene_or'),ilSearchSettings::OPERATOR_OR);
226 $operator->addOption($or);
227 $this->form->addItem($operator);
228
229 // user search
230 $us = new ilCheckboxInputGUI($this->lng->txt('search_user_search_form'),'user_search_enabled');
231 $us->setInfo($this->lng->txt('search_user_search_info_form'));
232 $us->setValue(1);
233 $us->setChecked($settings->isLuceneUserSearchEnabled());
234 $this->form->addItem($us);
235
236
237 // Item filter
238 $if = new ilCheckboxInputGUI($this->lng->txt('search_item_filter_form'),'if');
239 $if->setValue(1);
240 $if->setChecked($settings->isLuceneItemFilterEnabled());
241 $if->setInfo($this->lng->txt('search_item_filter_form_info'));
242 $this->form->addItem($if);
243
244 $filter = $settings->getLuceneItemFilter();
245 foreach(ilSearchSettings::getLuceneItemFilterDefinitions() as $obj => $def)
246 {
247 $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']),'filter['.$obj.']');
248 if(isset($filter[$obj]) and $filter[$obj])
249 {
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 // number of auto complete entries
268 $options = array(
269 5 => 5,
270 10 => 10,
271 20 => 20,
272 30 => 30
273 );
274 $si = new ilSelectInputGUI($lng->txt("search_auto_complete_length"), "auto_complete_length");
275 $si->setOptions($options);
276 $val = ($settings->getAutoCompleteLength() > 0)
277 ? $settings->getAutoCompleteLength()
278 : 10;
279 $si->setValue($val);
280 $this->form->addItem($si);
281
282
283 $direct = new ilRadioOption($this->lng->txt('search_direct'),ilSearchSettings::LIKE_SEARCH,$this->lng->txt('search_like_info'));
284 $type->addOption($direct);
285
286 if($ilDB->supportsFulltext())
287 {
288 $index = new ilRadioOption($this->lng->txt('search_index'),ilSearchSettings::INDEX_SEARCH,$this->lng->txt('search_full_info'));
289 $type->addOption($index);
290 }
291
292 $lucene = new ilRadioOption($this->lng->txt('search_lucene'),ilSearchSettings::LUCENE_SEARCH,$this->lng->txt('java_server_info'));
293 $type->addOption($lucene);
294
295 $inactive_user = new ilCheckboxInputGUI($this->lng->txt('search_show_inactive_user'), 'inactive_user');
296 $inactive_user->setInfo($this->lng->txt('search_show_inactive_user_info'));
297 $inactive_user->setChecked($settings->isInactiveUserVisible());
298 $this->form->addItem($inactive_user);
299
300 $limited_user = new ilCheckboxInputGUI($this->lng->txt('search_show_limited_user'), 'limited_user');
301 $limited_user->setInfo($this->lng->txt('search_show_limited_user_info'));
302 $limited_user->setChecked($settings->isLimitedUserVisible());
303 $this->form->addItem($limited_user);
304 }
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.
global $ilDB
if(!is_array($argv)) $options

References $ilDB, ilObjectGUI\$lng, $options, $si, 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 604 of file class.ilObjSearchSettingsGUI.php.

605 {
606 switch($a_section)
607 {
608 case 'lucene':
609 $this->tabs_gui->addSubTabTarget('lucene_general_settings',
610 $this->ctrl->getLinkTarget($this,'luceneSettings'));
611
612 break;
613 }
614 }

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

379 {
380 $this->initSubTabs('lucene');
381 $this->tabs_gui->setTabActive('lucene_settings_tab');
382
383 if(!$form instanceof ilPropertyFormGUI)
384 {
385 $this->initFormLuceneSettings();
386 }
387 $this->tpl->setContent($this->form->getHTML());
388 }
initFormLuceneSettings()
Show lucene settings form.

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

553 {
554 global $ilSetting;
555
556 if(!ilSearchSettings::getInstance()->enabledLucene())
557 {
558 return true;
559 }
560
561 try
562 {
563 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
564 ilRpcClientFactory::factory('RPCAdministration')->refreshSettings(CLIENT_ID.'_'.$ilSetting->get('inst_id',0));
565 }
566 catch (Exception $exception) {
567 ilLoggerFactory::getLogger('src')->error('Refresh of lucene server settings failed with message: ' . $exception->getMessage());
568 throw $exception;
569 }
570 }
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

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

588 {
589 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
590
592 foreach(ilLuceneAdvancedSearchFields::getFields() as $field => $translation)
593 {
594 $settings->setActive($field,in_array($field,(array) $_POST['fid']) ? true : false);
595 }
596 $settings->save();
597 ilUtil::sendInfo($this->lng->txt('settings_saved'));
599 }
$_POST["username"]
static getFields()
Return an array of all meta data fields.

References $_POST, advancedLuceneSettingsObject(), ilLuceneAdvancedSearchFields\getFields(), ilLuceneAdvancedSearchSettings\getInstance(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveLuceneSettingsObject()

ilObjSearchSettingsGUI::saveLuceneSettingsObject ( )
protected

Save Lucene settings.

Returns

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

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

References $_POST, $ilBench, $ilLog, $ilSetting, 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 87 of file class.ilObjSearchSettingsGUI.php.

88 {
89 include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
90
91 global $rbacsystem;
92
93 if(!$rbacsystem->checkAccess('write',$this->object->getRefId()))
94 {
95 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
96 }
97
98 $this->object->initSettingsObject();
99 $this->object->settings_obj->setMaxHits((int) $_POST['max_hits']);
100 $this->object->settings_obj->enableIndex($_POST['search_index']);
101 $this->object->settings_obj->enableLucene($_POST['search_lucene']);
102 $this->object->settings_obj->setHideAdvancedSearch($_POST['hide_adv_search']);
103 $this->object->settings_obj->setAutoCompleteLength($_POST['auto_complete_length']);
104 $this->object->settings_obj->setDefaultOperator((int) $_POST['operator']);
105 $this->object->settings_obj->enableLuceneItemFilter((int) $_POST['if']);
106 $this->object->settings_obj->setLuceneItemFilter((array) $_POST['filter']);
107
108
109 $rpc_settings = ilRPCServerSettings::getInstance();
110 if($this->object->settings_obj->enabledLucene() and !$rpc_settings->pingServer())
111 {
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 }
static getInstance()
Get singelton instance.
redirection script todo: (a better solution should control the processing via a xml file)

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

+ Here is the call graph for this function:

◆ settingsObject()

ilObjSearchSettingsGUI::settingsObject ( )

Show settings @access public.

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

70 {
71 global $ilAccess,$ilErr;
72
73 if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
74 {
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 $ilErr
Definition: raiseError.php:16

References $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 311 of file class.ilObjSearchSettingsGUI.php.

312 {
313 global $ilAccess,$ilErr;
314
315 $this->initFormSettings();
316 $this->form->checkInput();
317
318 if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
319 {
320 $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
321 }
322
323 include_once './Services/Search/classes/class.ilSearchSettings.php';
324 $settings = ilSearchSettings::getInstance();
325 $settings->setMaxHits((int) $_POST['max_hits']);
326
327 switch((int) $_POST['search_type'])
328 {
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 }
363 catch (Exception $exception)
364 {
365 ilUtil::sendFailure($exception->getMessage());
366 $this->settingsObject();
367 return false;
368 }
369
370 unset($_SESSION['search_last_class']);
371 }
$_SESSION["AccountId"]
settingsObject()
Show settings @access public.

References $_POST, $_SESSION, $ilErr, 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: