24 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
40 function __construct($a_parent_obj, $a_parent_cmd, $a_media_object)
45 $this->media_object = $a_media_object;
50 $this->
setRowTemplate(
"tpl.mob_usage_row.html",
"Services/MediaObjects");
52 $this->
setTitle($lng->txt(
"cont_mob_usages"));
60 $usages = $this->media_object->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");
136 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
137 $item[
"obj_title"] = $lm_obj->
getTitle();
138 $item[
"sub_txt"] = $this->lng->txt(
"pg");
149 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
150 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
151 require_once(
"./Modules/LearningModule/classes/class.ilObjDlBook.php");
154 $lm_obj =&
new ilObjDlBook($page_obj->getParentId(),
false);
155 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
156 $item[
"obj_title"] = $lm_obj->
getTitle();
157 $item[
"sub_txt"] = $this->lng->txt(
"pg");
168 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
169 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
171 $item[
"sub_txt"] = $this->lng->txt(
"pg");
181 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
182 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
184 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
185 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
187 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
201 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
213 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
223 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
225 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
230 if (is_array($usage[
"hist_nr"]) &&
231 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
233 asort($usage[
"hist_nr"]);
235 if ($usage[
"hist_nr"][0] == 0)
237 array_shift($usage[
"hist_nr"]);
238 $usage[
"hist_nr"][] = 0;
240 if (count($usage[
"hist_nr"]) > 5)
243 $cnt = count($usage[
"hist_nr"]) - 5;
244 for ($i = 0; $i < $cnt; $i++)
246 unset($usage[
"hist_nr"][$i]);
250 foreach ($usage[
"hist_nr"] as $nr)
258 $ver.= $sep.$this->lng->txt(
"cont_current_version");
263 $this->tpl->setCurrentBlock(
"versions");
264 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
265 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
266 $this->tpl->parseCurrentBlock();
269 if ($item[
"obj_type_txt"] !=
"")
271 $this->tpl->setCurrentBlock(
"type");
272 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
273 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
274 $this->tpl->parseCurrentBlock();
277 if ($usage[
"type"] !=
"clip")
279 if ($item[
"obj_link"])
281 $this->tpl->setCurrentBlock(
"linked_item");
282 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
283 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
284 $this->tpl->parseCurrentBlock();
288 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
291 if ($item[
"sub_txt"] !=
"")
293 $this->tpl->setVariable(
"SEP",
", ");
294 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
295 if ($item[
"sub_title"] !=
"")
297 $this->tpl->setVariable(
"SEP2",
": ");
298 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
305 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
306 " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
318 if ($ilAccess->checkAccess(
"write",
"", $ref_id))