4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
23 function __construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output =
true)
26 parent::__construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
28 $this->lng->loadLanguageModule(
'search');
33 $next_class = $this->ctrl->getNextClass($this);
34 $cmd = $this->ctrl->getCmd();
39 case 'ilpermissiongui':
40 $this->tabs_gui->setTabActive(
'perm_settings');
41 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
43 $ret =& $this->ctrl->forwardCommand($perm_gui);
62 $this->ctrl->redirect($this,
"settings");
73 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
75 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
77 $this->tabs_gui->setTabActive(
'settings');
79 $this->tpl->setContent($this->form->getHTML());
89 include_once
'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
93 if(!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
95 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->MESSAGE);
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']);
110 if($this->
object->settings_obj->enabledLucene()
and !$rpc_settings->pingServer())
113 $this->ctrl->redirect($this,
'settings');
118 $this->
object->settings_obj->update();
121 $this->ctrl->redirect($this,
'settings');
140 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
142 $this->tabs_gui->addTarget(
"settings",
143 $this->ctrl->getLinkTarget($this,
"settings"),
array(
"settings",
"",
"view"),
"",
"");
146 if($rbacsystem->checkAccess(
'read',$this->object->getRefId()))
148 $this->tabs_gui->addTarget(
'lucene_advanced_settings',
149 $this->ctrl->getLinkTarget($this,
'advancedLuceneSettings'));
152 if($rbacsystem->checkAccess(
'read',$this->object->getRefId()))
154 $this->tabs_gui->addTarget(
'lucene_settings_tab',
155 $this->ctrl->getLinkTarget($this,
'luceneSettings'));
159 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
161 $this->tabs_gui->addTarget(
"perm_settings",
162 $this->ctrl->getLinkTargetByClass(
array(get_class($this),
'ilpermissiongui'),
"perm"),
array(
"perm",
"info",
"owner"),
'ilpermissiongui');
175 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
176 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
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'));
187 $hits->
setValue($settings->getMaxHits());
188 $hits->setRequired(
true);
189 for($value = 5; $value <= 50; $value += 5)
191 $values[$value] = $value;
193 $hits->setOptions($values);
194 $hits->setInfo($this->lng->txt(
'seas_max_hits_info'));
195 $this->form->addItem($hits);
201 if($settings->enabledLucene())
205 elseif($settings->enabledIndex())
213 $type->setRequired(
true);
214 $this->form->addItem($type);
219 $operator->setInfo($this->lng->txt(
'lucene_default_operator_info'));
220 $operator->setValue($settings->getDefaultOperator());
223 $operator->addOption($and);
226 $operator->addOption($or);
227 $this->form->addItem($operator);
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'));
233 $us->setChecked($settings->isLuceneUserSearchEnabled());
234 $this->form->addItem($us);
240 $if->setChecked($settings->isLuceneItemFilterEnabled());
241 $if->setInfo($this->lng->txt(
'search_item_filter_form_info'));
242 $this->form->addItem($if);
244 $filter = $settings->getLuceneItemFilter();
248 if(isset($filter[$obj])
and $filter[$obj])
250 $ch->setChecked(
true);
253 $if->addSubItem($ch);
257 $cdate->
setInfo($this->lng->txt(
'search_cdate_filter_info'));
258 $cdate->setChecked($settings->isDateFilterEnabled());
260 $this->form->addItem($cdate);
264 $cb->
setChecked($settings->getHideAdvancedSearch());
265 $this->form->addItem($cb);
274 $si =
new ilSelectInputGUI($lng->txt(
"search_auto_complete_length"),
"auto_complete_length");
276 $val = ($settings->getAutoCompleteLength() > 0)
277 ? $settings->getAutoCompleteLength()
280 $this->form->addItem(
$si);
284 $type->addOption($direct);
286 if($ilDB->supportsFulltext())
289 $type->addOption($index);
293 $type->addOption($lucene);
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);
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);
316 $this->form->checkInput();
318 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
320 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
323 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
325 $settings->setMaxHits((
int)
$_POST[
'max_hits']);
327 switch((
int) $_POST[
'search_type'])
330 $settings->enableIndex(
false);
331 $settings->enableLucene(
false);
334 $settings->enableIndex(
true);
335 $settings->enableLucene(
false);
338 $settings->enableIndex(
false);
339 $settings->enableLucene(
true);
343 $settings->setDefaultOperator((
int) $_POST[
'operator']);
344 $settings->enableLuceneItemFilter((
int) $_POST[
'if']);
345 $settings->setLuceneItemFilter((
array) $_POST[
'filter']);
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']);
381 $this->tabs_gui->setTabActive(
'lucene_settings_tab');
387 $this->tpl->setContent($this->form->getHTML());
397 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
398 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
403 $this->form->setFormAction($this->ctrl->getFormAction($this,
'cancel'));
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'));
421 $if =
new ilCheckboxInputGUI($this->lng->txt(
'search_mime_filter_form'),
'mime_enabled');
423 $if->setChecked($this->
settings->isLuceneMimeFilterEnabled());
424 $if->setInfo($this->lng->txt(
'search_item_filter_form_info'));
425 $this->form->addItem($if);
427 $mimes = $this->
settings->getLuceneMimeFilter();
431 if(isset($mimes[$mime])
and $mimes[$mime])
433 $ch->setChecked(
true);
436 $if->addSubItem($ch);
441 $prefix->setInfo($this->lng->txt(
'lucene_prefix_wildcard_info'));
442 $prefix->setChecked($this->
settings->isPrefixWildcardQueryEnabled());
443 $this->form->addItem($prefix);
446 $numFrag =
new ilNumberInputGUI($this->lng->txt(
'lucene_num_fragments'),
'fragmentCount');
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);
456 $sizeFrag =
new ilNumberInputGUI($this->lng->txt(
'lucene_size_fragments'),
'fragmentSize');
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);
466 $maxSub =
new ilNumberInputGUI($this->lng->txt(
'lucene_max_sub'),
'maxSubitems');
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);
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);
485 $subrel->setOptionTitle($this->lng->txt(
'lucene_show_sub_relevance'));
486 $subrel->setValue(1);
487 $subrel->setChecked($this->
settings->isSubRelevanceVisible());
488 $relevance->addSubItem($subrel);
491 $last_index =
new ilDateTimeInputGUI($this->lng->txt(
'lucene_last_index_time'),
'last_index');
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);
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']);
522 if($this->form->checkInput())
524 $settings->setLastIndexTime($this->form->getItemByPostVar(
'last_index')->getDate());
543 $this->form->setValuesByPost();
563 include_once
'./Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
567 ilLoggerFactory::getLogger(
'src')->error(
'Refresh of lucene server settings failed with message: ' . $exception->getMessage());
575 $this->tabs_gui->setTabActive(
'lucene_advanced_settings');
577 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchActivationTableGUI.php';
578 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
581 $table->setTitle($this->lng->txt(
'lucene_advanced_settings_table'));
584 $this->tpl->setContent($table->getHTML());
589 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
594 $settings->setActive($field,in_array($field,(
array)
$_POST[
'fid']) ?
true :
false);
609 $this->tabs_gui->addSubTabTarget(
'lucene_general_settings',
610 $this->ctrl->getLinkTarget($this,
'luceneSettings'));
advancedLuceneSettingsObject()
This class represents an option in a radio group.
updateSettingsObject()
Update Settings.
settingsObject()
Show settings public.
static getLuceneItemFilterDefinitions()
Get lucene item filter definitions.
saveLuceneSettingsObject()
Save Lucene settings.
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
initFormSettings()
Init settings form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initFormLuceneSettings()
Show lucene settings form.
prepareOutput($a_show_subobjects=true)
prepare output
static getLuceneMimeFilterDefinitions()
if(!is_array($argv)) $options
Class ilObjectGUI Basic methods of all Output classes.
Activation of meta data fields.
redirection script todo: (a better solution should control the processing via a xml file) ...
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor public.
Create new PHPExcel object
obj_idprivate
luceneSettingsObject(ilPropertyFormGUI $form=null)
Lucene settings.
static getFields()
Return an array of all meta data fields.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getLogger($a_component_id)
Get component logger.
refreshLuceneSettings()
Refresh lucene server settings.
saveSettingsObject()
Save settings public.
saveAdvancedLuceneSettingsObject()
static getInstance()
Get singelton instance.