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/Glossary/classes/class.ilGlossaryTerm.php");
163 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
165 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
166 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
168 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
182 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
194 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
204 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
206 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
211 if (is_array($usage[
"hist_nr"]) &&
212 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
214 asort($usage[
"hist_nr"]);
216 if ($usage[
"hist_nr"][0] == 0)
218 array_shift($usage[
"hist_nr"]);
219 $usage[
"hist_nr"][] = 0;
222 if (count($usage[
"hist_nr"]) > 5)
225 $cnt = count($usage[
"hist_nr"]) - 5;
226 for ($i = 0; $i < $cnt; $i++)
228 unset($usage[
"hist_nr"][$i]);
231 foreach ($usage[
"hist_nr"] as $nr)
239 $ver.= $sep.$this->lng->txt(
"cont_current_version");
244 $this->tpl->setCurrentBlock(
"versions");
245 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
246 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
247 $this->tpl->parseCurrentBlock();
250 if ($item[
"obj_type_txt"] !=
"")
252 $this->tpl->setCurrentBlock(
"type");
253 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
254 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
255 $this->tpl->parseCurrentBlock();
258 if ($usage[
"type"] !=
"clip")
260 if ($item[
"obj_link"])
262 $this->tpl->setCurrentBlock(
"linked_item");
263 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
264 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
265 $this->tpl->parseCurrentBlock();
269 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
272 if ($item[
"sub_txt"] !=
"")
274 $this->tpl->setVariable(
"SEP",
", ");
275 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
276 if ($item[
"sub_title"] !=
"")
278 $this->tpl->setVariable(
"SEP2",
": ");
279 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
286 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
287 " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
299 if ($ilAccess->checkAccess(
"write",
"", $ref_id))