5 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
21 function __construct($a_parent_obj, $a_parent_cmd, $a_page, $a_incl_hist)
26 $this->page = $a_page;
27 $this->incl_hist = $a_incl_hist;
31 $this->
setRowTemplate(
"tpl.mep_page_usage_row.html",
"Modules/MediaPool");
33 $this->
setTitle($lng->txt(
"cont_mob_usages"));
41 $usages = $this->page->getUsages($this->incl_hist);
45 $agg_usages = array();
46 foreach($usages as $k => $usage)
48 if ($usage[
"type"] ==
"clip")
54 if (empty($agg_usages[$usage[
"type"].
":".$usage[
"id"]]))
56 $usage[
"hist_nr"] = array($usage[
"hist_nr"]);
57 $agg_usages[$usage[
"type"].
":".$usage[
"id"]] = $usage;
61 $agg_usages[$usage[
"type"].
":".$usage[
"id"]][
"hist_nr"][] =
70 $agg_usages[] = array(
"type" =>
"clip",
"cnt" => $clip_cnt);
88 if(is_int(strpos($usage[
"type"],
":")))
90 $us_arr = explode(
":", $usage[
"type"]);
91 $usage[
"type"] = $us_arr[1];
92 $cont_type = $us_arr[0];
96 include_once(
'classes/class.ilLink.php');
98 switch($usage[
"type"])
102 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
111 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
112 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
113 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
115 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
116 $item[
"obj_title"] = $lm_obj->
getTitle();
117 $item[
"sub_txt"] = $this->lng->txt(
"pg");
127 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
128 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
129 require_once(
"./Modules/LearningModule/classes/class.ilObjDlBook.php");
130 $lm_obj =&
new ilObjDlBook($page_obj->getParentId(),
false);
131 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
132 $item[
"obj_title"] = $lm_obj->
getTitle();
133 $item[
"sub_txt"] = $this->lng->txt(
"pg");
143 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
144 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
146 $item[
"sub_txt"] = $this->lng->txt(
"pg");
156 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
157 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
159 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
160 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
162 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
176 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
188 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
198 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
200 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
205 if (is_array($usage[
"hist_nr"]) &&
206 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
208 asort($usage[
"hist_nr"]);
210 if ($usage[
"hist_nr"][0] == 0)
212 array_shift($usage[
"hist_nr"]);
213 $usage[
"hist_nr"][] = 0;
216 if (count($usage[
"hist_nr"]) > 5)
219 $cnt = count($usage[
"hist_nr"]) - 5;
220 for ($i = 0; $i < $cnt; $i++)
222 unset($usage[
"hist_nr"][$i]);
225 foreach ($usage[
"hist_nr"] as $nr)
233 $ver.= $sep.$this->lng->txt(
"cont_current_version");
238 $this->tpl->setCurrentBlock(
"versions");
239 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
240 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
241 $this->tpl->parseCurrentBlock();
244 if ($item[
"obj_type_txt"] !=
"")
246 $this->tpl->setCurrentBlock(
"type");
247 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
248 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
249 $this->tpl->parseCurrentBlock();
252 if ($usage[
"type"] !=
"clip")
254 if ($item[
"obj_link"])
256 $this->tpl->setCurrentBlock(
"linked_item");
257 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
258 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
259 $this->tpl->parseCurrentBlock();
263 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
266 if ($item[
"sub_txt"] !=
"")
268 $this->tpl->setVariable(
"SEP",
", ");
269 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
270 if ($item[
"sub_title"] !=
"")
272 $this->tpl->setVariable(
"SEP2",
": ");
273 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
280 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
281 " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
293 if ($ilAccess->checkAccess(
"write",
"", $ref_id))