5 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
35 $a_include_hist =
false 39 $this->ctrl = $DIC->ctrl();
40 $this->lng = $DIC->language();
41 $this->access = $DIC->access();
43 $lng = $DIC->language();
45 parent::__construct($a_parent_obj, $a_parent_cmd);
46 $this->media_object = $a_media_object;
47 $this->include_hist = $a_include_hist;
49 $this->
addColumn($this->lng->txt(
"type"));
50 if ($a_include_hist) {
51 $this->
addColumn($this->lng->txt(
"cont_versions"));
55 $this->
setRowTemplate(
"tpl.mob_usage_row.html",
"Services/MediaObjects");
65 $usages = $this->media_object->getUsages($this->include_hist);
69 $agg_usages =
array();
70 foreach ($usages as $k => $usage) {
71 if ($usage[
"type"] ==
"clip") {
74 if (empty($agg_usages[$usage[
"type"] .
":" . $usage[
"id"]])) {
75 $usage[
"hist_nr"] =
array($usage[
"hist_nr"]);
76 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]] = $usage;
78 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]][
"hist_nr"][] =
86 $agg_usages[] =
array(
"type" =>
"clip",
"cnt" => $clip_cnt);
106 if (is_int(strpos($usage[
"type"],
":"))) {
107 $us_arr = explode(
":", $usage[
"type"]);
108 $usage[
"type"] = $us_arr[1];
109 $cont_type = $us_arr[0];
112 include_once(
'./Services/Link/classes/class.ilLink.php');
114 switch ($usage[
"type"]) {
116 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
122 switch ($cont_type) {
124 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
125 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
126 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
129 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $cont_type);
130 $item[
"obj_title"] = $lm_obj->
getTitle();
131 $item[
"sub_txt"] = $this->lng->txt(
"pg");
141 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
142 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
144 $item[
"sub_txt"] = $this->lng->txt(
"pg");
153 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
154 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
156 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
157 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
159 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
169 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $otype);
178 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
182 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" .
$type);
194 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
203 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
205 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
210 if ($this->include_hist) {
212 if (is_array($usage[
"hist_nr"]) &&
213 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0)) {
214 asort($usage[
"hist_nr"]);
216 if ($usage[
"hist_nr"][0] == 0) {
217 array_shift($usage[
"hist_nr"]);
218 $usage[
"hist_nr"][] = 0;
220 if (count($usage[
"hist_nr"]) > 5) {
222 $cnt = count($usage[
"hist_nr"]) - 5;
223 for (
$i = 0;
$i < $cnt;
$i++) {
224 unset($usage[
"hist_nr"][
$i]);
228 foreach ($usage[
"hist_nr"] as $nr) {
232 $ver.= $sep . $this->lng->txt(
"cont_current_version");
237 $this->tpl->setCurrentBlock(
"versions");
238 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
239 $this->tpl->parseCurrentBlock();
242 if ($item[
"obj_type_txt"] !=
"") {
243 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
246 if ($usage[
"type"] !=
"clip") {
247 if ($item[
"obj_link"]) {
248 $this->tpl->setCurrentBlock(
"linked_item");
249 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
250 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
251 $this->tpl->parseCurrentBlock();
253 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
256 if ($item[
"sub_txt"] !=
"") {
257 $this->tpl->setVariable(
"SEP",
", ");
258 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
259 if ($item[
"sub_title"] !=
"") {
260 $this->tpl->setVariable(
"SEP2",
": ");
261 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
265 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1") .
266 " " . $usage[
"cnt"] .
" " . $this->lng->txt(
"cont_users_have_mob_in_clip2"));
275 foreach ($ref_ids as $ref_id) {
276 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.
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.
getTitle()
get title of content object
static _lookGlossaryTerm($term_id)
get glossary term