4require_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
   23    public 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();
 
   37        switch ($next_class) {
 
   38            case 'ilpermissiongui':
 
   39                $this->tabs_gui->setTabActive(
'perm_settings');
 
   40                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
   42                $ret = &$this->ctrl->forwardCommand($perm_gui);
 
   46                if ($cmd == 
"" || $cmd == 
"view") {
 
   60        $this->ctrl->redirect($this, 
"settings");
 
   71        $ilAccess = 
$DIC[
'ilAccess'];
 
   74        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        $rbacsystem = 
$DIC[
'rbacsystem'];
 
   95        if (!$rbacsystem->checkAccess(
'write', $this->object->getRefId())) {
 
   96            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
   99        $this->
object->initSettingsObject();
 
  100        $this->
object->settings_obj->setMaxHits((
int) 
$_POST[
'max_hits']);
 
  101        $this->
object->settings_obj->enableIndex($_POST[
'search_index']);
 
  102        $this->
object->settings_obj->enableLucene($_POST[
'search_lucene']);
 
  103        $this->
object->settings_obj->setHideAdvancedSearch($_POST[
'hide_adv_search']);
 
  104        $this->
object->settings_obj->setAutoCompleteLength($_POST[
'auto_complete_length']);
 
  105        $this->
object->settings_obj->setDefaultOperator((
int) $_POST[
'operator']);
 
  106        $this->
object->settings_obj->enableLuceneItemFilter((
int) $_POST[
'if']);
 
  107        $this->
object->settings_obj->setLuceneItemFilter((array) 
$_POST[
'filter']);
 
  111        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        $rbacsystem = 
$DIC[
'rbacsystem'];
 
  142        if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
 
  143            $this->tabs_gui->addTarget(
 
  145                $this->ctrl->getLinkTarget($this, 
"settings"),
 
  146                array(
"settings",
"", 
"view"),
 
  152        if ($rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
 
  153            $this->tabs_gui->addTarget(
 
  154                'lucene_advanced_settings',
 
  155                $this->ctrl->getLinkTarget($this, 
'advancedLuceneSettings')
 
  159        if ($rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
 
  160            $this->tabs_gui->addTarget(
 
  161                'lucene_settings_tab',
 
  162                $this->ctrl->getLinkTarget($this, 
'luceneSettings')
 
  167        if ($rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
 
  168            $this->tabs_gui->addTarget(
 
  170                $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"),
 
  171                array(
"perm",
"info",
"owner"),
 
  190        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  191        include_once 
'./Services/Search/classes/class.ilSearchSettings.php';
 
  196        $this->form->setFormAction($this->ctrl->getFormAction($this, 
'updateSettings'));
 
  198        if (
$access->checkAccess(
'write', 
'', $this->object->getRefId())) {
 
  199            $this->form->addCommandButton(
'updateSettings', $this->lng->txt(
'save'));
 
  201        $this->form->setTitle($this->lng->txt(
'seas_settings'));
 
  205        $hits->setValue(
$settings->getMaxHits());
 
  206        $hits->setRequired(
true);
 
  207        for ($value = 5; $value <= 50; $value += 5) {
 
  211        $hits->setInfo($this->lng->txt(
'seas_max_hits_info'));
 
  212        $this->form->addItem($hits);
 
  225        $type->setRequired(
true);
 
  226        $this->form->addItem(
$type);
 
  230        $operator->setRequired(
true);
 
  231        $operator->setInfo($this->lng->txt(
'lucene_default_operator_info'));
 
  232        $operator->setValue(
$settings->getDefaultOperator());
 
  235        $operator->addOption($and);
 
  238        $operator->addOption($or);
 
  239        $this->form->addItem($operator);
 
  242        $us = 
new ilCheckboxInputGUI($this->lng->txt(
'search_user_search_form'), 
'user_search_enabled');
 
  243        $us->setInfo($this->lng->txt(
'search_user_search_info_form'));
 
  245        $us->setChecked(
$settings->isLuceneUserSearchEnabled());
 
  246        $this->form->addItem($us);
 
  252        $if->setChecked(
$settings->isLuceneItemFilterEnabled());
 
  253        $if->setInfo($this->lng->txt(
'search_item_filter_form_info'));
 
  254        $this->form->addItem($if);
 
  256        $filter = 
$settings->getLuceneItemFilter();
 
  259            if (isset($filter[$obj]) and $filter[$obj]) {
 
  260                $ch->setChecked(
true);
 
  263            $if->addSubItem($ch);
 
  267        $cdate->setInfo($this->lng->txt(
'search_cdate_filter_info'));
 
  268        $cdate->setChecked(
$settings->isDateFilterEnabled());
 
  270        $this->form->addItem($cdate);
 
  274        $cb->setChecked(
$settings->getHideAdvancedSearch());
 
  275        $this->form->addItem($cb);
 
  280        $type->addOption($direct);
 
  282        if (
$ilDB->supportsFulltext()) {
 
  288        $type->addOption($lucene);
 
  300        $val = (
$settings->getAutoCompleteLength() > 0)
 
  304        $this->form->addItem(
$si);
 
  306        $inactive_user = 
new ilCheckboxInputGUI($this->lng->txt(
'search_show_inactive_user'), 
'inactive_user');
 
  307        $inactive_user->setInfo($this->lng->txt(
'search_show_inactive_user_info'));
 
  308        $inactive_user->setChecked(
$settings->isInactiveUserVisible());
 
  309        $this->form->addItem($inactive_user);
 
  311        $limited_user = 
new ilCheckboxInputGUI($this->lng->txt(
'search_show_limited_user'), 
'limited_user');
 
  312        $limited_user->setInfo($this->lng->txt(
'search_show_limited_user_info'));
 
  313        $limited_user->setChecked(
$settings->isLimitedUserVisible());
 
  314        $this->form->addItem($limited_user);
 
  326        $ilAccess = 
$DIC[
'ilAccess'];
 
  329        $this->form->checkInput();
 
  331        if (!$ilAccess->checkAccess(
'write', 
'', $this->object->getRefId())) {
 
  333            $GLOBALS[
'DIC']->ctrl()->redirect($this, 
'settings');
 
  336        include_once 
'./Services/Search/classes/class.ilSearchSettings.php';
 
  340        switch ((
int) 
$_POST[
'search_type']) {
 
  364        $settings->enableLuceneUserSearch((
int) 
$_POST[
'user_search_enabled']);
 
  374        } 
catch (Exception $exception) {
 
  391        $this->tabs_gui->setTabActive(
'lucene_settings_tab');
 
  396        $this->tpl->setContent($this->form->getHTML());
 
  406        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  407        include_once 
'./Services/Search/classes/class.ilSearchSettings.php';
 
  412        $this->form->setFormAction($this->ctrl->getFormAction($this, 
'cancel'));
 
  414        $this->form->setTitle($this->lng->txt(
'lucene_settings_title'));
 
  417        if (
$access->checkAccess(
'write', 
'', $this->object->getRefId())) {
 
  418            $this->form->addCommandButton(
'saveLuceneSettings', $this->lng->txt(
'save'));
 
  424        $if = 
new ilCheckboxInputGUI($this->lng->txt(
'search_mime_filter_form'), 
'mime_enabled');
 
  426        $if->setChecked($this->
settings->isLuceneMimeFilterEnabled());
 
  427        $if->setInfo($this->lng->txt(
'search_mime_filter_form_info'));
 
  428        $this->form->addItem($if);
 
  430        $mimes = $this->
settings->getLuceneMimeFilter();
 
  433            if (isset($mimes[$mime]) and $mimes[$mime]) {
 
  434                $ch->setChecked(
true);
 
  437            $if->addSubItem($ch);
 
  440        $prefix = 
new ilCheckboxInputGUI($this->lng->txt(
'lucene_prefix_wildcard'), 
'prefix');
 
  441        $prefix->setValue(1);
 
  442        $prefix->setInfo($this->lng->txt(
'lucene_prefix_wildcard_info'));
 
  443        $prefix->setChecked($this->
settings->isPrefixWildcardQueryEnabled());
 
  444        $this->form->addItem($prefix);
 
  447        $numFrag = 
new ilNumberInputGUI($this->lng->txt(
'lucene_num_fragments'), 
'fragmentCount');
 
  448        $numFrag->setRequired(
true);
 
  449        $numFrag->setSize(2);
 
  450        $numFrag->setMaxLength(2);
 
  451        $numFrag->setMinValue(1);
 
  452        $numFrag->setMaxValue(10);
 
  453        $numFrag->setInfo($this->lng->txt(
'lucene_num_frag_info'));
 
  454        $numFrag->setValue($this->
settings->getFragmentCount());
 
  455        $this->form->addItem($numFrag);
 
  457        $sizeFrag = 
new ilNumberInputGUI($this->lng->txt(
'lucene_size_fragments'), 
'fragmentSize');
 
  458        $sizeFrag->setRequired(
true);
 
  459        $sizeFrag->setSize(2);
 
  460        $sizeFrag->setMaxLength(4);
 
  461        $sizeFrag->setMinValue(10);
 
  462        $sizeFrag->setMaxValue(1000);
 
  463        $sizeFrag->setInfo($this->lng->txt(
'lucene_size_frag_info'));
 
  464        $sizeFrag->setValue($this->
settings->getFragmentSize());
 
  465        $this->form->addItem($sizeFrag);
 
  467        $maxSub = 
new ilNumberInputGUI($this->lng->txt(
'lucene_max_sub'), 
'maxSubitems');
 
  468        $maxSub->setRequired(
true);
 
  470        $maxSub->setMaxLength(2);
 
  471        $maxSub->setMinValue(1);
 
  472        $maxSub->setMaxValue(10);
 
  473        $maxSub->setInfo($this->lng->txt(
'lucene_max_sub_info'));
 
  474        $maxSub->setValue($this->
settings->getMaxSubitems());
 
  475        $this->form->addItem($maxSub);
 
  477        $relevance = 
new ilCheckboxInputGUI($this->lng->txt(
'lucene_relevance'), 
'relevance');
 
  478        $relevance->setOptionTitle($this->lng->txt(
'lucene_show_relevance'));
 
  479        $relevance->setInfo($this->lng->txt(
'lucene_show_relevance_info'));
 
  480        $relevance->setValue(1);
 
  481        $relevance->setChecked($this->
settings->isRelevanceVisible());
 
  482        $this->form->addItem($relevance);
 
  486        $subrel->setOptionTitle($this->lng->txt(
'lucene_show_sub_relevance'));
 
  487        $subrel->setValue(1);
 
  488        $subrel->setChecked($this->
settings->isSubRelevanceVisible());
 
  489        $relevance->addSubItem($subrel);
 
  492        $last_index = 
new ilDateTimeInputGUI($this->lng->txt(
'lucene_last_index_time'), 
'last_index');
 
  493        $last_index->setRequired(
true);
 
  494        $last_index->setShowTime(
true);
 
  495        $last_index->setDate($this->
settings->getLastIndexTime());
 
  496        $last_index->setInfo($this->lng->txt(
'lucene_last_index_time_info'));
 
  497        $this->form->addItem($last_index);
 
  518        $settings->setFragmentSize((
int) $_POST[
'fragmentSize']);
 
  527        if ($this->form->checkInput()) {
 
  528            $settings->setLastIndexTime($this->form->getItemByPostVar(
'last_index')->getDate());
 
  537            } 
catch (Exception $exception) {
 
  545        $this->form->setValuesByPost();
 
  565            include_once 
'./Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
 
  567        } 
catch (Exception $exception) {
 
  568            ilLoggerFactory::getLogger(
'src')->error(
'Refresh of lucene server settings failed with message: ' . $exception->getMessage());
 
  579        $this->tabs_gui->setTabActive(
'lucene_advanced_settings');
 
  581        include_once 
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchActivationTableGUI.php';
 
  582        include_once 
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
 
  585        $table->setTitle($this->lng->txt(
'lucene_advanced_settings_table'));
 
  588        $this->tpl->setContent(
$table->getHTML());
 
  598        if (!
$access->checkAccess(
'write', 
'', $this->object->getRefId())) {
 
  600            $GLOBALS[
'DIC']->ctrl()->redirect($this, 
'settings');
 
  606            $settings->setActive($field, in_array($field, (array) 
$_POST[
'fid']) ? 
true : 
false);
 
  618        switch ($a_section) {
 
  620                $this->tabs_gui->addSubTabTarget(
 
  621                    'lucene_general_settings',
 
  622                    $this->ctrl->getLinkTarget($this, 
'luceneSettings')
 
An exception for terminatinating execution or to throw for unit testing.
static getLogger($a_component_id)
Get component logger.
Activation of meta data fields.
static getFields()
Return an array of all meta data fields.
luceneSettingsObject(ilPropertyFormGUI $form=null)
Lucene settings.
refreshLuceneSettings()
Refresh lucene server settings.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor @access public.
advancedLuceneSettingsObject()
show advanced settings
saveAdvancedLuceneSettingsObject()
Save advanced settings.
initFormSettings()
Init settings form.
cancelObject()
cancel action and go back to previous page @access public
updateSettingsObject()
Update Settings.
saveLuceneSettingsObject()
Save Lucene settings.
getAdminTabs()
administration tabs show only permissions and trash folder
settingsObject()
Show settings @access public.
initFormLuceneSettings()
Show lucene settings form.
getTabs()
get tabs @access public
executeCommand()
execute command
saveSettingsObject()
Save settings @access public.
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getInstance()
Get singelton instance.
This class represents an option in a radio group.
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
static getLuceneItemFilterDefinitions()
Get lucene item filter definitions.
static getLuceneMimeFilterDefinitions()
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
redirection script todo: (a better solution should control the processing via a xml file)
if(empty($password)) $table
if(isset($_POST['submit'])) $form