5 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
26 public function __construct($a_parent_obj, $a_parent_cmd, $a_page, $a_incl_hist)
30 $this->ctrl = $DIC->ctrl();
31 $this->lng = $DIC->language();
32 $this->access = $DIC->access();
34 $lng = $DIC->language();
35 $ilAccess = $DIC->access();
36 $lng = $DIC->language();
38 parent::__construct($a_parent_obj, $a_parent_cmd);
39 $this->page = $a_page;
40 $this->incl_hist = $a_incl_hist;
44 $this->
setRowTemplate(
"tpl.mep_page_usage_row.html",
"Modules/MediaPool");
54 $usages = $this->page->getUsages($this->incl_hist);
58 $agg_usages =
array();
59 foreach ($usages as $k => $usage) {
60 if ($usage[
"type"] ==
"clip") {
63 if (empty($agg_usages[$usage[
"type"] .
":" . $usage[
"id"]])) {
64 $usage[
"hist_nr"] =
array($usage[
"hist_nr"]);
65 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]] = $usage;
67 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]][
"hist_nr"][] =
75 $agg_usages[] =
array(
"type" =>
"clip",
"cnt" => $clip_cnt);
95 if (is_int(strpos($usage[
"type"],
":"))) {
96 $us_arr = explode(
":", $usage[
"type"]);
97 $usage[
"type"] = $us_arr[1];
98 $cont_type = $us_arr[0];
102 include_once(
'./Services/Link/classes/class.ilLink.php');
104 switch ($usage[
"type"]) {
106 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
111 switch ($cont_type) {
113 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
114 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
115 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
117 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $cont_type);
118 $item[
"obj_title"] = $lm_obj->
getTitle();
119 $item[
"sub_txt"] = $this->lng->txt(
"pg");
128 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
129 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
131 $item[
"sub_txt"] = $this->lng->txt(
"pg");
140 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
141 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
143 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
144 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
146 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
155 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $cont_type);
166 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
175 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
177 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
182 if (is_array($usage[
"hist_nr"]) &&
183 (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0)) {
184 asort($usage[
"hist_nr"]);
186 if ($usage[
"hist_nr"][0] == 0) {
187 array_shift($usage[
"hist_nr"]);
188 $usage[
"hist_nr"][] = 0;
191 if (count($usage[
"hist_nr"]) > 5) {
193 $cnt = count($usage[
"hist_nr"]) - 5;
194 for (
$i = 0;
$i < $cnt;
$i++) {
195 unset($usage[
"hist_nr"][
$i]);
198 foreach ($usage[
"hist_nr"] as $nr) {
202 $ver.= $sep . $this->lng->txt(
"cont_current_version");
207 $this->tpl->setCurrentBlock(
"versions");
208 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
209 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
210 $this->tpl->parseCurrentBlock();
213 if ($item[
"obj_type_txt"] !=
"") {
214 $this->tpl->setCurrentBlock(
"type");
215 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
216 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
217 $this->tpl->parseCurrentBlock();
220 if ($usage[
"type"] !=
"clip") {
221 if ($item[
"obj_link"]) {
222 $this->tpl->setCurrentBlock(
"linked_item");
223 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
224 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
225 $this->tpl->parseCurrentBlock();
227 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
230 if ($item[
"sub_txt"] !=
"") {
231 $this->tpl->setVariable(
"SEP",
", ");
232 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
233 if ($item[
"sub_title"] !=
"") {
234 $this->tpl->setVariable(
"SEP2",
": ");
235 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
239 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1") .
240 " " . $usage[
"cnt"] .
" " . $this->lng->txt(
"cont_users_have_mob_in_clip2"));
249 foreach ($ref_ids as $ref_id) {
250 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
TableGUI class for media pool page usages listing.
__construct($a_parent_obj, $a_parent_cmd, $a_page, $a_incl_hist)
Constructor.
fillRow($a_set)
Standard Version of Fill Row.
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.
getFirstWritableRefId($a_obj_id)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
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
setEnableHeader($a_enableheader)
Set Enable Header.
static _lookGlossaryTerm($term_id)
get glossary term