ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjSearchSettingsGUI Class Reference
+ Inheritance diagram for ilObjSearchSettingsGUI:
+ Collaboration diagram for ilObjSearchSettingsGUI:

Public Member Functions

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

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

Protected Attributes

 $dic
 
 $error
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 

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

33 {
34 global $DIC, $ilErr;
35 $this->dic = $DIC;
36 $this->error = $ilErr;
37 $this->type = "seas";
38 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
39
40 $this->lng->loadLanguageModule('search');
41 }
error($a_errmsg)
set error message @access public
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilObjectGUI\$ilErr, ILIAS\GlobalScreen\Provider\__construct(), and error().

+ Here is the call graph for this function:

Member Function Documentation

◆ advancedLuceneSettingsObject()

ilObjSearchSettingsGUI::advancedLuceneSettingsObject ( )
protected

show advanced settings

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

584 {
585 $this->initSubTabs('lucene');
586 $this->tabs_gui->setTabActive('lucene_advanced_settings');
587
588 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchActivationTableGUI.php';
589 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
590
591 $table = new ilLuceneAdvancedSearchActivationTableGUI($this, 'advancedLuceneSettings');
592 $table->setTitle($this->lng->txt('lucene_advanced_settings_table'));
594
595 $this->tpl->setContent($table->getHTML());
596 }

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

70 {
71 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
72 $this->ctrl->redirect($this, "settings");
73 }
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 43 of file class.ilObjSearchSettingsGUI.php.

44 {
45 $next_class = $this->ctrl->getNextClass($this);
46 $cmd = $this->ctrl->getCmd();
47 $this->prepareOutput();
48
49 switch ($next_class) {
50 case 'ilpermissiongui':
51 $this->tabs_gui->setTabActive('perm_settings');
52 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
53 $perm_gui = new ilPermissionGUI($this);
54 $ret = &$this->ctrl->forwardCommand($perm_gui);
55 break;
56
57 default:
58 if ($cmd == "" || $cmd == "view") {
59 $cmd = "settings";
60 }
61 $cmd .= "Object";
62 $this->$cmd();
63
64 break;
65 }
66 return true;
67 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6

References $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSearchSettingsGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

134 {
135 $this->getTabs();
136 }
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 143 of file class.ilObjSearchSettingsGUI.php.

144 {
145 global $DIC;
146
147 $rbacsystem = $DIC['rbacsystem'];
148
149 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
150 $this->tabs_gui->addTarget(
151 "settings",
152 $this->ctrl->getLinkTarget($this, "settings"),
153 array("settings","", "view"),
154 "",
155 ""
156 );
157 }
158
159 if ($rbacsystem->checkAccess('read', $this->object->getRefId())) {
160 $this->tabs_gui->addTarget(
161 'lucene_advanced_settings',
162 $this->ctrl->getLinkTarget($this, 'advancedLuceneSettings')
163 );
164 }
165
166 if ($rbacsystem->checkAccess('read', $this->object->getRefId())) {
167 $this->tabs_gui->addTarget(
168 'lucene_settings_tab',
169 $this->ctrl->getLinkTarget($this, 'luceneSettings')
170 );
171 }
172
173
174 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
175 $this->tabs_gui->addTarget(
176 "perm_settings",
177 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
178 array("perm","info","owner"),
179 'ilpermissiongui'
180 );
181 }
182 }

References $DIC, and ilObjectGUI\$rbacsystem.

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ initFormLuceneSettings()

ilObjSearchSettingsGUI::initFormLuceneSettings ( )
protected

Show lucene settings form.

Parameters

return

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

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

Referenced by luceneSettingsObject(), and saveLuceneSettingsObject().

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

◆ initFormSettings()

ilObjSearchSettingsGUI::initFormSettings ( )
protected

Init settings form.

Returns
void

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

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

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

Referenced by settingsObject(), and updateSettingsObject().

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

◆ initSubTabs()

ilObjSearchSettingsGUI::initSubTabs (   $a_section)
protected

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

624 {
625 switch ($a_section) {
626 case 'lucene':
627 $this->tabs_gui->addSubTabTarget(
628 'lucene_general_settings',
629 $this->ctrl->getLinkTarget($this, 'luceneSettings')
630 );
631
632 break;
633 }
634 }

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

396 {
397 $this->initSubTabs('lucene');
398 $this->tabs_gui->setTabActive('lucene_settings_tab');
399
400 if (!$form instanceof ilPropertyFormGUI) {
401 $this->initFormLuceneSettings();
402 }
403 $this->tpl->setContent($this->form->getHTML());
404 }
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 561 of file class.ilObjSearchSettingsGUI.php.

562 {
563 global $DIC;
564
565 $ilSetting = $DIC['ilSetting'];
566
567 if (!ilSearchSettings::getInstance()->enabledLucene()) {
568 return true;
569 }
570
571 try {
572 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
573 ilRpcClientFactory::factory('RPCAdministration')->refreshSettings(CLIENT_ID . '_' . $ilSetting->get('inst_id', 0));
574 } catch (Exception $exception) {
575 ilLoggerFactory::getLogger('src')->error('Refresh of lucene server settings failed with message: ' . $exception->getMessage());
576 throw $exception;
577 }
578 }
static getLogger($a_component_id)
Get component logger.
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
const CLIENT_ID
Definition: constants.php:39
global $ilSetting
Definition: privfeed.php:17

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

Referenced by saveLuceneSettingsObject(), and updateSettingsObject().

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

◆ saveAdvancedLuceneSettingsObject()

ilObjSearchSettingsGUI::saveAdvancedLuceneSettingsObject ( )
protected

Save advanced settings.

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

602 {
603 $access = $GLOBALS['DIC']->access();
604
605 if (!$access->checkAccess('write', '', $this->object->getRefId())) {
606 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
607 $GLOBALS['DIC']->ctrl()->redirect($this, 'settings');
608 }
609
610
612 foreach (ilLuceneAdvancedSearchFields::getFields() as $field => $translation) {
613 $settings->setActive($field, in_array($field, (array) $_POST['fid']) ? true : false);
614 }
615 $settings->save();
616 ilUtil::sendInfo($this->lng->txt('settings_saved'));
618 }
$_POST["username"]
static getFields()
Return an array of all meta data fields.
advancedLuceneSettingsObject()
show advanced settings
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

+ Here is the call graph for this function:

◆ saveLuceneSettingsObject()

ilObjSearchSettingsGUI::saveLuceneSettingsObject ( )
protected

Save Lucene settings.

Returns

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

514 {
515 global $DIC;
516
517 $ilBench = $DIC['ilBench'];
518 $ilLog = $DIC['ilLog'];
519 $ilSetting = $DIC['ilSetting'];
520
521 $this->initFormLuceneSettings();
522
524 $settings->setFragmentCount((int) $_POST['fragmentCount']);
525 $settings->setFragmentSize((int) $_POST['fragmentSize']);
526 $settings->setMaxSubitems((int) $_POST['maxSubitems']);
527 $settings->showRelevance((int) $_POST['relevance']);
528 $settings->enableLuceneOfflineFilter((int) $_POST['offline_filter']);
529 $settings->enableLuceneMimeFilter((int) $_POST['mime_enabled']);
530 $settings->setLuceneMimeFilter((array) $_POST['mime']);
531 $settings->showSubRelevance((int) $_POST['subrelevance']);
532 $settings->enablePrefixWildcardQuery((int) $_POST['prefix']);
533
534 if ($this->form->checkInput()) {
535 $settings->setLastIndexTime($this->form->getItemByPostVar('last_index')->getDate());
536 $settings->update();
537
538 // refresh lucene server
539 try {
540 $this->refreshLuceneSettings();
541 ilUtil::sendInfo($this->lng->txt('settings_saved'));
542 $this->luceneSettingsObject();
543 return true;
544 } catch (Exception $exception) {
545 ilUtil::sendFailure($exception->getMessage());
546 $this->luceneSettingsObject();
547 return false;
548 }
549 }
550
551 ilUtil::sendInfo($this->lng->txt('err_check_input'));
552 $this->form->setValuesByPost();
553 $this->luceneSettingsObject($this->form);
554 return false;
555 }
luceneSettingsObject(ilPropertyFormGUI $form=null)
Lucene settings.
refreshLuceneSettings()
Refresh lucene server settings.
global $ilBench
Definition: ilias.php:21

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

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjSearchSettingsGUI::saveSettingsObject ( )

Save settings @access public.

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

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

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

+ Here is the call graph for this function:

◆ settingsObject()

ilObjSearchSettingsGUI::settingsObject ( )

Show settings @access public.

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

80 {
81 if (!$this->dic->rbac()->system()->checkAccess("visible,read", $this->object->getRefId())) {
82 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
83 }
84 $this->tabs_gui->setTabActive('settings');
85 $this->initFormSettings();
86 $this->tpl->setContent($this->form->getHTML());
87 return true;
88 }

References error(), 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 329 of file class.ilObjSearchSettingsGUI.php.

330 {
331 global $DIC;
332
333 $ilAccess = $DIC['ilAccess'];
334
335 $this->initFormSettings();
336 $this->form->checkInput();
337
338 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
339 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
340 $GLOBALS['DIC']->ctrl()->redirect($this, 'settings');
341 }
342
343 include_once './Services/Search/classes/class.ilSearchSettings.php';
345 $settings->setMaxHits((int) $_POST['max_hits']);
346
347 switch ((int) $_POST['search_type']) {
349 $settings->enableIndex(false);
350 $settings->enableLucene(false);
351 break;
353 $settings->enableIndex(true);
354 $settings->enableLucene(false);
355 break;
357 $settings->enableIndex(false);
358 $settings->enableLucene(true);
359 break;
360 }
361
362 $settings->setDefaultOperator((int) $_POST['operator']);
363 $settings->enableLuceneItemFilter((int) $_POST['if']);
364 $settings->setLuceneItemFilter((array) $_POST['filter']);
365
366 $settings->setHideAdvancedSearch($_POST['hide_adv_search']);
367 $settings->setAutoCompleteLength($_POST['auto_complete_length']);
368 $settings->showInactiveUser($_POST["inactive_user"]);
369 $settings->showLimitedUser($_POST["limited_user"]);
370 $settings->enableDateFilter($_POST['cdate']);
371 $settings->enableLuceneUserSearch((int) $_POST['user_search_enabled']);
372 $settings->update();
373
374
375 // refresh lucene server
376 try {
377 $this->refreshLuceneSettings();
378 ilUtil::sendInfo($this->lng->txt('settings_saved'));
379 $this->settingsObject();
380 return true;
381 } catch (Exception $exception) {
382 ilUtil::sendFailure($exception->getMessage());
383 $this->settingsObject();
384 return false;
385 }
386
387 unset($_SESSION['search_last_class']);
388 }
$_SESSION["AccountId"]
settingsObject()
Show settings @access public.

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

+ Here is the call graph for this function:

Field Documentation

◆ $dic

ilObjSearchSettingsGUI::$dic
protected

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

◆ $error

ilObjSearchSettingsGUI::$error
protected

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


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