5 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
44 $a_include_hist =
false 48 $this->ctrl = $DIC->ctrl();
49 $this->lng = $DIC->language();
50 $this->access = $DIC->access();
52 $lng = $DIC->language();
54 $this->repo_tree = $DIC->repositoryTree();
56 parent::__construct($a_parent_obj, $a_parent_cmd);
57 $this->media_object = $a_media_object;
58 $this->include_hist = $a_include_hist;
60 $this->
addColumn($this->lng->txt(
"type"));
62 $this->
addColumn($this->lng->txt(
"cont_versions"));
66 $this->
setRowTemplate(
"tpl.mob_usage_row.html",
"Services/MediaObjects");
76 $usages = $this->media_object->getUsages($this->include_hist);
80 $agg_usages = array();
81 foreach ($usages as $k => $usage) {
82 $usage[
"trash"] =
false;
83 if (is_int(strpos($usage[
"type"],
":"))) {
84 $us_arr = explode(
":", $usage[
"type"]);
87 if ($us_arr[1] ==
"pg") {
89 $usage[
"page"] = $page_obj;
94 $usage[
"ref_ids"] = $ref_ids;
95 if (count($ref_ids) == 0) {
96 $usage[
"trash"] =
true;
102 if ($usage[
"type"] ==
"clip") {
105 if ($this->incl_hist || !$usage[
"trash"]) {
106 if (empty($agg_usages[$usage[
"type"] .
":" . $usage[
"id"]])) {
107 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]] = $usage;
109 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]][
"versions"][] =
110 [
"hist_nr" => $usage[
"hist_nr"],
111 "lang" => $usage[
"lang"]];
118 $agg_usages[] = array(
"type" =>
"clip",
"cnt" => $clip_cnt);
138 if (is_int(strpos($usage[
"type"],
":"))) {
139 $us_arr = explode(
":", $usage[
"type"]);
140 $usage[
"type"] = $us_arr[1];
141 $cont_type = $us_arr[0];
144 include_once(
'./Services/Link/classes/class.ilLink.php');
146 switch ($usage[
"type"]) {
148 $page_obj = $usage[
"page"];
153 switch ($cont_type) {
155 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
156 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
157 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
160 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $cont_type);
161 $item[
"obj_title"] = $lm_obj->
getTitle();
162 $item[
"sub_txt"] = $this->lng->txt(
"pg");
172 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
173 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
175 $item[
"sub_txt"] = $this->lng->txt(
"pg");
184 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
185 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
187 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
188 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
190 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
200 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $otype);
209 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
213 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" .
$type);
223 if ($usage[
"trash"]) {
224 $item[
"obj_title"].=
" (".$lng->txt(
"trash").
")";
230 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
239 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
241 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
246 if (is_array($usage[
"versions"]) && is_object($usage[
"page"])) {
249 if (count($usage[
"versions"]) > 5) {
251 $cnt = count($usage[
"versions"]) - 5;
252 for (
$i = 0;
$i < $cnt;
$i++) {
253 unset($usage[
"versions"][
$i]);
256 foreach ($usage[
"versions"] as
$version) {
257 if ($version[
"hist_nr"] == 0) {
258 $version[
"hist_nr"] = $this->lng->txt(
"cont_current_version");
260 $ver .= $sep . $version[
"hist_nr"];
261 if ($version[
"lang"] !=
"") {
262 $ver.=
"/".$version[
"lang"];
267 $this->tpl->setCurrentBlock(
"versions");
268 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
269 $this->tpl->parseCurrentBlock();
271 $this->tpl->setCurrentBlock(
"versions");
272 $this->tpl->setVariable(
"VAL_VERSIONS",
" ");
273 $this->tpl->parseCurrentBlock();
276 if ($item[
"obj_type_txt"] !=
"") {
277 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
280 if ($usage[
"type"] !=
"clip") {
281 if ($item[
"obj_link"]) {
282 $this->tpl->setCurrentBlock(
"linked_item");
283 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
284 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
285 $this->tpl->parseCurrentBlock();
287 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
290 if ($item[
"sub_txt"] !=
"") {
291 $this->tpl->setVariable(
"SEP",
", ");
292 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
293 if ($item[
"sub_title"] !=
"") {
294 $this->tpl->setVariable(
"SEP2",
": ");
295 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
299 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1") .
300 " " . $usage[
"cnt"] .
" " . $this->lng->txt(
"cont_users_have_mob_in_clip2"));
309 foreach ($ref_ids as $ref_id) {
310 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.
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