ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilRepositoryObjectSearchResultTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(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}
static prepareFormOutput($a_str, bool $a_strip=false)
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_ref_id)
setResults(ilRepositoryObjectDetailSearchResult $a_result)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc