ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLuceneAdvancedSearchActivationTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
29 {
30  protected ilAccess $access;
31 
32  public function __construct($a_parent_obj, $a_parent_cmd = '')
33  {
34  global $DIC;
35 
36  $this->access = $DIC->access();
37 
38  parent::__construct($a_parent_obj, $a_parent_cmd);
39  $this->addColumn('', 'id', '0px');
40  $this->addColumn($this->lng->txt('title'), 'title', '60%');
41  $this->addColumn($this->lng->txt('type'), 'type', '40%');
42  $this->setRowTemplate('tpl.lucene_activation_row.html', 'Services/Search');
43  $this->disable('sort');
44  $this->setLimit(100);
45  $this->setSelectAllCheckbox('fid');
46  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
47 
48  if ($this->access->checkAccess('write', '', $this->getParentObject()->getObject()->getRefId())) {
49  $this->addMultiCommand('saveAdvancedLuceneSettings', $this->lng->txt('lucene_activate_field'));
50  }
51  }
52 
56  protected function fillRow(array $a_set): void
57  {
58  $this->tpl->setVariable('VAL_ID', $a_set['id']);
59  $this->tpl->setVariable('VAL_CHECKED', $a_set['active'] ? 'checked="checked"' : '');
60  $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
61  $this->tpl->setVariable('VAL_TYPE', $a_set['type']);
62  }
63 
65  {
66  $content = [];
67  foreach (ilLuceneAdvancedSearchFields::getFields() as $field => $translation) {
68  $tmp_arr['id'] = $field;
69  $tmp_arr['active'] = $settings->isActive($field);
70  $tmp_arr['title'] = $translation;
71 
72  $tmp_arr['type'] = (substr($field, 0, 3) == 'lom') ?
73  $this->lng->txt('search_lom') :
74  $this->lng->txt('search_adv_md');
75 
76  $content[] = $tmp_arr;
77  }
78  $this->setData($content);
79  }
80 }
setData(array $a_data)
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
setFormAction(string $a_form_action, bool $a_multipart=false)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
En/disable single lom/advanced meta data fields.
global $DIC
Definition: feed.php:28
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isActive(string $a_field)
check if field is active
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
static getFields()
Return an array of all meta data fields.
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
disable(string $a_module_name)
addMultiCommand(string $a_cmd, string $a_text)