ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilRepositoryObjectSearchResultTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
24  protected int $ref_id;
25  private string $search_term;
26 
28 
29  public function __construct(object $a_parent_obj, string $a_parent_cmd, int $a_ref_id)
30  {
32  $this->ref_id = $a_ref_id;
33  $this->setId('rep_obj_search_res_' . $this->ref_id);
34  parent::__construct($a_parent_obj, $a_parent_cmd);
35  }
36 
37  public function setSearchTerm(string $a_term): void
38  {
39  $this->search_term = $a_term;
40  }
41 
42  public function getSearchTerm(): string
43  {
44  return $this->search_term;
45  }
46 
47  public function getSettings(): ilSearchSettings
48  {
49  return $this->settings;
50  }
51 
52  public function setResults(ilRepositoryObjectDetailSearchResult $a_result): void
53  {
54  $this->results = $a_result;
55  }
56 
58  {
59  return $this->results;
60  }
61 
62  public function init(): void
63  {
64  $this->initColumns();
65  $this->initRowTemplate();
66 
67  $this->setEnableHeader(true);
68  $this->setShowRowsSelector(false);
69  $this->setFormAction($this->ctrl->getFormAction($this->getParentObject()));
70  $this->setLimit(0);
71 
72  $this->setTitle(
73  $this->lng->txt('search_results') . ' "' . str_replace(['"'], '', ilLegacyFormElementsUtil::prepareFormOutput($this->getSearchTerm())) . '"'
74  );
75  }
76 
77  protected function initColumns(): void
78  {
79  $this->addColumn($this->lng->txt("title"), "", "100%");
80  }
81 
82  protected function initRowTemplate(): void
83  {
84  $this->setRowTemplate('tpl.repository_object_search_result_row.html', 'components/ILIAS/Search');
85  }
86 
87 
88  abstract public function parse();
89 }
setFormAction(string $a_form_action, bool $a_multipart=false)
static prepareFormOutput($a_str, bool $a_strip=false)
setId(string $a_val)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_ref_id)
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
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)
setEnableHeader(bool $a_enableheader)
setResults(ilRepositoryObjectDetailSearchResult $a_result)