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();
37 $this->repo_tree = $DIC->repositoryTree();
40 $this->page = $a_page;
41 $this->incl_hist = $a_incl_hist;
45 $this->
setRowTemplate(
"tpl.mep_page_usage_row.html",
"Modules/MediaPool");
55 $usages = $this->page->getUsages($this->incl_hist);
59 $agg_usages = array();
60 foreach ($usages as $k => $usage) {
61 $usage[
"trash"] =
false;
62 if (is_int(strpos($usage[
"type"],
":"))) {
63 $us_arr = explode(
":", $usage[
"type"]);
66 if ($us_arr[1] ==
"pg") {
68 $usage[
"page"] = $page_obj;
69 $repo_tree = $this->repo_tree;
71 return $repo_tree->isInTree($ref_id);
73 $usage[
"ref_ids"] = $ref_ids;
74 if (count($ref_ids) == 0) {
75 $usage[
"trash"] =
true;
80 if ($usage[
"type"] ==
"clip") {
83 if ($this->incl_hist || !$usage[
"trash"]) {
84 if (empty($agg_usages[$usage[
"type"] .
":" . $usage[
"id"]])) {
85 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]] = $usage;
87 $agg_usages[$usage[
"type"] .
":" . $usage[
"id"]][
"versions"][] =
88 [
"hist_nr" => $usage[
"hist_nr"],
89 "lang" => $usage[
"lang"]];
96 $agg_usages[] = array(
"type" =>
"clip",
"cnt" => $clip_cnt);
115 if (is_int(strpos($usage[
"type"],
":"))) {
116 $us_arr = explode(
":", $usage[
"type"]);
117 $usage[
"type"] = $us_arr[1];
118 $cont_type = $us_arr[0];
122 include_once(
'./Services/Link/classes/class.ilLink.php');
124 switch ($usage[
"type"]) {
126 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
127 $page_obj = $usage[
"page"];
131 switch ($cont_type) {
133 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
134 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
135 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
137 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $cont_type);
138 $item[
"obj_title"] = $lm_obj->
getTitle();
139 $item[
"sub_txt"] = $this->lng->txt(
"pg");
148 require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
149 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
151 $item[
"sub_txt"] = $this->lng->txt(
"pg");
161 $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
162 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
164 $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
173 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_" . $cont_type);
182 if ($usage[
"trash"]) {
183 $item[
"obj_title"] .=
" (" .
$lng->txt(
"trash") .
")";
189 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
198 $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
200 $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
205 if (is_array($usage[
"versions"]) && is_object($usage[
"page"])) {
208 if (count($usage[
"versions"]) > 5) {
210 $cnt = count($usage[
"versions"]) - 5;
211 for (
$i = 0;
$i < $cnt;
$i++) {
212 unset($usage[
"versions"][
$i]);
215 foreach ($usage[
"versions"] as $version) {
216 if ($version[
"hist_nr"] == 0) {
217 $version[
"hist_nr"] = $this->lng->txt(
"cont_current_version");
219 $ver .= $sep . $version[
"hist_nr"];
220 if ($version[
"lang"] !=
"") {
221 $ver .=
"/" . $version[
"lang"];
226 $this->tpl->setCurrentBlock(
"versions");
227 $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
228 $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
229 $this->tpl->parseCurrentBlock();
233 if ($item[
"obj_type_txt"] !=
"") {
234 $this->tpl->setCurrentBlock(
"type");
235 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
236 $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
237 $this->tpl->parseCurrentBlock();
240 if ($usage[
"type"] !=
"clip") {
241 if ($item[
"obj_link"]) {
242 $this->tpl->setCurrentBlock(
"linked_item");
243 $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
244 $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
245 $this->tpl->parseCurrentBlock();
247 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
250 if ($item[
"sub_txt"] !=
"") {
251 $this->tpl->setVariable(
"SEP",
", ");
252 $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
253 if ($item[
"sub_title"] !=
"") {
254 $this->tpl->setVariable(
"SEP2",
": ");
255 $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
259 $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1") .
260 " " . $usage[
"cnt"] .
" " . $this->lng->txt(
"cont_users_have_mob_in_clip2"));
269 foreach ($ref_ids as $ref_id) {
270 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.
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.
__construct(Container $dic, ilPlugin $plugin)
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