5 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
21 function __construct($a_parent_obj, $a_parent_cmd, $a_media_object,
22 $a_include_hist =
false)
26 parent::__construct($a_parent_obj, $a_parent_cmd);
27 $this->media_object = $a_media_object;
28 $this->include_hist = $a_include_hist;
29 $this->
addColumn($lng->txt(
"mob_object"));
30 $this->
addColumn($this->lng->txt(
"type"));
33 $this->
addColumn($this->lng->txt(
"cont_versions"));
37 $this->
setRowTemplate(
"tpl.mob_usage_row.html",
"Services/MediaObjects");
39 $this->
setTitle($lng->txt(
"cont_mob_usages"));
47 $usages = $this->media_object->getUsages($this->include_hist);
51 $agg_usages =
array();
52 foreach($usages as $k => $usage)
54 if ($usage[
"type"] ==
"clip")
60 if (empty($agg_usages[$usage[
"type"].
":".$usage[
"id"]]))
62 $usage[
"hist_nr"] =
array($usage[
"hist_nr"]);
63 $agg_usages[$usage[
"type"].
":".$usage[
"id"]] = $usage;
67 $agg_usages[$usage[
"type"].
":".$usage[
"id"]][
"hist_nr"][] =
76 $agg_usages[] =
array(
"type" =>
"clip",
"cnt" => $clip_cnt);
94 if(is_int(strpos($usage[
"type"],
":")))
96 $us_arr = explode(
":", $usage[
"type"]);
97 $usage[
"type"] = $us_arr[1];
98 $cont_type = $us_arr[0];
101 include_once(
'./Services/Link/classes/class.ilLink.php');
103 switch($usage[
"type"])
106 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
115 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
116 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
117 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
121 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
122 $item[
"obj_title"] = $lm_obj->
getTitle();
123 $item[
"sub_txt"] = $this->lng->txt(
"pg");
134 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
135 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
137 $item[
"sub_txt"] = $this->lng->txt(
"pg");
147 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
148 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
150 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
151 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
153 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
164 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$otype);
174 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
179 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$type);
192 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
202 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
204 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
209 if ($this->include_hist)
212 if (is_array($usage[
"hist_nr"]) &&
213 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
215 asort($usage[
"hist_nr"]);
217 if ($usage[
"hist_nr"][0] == 0)
219 array_shift($usage[
"hist_nr"]);
220 $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]);
232 foreach ($usage[
"hist_nr"] as $nr)
240 $ver.= $sep.$this->lng->txt(
"cont_current_version");
246 $this->tpl->setCurrentBlock(
"versions");
247 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
248 $this->tpl->parseCurrentBlock();
251 if ($item[
"obj_type_txt"] !=
"")
253 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
256 if ($usage[
"type"] !=
"clip")
258 if ($item[
"obj_link"])
260 $this->tpl->setCurrentBlock(
"linked_item");
261 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
262 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
263 $this->tpl->parseCurrentBlock();
267 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
270 if ($item[
"sub_txt"] !=
"")
272 $this->tpl->setVariable(
"SEP",
", ");
273 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
274 if ($item[
"sub_title"] !=
"")
276 $this->tpl->setVariable(
"SEP2",
": ");
277 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
284 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
285 " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
297 if ($ilAccess->checkAccess(
"write",
"", $ref_id))
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
Class ilObjLearningModule.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupTermId($a_def_id)
Looks up term id for a definition id.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
getTitle()
get title of content object
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
static _lookGlossaryTerm($term_id)
get glossary term