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();
65 $agg_usages = array();
66 foreach($usages as $k => $usage)
68 if ($usage[
"type"] ==
"clip")
74 if (empty($agg_usages[$usage[
"type"].
":".$usage[
"id"]]))
76 $usage[
"hist_nr"] = array($usage[
"hist_nr"]);
77 $agg_usages[$usage[
"type"].
":".$usage[
"id"]] = $usage;
81 $agg_usages[$usage[
"type"].
":".$usage[
"id"]][
"hist_nr"][] =
90 $agg_usages[] = array(
"type" =>
"clip",
"cnt" => $clip_cnt);
108 if(is_int(strpos($usage[
"type"],
":")))
110 $us_arr = explode(
":", $usage[
"type"]);
111 $usage[
"type"] = $us_arr[1];
112 $cont_type = $us_arr[0];
116 include_once(
'classes/class.ilLink.php');
118 switch($usage[
"type"])
122 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
131 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
132 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
133 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
135 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
136 $item[
"obj_title"] = $lm_obj->
getTitle();
137 $item[
"sub_txt"] = $this->lng->txt(
"pg");
147 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
148 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
149 require_once(
"./Modules/LearningModule/classes/class.ilObjDlBook.php");
150 $lm_obj =&
new ilObjDlBook($page_obj->getParentId(),
false);
151 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
152 $item[
"obj_title"] = $lm_obj->
getTitle();
153 $item[
"sub_txt"] = $this->lng->txt(
"pg");
163 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
164 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
166 $item[
"sub_txt"] = $this->lng->txt(
"pg");
176 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
177 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
179 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
180 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
182 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
196 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
208 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
218 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
220 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
225 if (is_array($usage[
"hist_nr"]) &&
226 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
228 asort($usage[
"hist_nr"]);
230 if ($usage[
"hist_nr"][0] == 0)
232 array_shift($usage[
"hist_nr"]);
233 $usage[
"hist_nr"][] = 0;
235 foreach ($usage[
"hist_nr"] as $nr)
243 $ver.= $sep.$this->lng->txt(
"cont_current_version");
248 $this->tpl->setCurrentBlock(
"versions");
249 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
250 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
251 $this->tpl->parseCurrentBlock();
254 if ($item[
"obj_type_txt"] !=
"")
256 $this->tpl->setCurrentBlock(
"type");
257 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
258 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
259 $this->tpl->parseCurrentBlock();
262 if ($usage[
"type"] !=
"clip")
264 if ($item[
"obj_link"])
266 $this->tpl->setCurrentBlock(
"linked_item");
267 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
268 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
269 $this->tpl->parseCurrentBlock();
273 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
276 if ($item[
"sub_txt"] !=
"")
278 $this->tpl->setVariable(
"SEP",
", ");
279 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
280 if ($item[
"sub_title"] !=
"")
282 $this->tpl->setVariable(
"SEP2",
": ");
283 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
290 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
291 " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
303 if ($ilAccess->checkAccess(
"write",
"", $ref_id))