4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
20 function __construct($a_parent_obj, $a_parent_cmd, $a_term_id)
25 $this->term_id = $a_term_id;
30 $this->
setRowTemplate(
"tpl.term_usage_row.html",
"Modules/Glossary");
32 $this->
setTitle($lng->txt(
"cont_usage"));
44 $agg_usages = array();
45 foreach($usages as $k => $usage)
47 if (empty($agg_usages[$usage[
"type"].
":".$usage[
"id"]]))
49 $usage[
"hist_nr"] = array($usage[
"hist_nr"]);
50 $agg_usages[$usage[
"type"].
":".$usage[
"id"]] = $usage;
54 $agg_usages[$usage[
"type"].
":".$usage[
"id"]][
"hist_nr"][] =
72 if(is_int(strpos($usage[
"type"],
":")))
74 $us_arr = explode(
":", $usage[
"type"]);
75 $usage[
"type"] = $us_arr[1];
76 $cont_type = $us_arr[0];
79 include_once(
'classes/class.ilLink.php');
81 switch($usage[
"type"])
85 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
95 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
96 require_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
98 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
99 $item[
"obj_title"] = $lm_obj->
getTitle();
100 $item[
"sub_txt"] = $this->lng->txt(
"pg");
110 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
111 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
112 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
114 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
115 $item[
"obj_title"] = $lm_obj->
getTitle();
116 $item[
"sub_txt"] = $this->lng->txt(
"pg");
126 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
127 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
128 require_once(
"./Modules/LearningModule/classes/class.ilObjDlBook.php");
129 $lm_obj =&
new ilObjDlBook($page_obj->getParentId(),
false);
130 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
131 $item[
"obj_title"] = $lm_obj->
getTitle();
132 $item[
"sub_txt"] = $this->lng->txt(
"pg");
142 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
143 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
145 $item[
"sub_txt"] = $this->lng->txt(
"pg");
146 $item[
"sub_title"] = ilWikiPage::lookupTitle($page_obj->getId());
155 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
156 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
158 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
159 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
161 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
175 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
187 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
197 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
199 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
204 if (is_array($usage[
"hist_nr"]) &&
205 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
207 asort($usage[
"hist_nr"]);
209 if ($usage[
"hist_nr"][0] == 0)
211 array_shift($usage[
"hist_nr"]);
212 $usage[
"hist_nr"][] = 0;
214 foreach ($usage[
"hist_nr"] as $nr)
222 $ver.= $sep.$this->lng->txt(
"cont_current_version");
227 $this->tpl->setCurrentBlock(
"versions");
228 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
229 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
230 $this->tpl->parseCurrentBlock();
233 if ($item[
"obj_type_txt"] !=
"")
235 $this->tpl->setCurrentBlock(
"type");
236 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
237 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
238 $this->tpl->parseCurrentBlock();
241 if ($usage[
"type"] !=
"clip")
243 if ($item[
"obj_link"])
245 $this->tpl->setCurrentBlock(
"linked_item");
246 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
247 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
248 $this->tpl->parseCurrentBlock();
252 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
255 if ($item[
"sub_txt"] !=
"")
257 $this->tpl->setVariable(
"SEP",
", ");
258 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
259 if ($item[
"sub_title"] !=
"")
261 $this->tpl->setVariable(
"SEP2",
": ");
262 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
269 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
270 " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
282 if ($ilAccess->checkAccess(
"write",
"", $ref_id))