24 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
45 $this->page = $a_page;
50 $this->
setRowTemplate(
"tpl.mep_page_usage_row.html",
"Modules/MediaPool");
52 $this->
setTitle($lng->txt(
"cont_mob_usages"));
60 $usages = $this->page->getUsages();
64 $agg_usages = array();
65 foreach($usages as $k => $usage)
67 if ($usage[
"type"] ==
"clip")
73 if (empty($agg_usages[$usage[
"type"].
":".$usage[
"id"]]))
75 $usage[
"hist_nr"] = array($usage[
"hist_nr"]);
76 $agg_usages[$usage[
"type"].
":".$usage[
"id"]] = $usage;
80 $agg_usages[$usage[
"type"].
":".$usage[
"id"]][
"hist_nr"][] =
89 $agg_usages[] = array(
"type" =>
"clip",
"cnt" => $clip_cnt);
107 if(is_int(strpos($usage[
"type"],
":")))
109 $us_arr = explode(
":", $usage[
"type"]);
110 $usage[
"type"] = $us_arr[1];
111 $cont_type = $us_arr[0];
115 include_once(
'classes/class.ilLink.php');
117 switch($usage[
"type"])
121 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
130 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
131 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
132 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
134 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
135 $item[
"obj_title"] = $lm_obj->
getTitle();
136 $item[
"sub_txt"] = $this->lng->txt(
"pg");
146 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
147 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
148 require_once(
"./Modules/LearningModule/classes/class.ilObjDlBook.php");
149 $lm_obj =&
new ilObjDlBook($page_obj->getParentId(),
false);
150 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
151 $item[
"obj_title"] = $lm_obj->
getTitle();
152 $item[
"sub_txt"] = $this->lng->txt(
"pg");
162 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
163 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
165 $item[
"sub_txt"] = $this->lng->txt(
"pg");
175 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
176 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
178 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
179 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
181 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
195 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
207 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
217 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
219 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
224 if (is_array($usage[
"hist_nr"]) &&
225 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
227 asort($usage[
"hist_nr"]);
229 if ($usage[
"hist_nr"][0] == 0)
231 array_shift($usage[
"hist_nr"]);
232 $usage[
"hist_nr"][] = 0;
235 if (count($usage[
"hist_nr"]) > 5)
238 $cnt = count($usage[
"hist_nr"]) - 5;
239 for ($i = 0; $i < $cnt; $i++)
241 unset($usage[
"hist_nr"][$i]);
244 foreach ($usage[
"hist_nr"] as $nr)
252 $ver.= $sep.$this->lng->txt(
"cont_current_version");
257 $this->tpl->setCurrentBlock(
"versions");
258 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
259 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
260 $this->tpl->parseCurrentBlock();
263 if ($item[
"obj_type_txt"] !=
"")
265 $this->tpl->setCurrentBlock(
"type");
266 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
267 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
268 $this->tpl->parseCurrentBlock();
271 if ($usage[
"type"] !=
"clip")
273 if ($item[
"obj_link"])
275 $this->tpl->setCurrentBlock(
"linked_item");
276 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
277 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
278 $this->tpl->parseCurrentBlock();
282 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
285 if ($item[
"sub_txt"] !=
"")
287 $this->tpl->setVariable(
"SEP",
", ");
288 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
289 if ($item[
"sub_title"] !=
"")
291 $this->tpl->setVariable(
"SEP2",
": ");
292 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
299 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
300 " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
312 if ($ilAccess->checkAccess(
"write",
"", $ref_id))