3 declare(strict_types=1);
34 protected \ilLanguage
$lng;
37 protected Data\Factory
$df;
45 $this->
ctrl = $DIC->ctrl();
46 $this->
lng = $DIC->language();
47 $this->ui_fac = $DIC->ui()->factory();
48 $this->request = $DIC->http()->request();
49 $this->df =
new Data\Factory();
60 $table = $this->ui_fac->table()
62 $this->foreign_glossary->getTitle() .
": " .$this->lng->txt(
"glo_select_terms"),
68 $this->glossary->getRefId() .
"_" .
69 $this->foreign_glossary->getRefId()
71 ->withActions($actions)
72 ->withRequest($this->request);
80 "title" => $this->ui_fac->table()->column()->text($this->
lng->txt(
"glo_term"))
81 ->withIsSortable(
false)
89 $query_params_namespace = [
"glo_foreign_term_table"];
91 $uri_copy = $this->df->uri(
92 ILIAS_HTTP_PATH .
"/" . $this->
ctrl->getLinkTargetByClass(
"ilglossaryforeigntermcollectorgui",
"copyTerms")
94 $url_builder_copy =
new UI\URLBuilder($uri_copy);
95 list($url_builder_copy, $action_parameter_token_copy, $row_id_token_copy) =
96 $url_builder_copy->acquireParameters(
97 $query_params_namespace,
102 $uri_reference = $this->df->uri(
103 ILIAS_HTTP_PATH .
"/" . $this->
ctrl->getLinkTargetByClass(
"ilglossaryforeigntermcollectorgui",
"referenceTerms")
105 $url_builder_reference =
new UI\URLBuilder($uri_reference);
106 list($url_builder_reference, $action_parameter_token_reference, $row_id_token_reference) =
107 $url_builder_reference->acquireParameters(
108 $query_params_namespace,
114 "copy" => $this->ui_fac->table()->action()->multi(
115 $this->
lng->txt(
"glo_copy_terms"),
116 $url_builder_copy->withParameter($action_parameter_token_copy,
"copyTerms"),
119 "reference" => $this->ui_fac->table()->action()->multi(
120 $this->
lng->txt(
"glo_reference_terms"),
121 $url_builder_reference->withParameter($action_parameter_token_reference,
"referenceTerms"),
122 $row_id_token_reference
131 $data_retrieval =
new class (
141 public function getRows(
143 array $visible_column_ids,
147 ?array $additional_parameters
149 $records = $this->getRecords($range);
150 foreach ($records as $idx => $record) {
151 $row_id = (string) $record[
"term_id"];
153 yield $row_builder->buildDataRow($row_id, $record);
157 public function getTotalRowCount(
159 ?array $additional_parameters
161 return count($this->getRecords());
164 protected function getRecords(
Data\
Range $range = null): array
168 foreach ($this->foreign_glossary->getTermList() as $term) {
169 $records[$i][
"term_id"] = $term[
"id"];
170 $records[$i][
"title"] = $term[
"term"];
175 $records = $this->limitRecords($records, $range);
182 return $data_retrieval;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Both the subject and the direction need to be specified when expressing an order. ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjGlossary $foreign_glossary
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ServerRequestInterface $request
__construct(\ilObjGlossary $glossary, \ilObjGlossary $foreign_glossary)
A simple class to express a naive range of whole positive numbers.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...