ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjSearchSettingsGUI Class Reference
+ Inheritance diagram for ilObjSearchSettingsGUI:
+ Collaboration diagram for ilObjSearchSettingsGUI:

Public Member Functions

 ilObjSearchSettingsGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 cancelObject ()
 
 settingsObject ()
 Show settings @access public. More...
 
 saveSettingsObject ()
 Save settings @access public. More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getTabs (&$tabs_gui)
 get tabs @access public More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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 ()
 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 ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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
 

Detailed Description

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

Member Function Documentation

◆ advancedLuceneSettingsObject()

ilObjSearchSettingsGUI::advancedLuceneSettingsObject ( )
protected

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

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

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 ( )

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()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSearchSettingsGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

127 {
128 $this->getTabs($tabs_gui);
129 }
getTabs(&$tabs_gui)
get tabs @access public

References getTabs().

+ Here is the call graph for this function:

◆ getTabs()

ilObjSearchSettingsGUI::getTabs ( $tabs_gui)

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 $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 $tabs_gui->addTarget('lucene_advanced_settings',
149 $this->ctrl->getLinkTarget($this,'advancedLuceneSettings'));
150 }
151
152 if($rbacsystem->checkAccess('read',$this->object->getRefId()))
153 {
154 $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 $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:

◆ ilObjSearchSettingsGUI()

ilObjSearchSettingsGUI::ilObjSearchSettingsGUI (   $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 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
27
28 $this->lng->loadLanguageModule('search');
29 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References ilObjectGUI\ilObjectGUI().

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

References ilSearchSettings\getInstance(), and ilSearchSettings\getLuceneMimeFilterDefinitions().

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->getDBType() == 'mysql')
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 599 of file class.ilObjSearchSettingsGUI.php.

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

Referenced by advancedLuceneSettingsObject(), and luceneSettingsObject().

+ Here is the caller graph for this function:

◆ luceneSettingsObject()

ilObjSearchSettingsGUI::luceneSettingsObject ( )
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 $this->initFormLuceneSettings();
384 $this->tpl->setContent($this->form->getHTML());
385 }
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 547 of file class.ilObjSearchSettingsGUI.php.

548 {
549 global $ilSetting;
550
551 if(!ilSearchSettings::getInstance()->enabledLucene())
552 {
553 return true;
554 }
555
556 try
557 {
558 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
559 ilRpcClientFactory::factory('RPCAdministration')->refreshSettings(CLIENT_ID.'_'.$ilSetting->get('inst_id',0));
560 }
561 catch (Exception $exception) {
562 ilLoggerFactory::getLogger('src')->error('Refresh of lucene server settings failed with message: ' . $exception->getMessage());
563 throw $exception;
564 }
565 }
static getLogger($a_component_id)
Get component logger.
static factory($a_package)
Create an XML_RPC2 client instance.
global $ilSetting
Definition: privfeed.php:40

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

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

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

502 {
504
505 $this->initFormLuceneSettings();
506
507 $settings = ilSearchSettings::getInstance();
508 $settings->setFragmentCount((int) $_POST['fragmentCount']);
509 $settings->setFragmentSize((int) $_POST['fragmentSize']);
510 $settings->setMaxSubitems((int) $_POST['maxSubitems']);
511 $settings->showRelevance((int) $_POST['relevance']);
512 $settings->enableLuceneOfflineFilter((int) $_POST['offline_filter']);
513 $settings->enableLuceneMimeFilter((int) $_POST['mime_enabled']);
514 $settings->setLuceneMimeFilter((array) $_POST['mime']);
515 $settings->showSubRelevance((int) $_POST['subrelevance']);
516 $settings->enablePrefixWildcardQuery((int) $_POST['prefix']);
517
518 if($this->form->checkInput())
519 {
520 $settings->setLastIndexTime($this->form->getItemByPostVar('last_index')->getDate());
521 $settings->update();
522
523 // refresh lucene server
524 try {
525 $this->refreshLuceneSettings();
526 ilUtil::sendInfo($this->lng->txt('settings_saved'));
527 $this->luceneSettingsObject();
528 return true;
529 }
530 catch (Exception $exception)
531 {
532 ilUtil::sendFailure($exception->getMessage());
533 $this->luceneSettingsObject();
534 return false;
535 }
536 }
537
538 ilUtil::sendInfo($this->lng->txt('err_check_input'));
539 $this->luceneSettingsObject();
540 return false;
541 }
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 }

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: