38 $this->
ctrl = $DIC->ctrl();
39 $this->
lng = $DIC->language();
40 $this->
access = $DIC->access();
41 $ilCtrl =
$DIC->ctrl();
43 $this->repo_tree =
$DIC->repositoryTree();
46 $this->page = $a_page;
47 $this->incl_hist = $a_incl_hist;
51 $this->
setRowTemplate(
"tpl.mep_page_usage_row.html",
"components/ILIAS/MediaPool");
58 $usages = $this->page->getUsages($this->incl_hist);
60 $agg_usages = array();
61 foreach ($usages as $k => $usage) {
62 $usage[
"trash"] =
false;
63 if (is_int(strpos($usage[
"type"],
":"))) {
64 $us_arr = explode(
":", $usage[
"type"]);
67 if ($us_arr[1] ===
"pg") {
69 $usage[
"page"] = $page_obj;
71 $ref_ids = array_filter(
77 $usage[
"ref_ids"] = $ref_ids;
78 if (count($ref_ids) === 0) {
79 $usage[
"trash"] =
true;
84 if ($usage[
"type"] ===
"clip") {
86 } elseif ($this->incl_hist || !$usage[
"trash"]) {
87 if (empty($agg_usages[$usage[
"type"] .
":" . $usage[
"id"]])) {
88 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]] = $usage;
90 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]][
"versions"][] =
91 [
"hist_nr" => $usage[
"hist_nr"] ?? 0,
92 "lang" => $usage[
"lang"] ??
""
99 $agg_usages[] = array(
"type" =>
"clip",
"cnt" => $clip_cnt);
104 protected function fillRow(array $a_set): void
111 if (is_int(strpos($usage[
"type"],
":"))) {
112 $us_arr = explode(
":", $usage[
"type"]);
113 $usage[
"type"] = $us_arr[1];
114 $cont_type = $us_arr[0];
117 switch ($usage[
"type"]) {
119 $page_obj = $usage[
"page"];
122 switch ($cont_type) {
125 $item[
"obj_type_txt"] = $this->
lng->txt(
"obj_" . $cont_type);
126 $item[
"obj_title"] = $lm_obj->getTitle();
127 $item[
"sub_txt"] = $this->
lng->txt(
"pg");
131 $item[
"obj_link"] = ilLink::_getLink(
null,
"pg", [], $page_obj->getId() .
"_" .
$ref_id);
136 $item[
"obj_type_txt"] = $this->
lng->txt(
"obj_wiki");
138 $item[
"sub_txt"] = $this->
lng->txt(
"pg");
147 $term_id = $page_obj->getId();
149 $item[
"obj_type_txt"] = $this->
lng->txt(
"obj_glo");
151 $item[
"sub_txt"] = $this->
lng->txt(
"cont_term");
161 $item[
"obj_type_txt"] = $this->
lng->txt(
"obj_" . $type);
170 $item[
"obj_type_txt"] = $this->
lng->txt(
"obj_" . $cont_type);
179 if ($usage[
"trash"]) {
180 $item[
"obj_title"] .=
" (" .
$lng->
txt(
"trash") .
")";
186 $item[
"obj_type_txt"] = $this->
lng->txt(
"obj_mep");
195 $item[
"obj_type_txt"] = $this->
lng->txt(
"obj_mob");
197 $item[
"sub_txt"] = $this->
lng->txt(
"cont_link_area");
202 if (is_array($usage[
"versions"] ??
null) && is_object($usage[
"page"] ??
null)) {
205 if (count($usage[
"versions"]) > 5) {
207 $cnt = count($usage[
"versions"]) - 5;
208 for ($i = 0; $i < $cnt; $i++) {
209 unset($usage[
"versions"][$i]);
212 foreach ($usage[
"versions"] as
$version) {
214 $version[
"hist_nr"] = $this->
lng->txt(
"cont_current_version");
223 $this->tpl->setCurrentBlock(
"versions");
224 $this->tpl->setVariable(
"TXT_VERSIONS", $this->
lng->txt(
"cont_versions"));
225 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
226 $this->tpl->parseCurrentBlock();
229 if (($item[
"obj_type_txt"] ??
"") !=
"") {
230 $this->tpl->setCurrentBlock(
"type");
231 $this->tpl->setVariable(
"TXT_TYPE", $this->
lng->txt(
"type"));
232 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
233 $this->tpl->parseCurrentBlock();
236 if ($usage[
"type"] !==
"clip") {
237 if ($item[
"obj_link"] ??
false) {
238 $this->tpl->setCurrentBlock(
"linked_item");
239 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"] ??
"");
240 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"] ??
"");
241 $this->tpl->parseCurrentBlock();
243 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"] ??
"");
246 if (($item[
"sub_txt"] ??
"") !=
"") {
247 $this->tpl->setVariable(
"SEP",
", ");
248 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
249 if ($item[
"sub_title"] !=
"") {
250 $this->tpl->setVariable(
"SEP2",
": ");
251 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
255 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->
lng->txt(
"cont_users_have_mob_in_clip1") .
256 " " . $usage[
"cnt"] .
" " . $this->lng->txt(
"cont_users_have_mob_in_clip2"));
265 foreach ($ref_ids as
$ref_id) {
266 if ($ilAccess->checkAccess(
"write",
"",
$ref_id)) {
static _lookGlossaryTerm(int $term_id)
get glossary term
static _lookGlossaryID(int $term_id)
get glossary id form term id
static _lookupTitle(int $a_obj_id)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
getFirstWritableRefId(int $a_obj_id)
__construct(object $a_parent_obj, string $a_parent_cmd, ilMediaPoolPage $a_page, bool $a_incl_hist)
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...
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
setData(array $a_data)
Set table data.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
isInTree(?int $a_node_id)
get all information of a node.
static lookupTitle(int $a_page_id, string $lang="-")
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc