5include_once(
"Services/Table/classes/class.ilTable2GUI.php");
 
   21        function __construct($a_parent_obj, $a_parent_cmd, $a_page, $a_incl_hist)
 
   25                parent::__construct($a_parent_obj, $a_parent_cmd);
 
   26                $this->page = $a_page;
 
   27                $this->incl_hist = $a_incl_hist;
 
   31                $this->
setRowTemplate(
"tpl.mep_page_usage_row.html", 
"Modules/MediaPool");
 
   33                $this->
setTitle($lng->txt(
"cont_mob_usages"));
 
   41                $usages = $this->page->getUsages($this->incl_hist);
 
   45                $agg_usages = array();
 
   46                foreach($usages as $k => $usage)
 
   48                        if ($usage[
"type"] == 
"clip")
 
   54                                if (empty($agg_usages[$usage[
"type"].
":".$usage[
"id"]]))
 
   56                                        $usage[
"hist_nr"] = array($usage[
"hist_nr"]);
 
   57                                        $agg_usages[$usage[
"type"].
":".$usage[
"id"]] = $usage;
 
   61                                        $agg_usages[$usage[
"type"].
":".$usage[
"id"]][
"hist_nr"][] =
 
   70                        $agg_usages[] = array(
"type" => 
"clip", 
"cnt" => $clip_cnt);
 
   88                if(is_int(strpos($usage[
"type"], 
":")))
 
   90                        $us_arr = explode(
":", $usage[
"type"]);
 
   91                        $usage[
"type"] = $us_arr[1];
 
   92                        $cont_type = $us_arr[0];
 
   96                include_once(
'./Services/Link/classes/class.ilLink.php');
 
   98                switch($usage[
"type"])
 
  101                                include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
 
  109                                                require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
 
  110                                                require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
 
  111                                                require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
  113                                                $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
 
  114                                                $item[
"obj_title"] = $lm_obj->getTitle();
 
  115                                                $item[
"sub_txt"] = $this->lng->txt(
"pg");
 
  125                                                require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
 
  126                                                $item[
"obj_type_txt"] = $this->lng->txt(
"obj_wiki");
 
  128                                                $item[
"sub_txt"] = $this->lng->txt(
"pg");
 
  138                                                require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
  139                                                require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  141                                                $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
 
  142                                                $item[
"obj_type_txt"] = $this->lng->txt(
"obj_glo");
 
  144                                                $item[
"sub_txt"] = $this->lng->txt(
"cont_term");
 
  154                                                $item[
"obj_type_txt"] = $this->lng->txt(
"obj_".$cont_type);
 
  166                                $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mep");
 
  176                                $item[
"obj_type_txt"] = $this->lng->txt(
"obj_mob");
 
  178                                $item[
"sub_txt"] = $this->lng->txt(
"cont_link_area");
 
  183                if (is_array($usage[
"hist_nr"]) &&
 
  184                        (count($usage[
"hist_nr"]) > 1 || $usage[
"hist_nr"][0] > 0))
 
  186                        asort($usage[
"hist_nr"]);
 
  188                        if ($usage[
"hist_nr"][0] == 0)
 
  190                                array_shift($usage[
"hist_nr"]);
 
  191                                $usage[
"hist_nr"][] = 0;
 
  194                        if (count($usage[
"hist_nr"]) > 5)
 
  197                                $cnt = count($usage[
"hist_nr"]) - 5;
 
  198                                for ($i = 0; $i < $cnt; $i++)
 
  200                                        unset($usage[
"hist_nr"][$i]);
 
  203                        foreach ($usage[
"hist_nr"] as $nr)
 
  211                                        $ver.= $sep.$this->lng->txt(
"cont_current_version");
 
  216                        $this->tpl->setCurrentBlock(
"versions");
 
  217                        $this->tpl->setVariable(
"TXT_VERSIONS", $this->lng->txt(
"cont_versions"));
 
  218                        $this->tpl->setVariable(
"VAL_VERSIONS", $ver);
 
  219                        $this->tpl->parseCurrentBlock();
 
  222                if ($item[
"obj_type_txt"] != 
"")
 
  224                        $this->tpl->setCurrentBlock(
"type");
 
  225                        $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
 
  226                        $this->tpl->setVariable(
"VAL_TYPE", $item[
"obj_type_txt"]);
 
  227                        $this->tpl->parseCurrentBlock();
 
  230                if ($usage[
"type"] != 
"clip")
 
  232                        if ($item[
"obj_link"])
 
  234                                $this->tpl->setCurrentBlock(
"linked_item");
 
  235                                $this->tpl->setVariable(
"TXT_OBJECT", $item[
"obj_title"]);
 
  236                                $this->tpl->setVariable(
"HREF_LINK", $item[
"obj_link"]);
 
  237                                $this->tpl->parseCurrentBlock();
 
  241                                $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $item[
"obj_title"]);
 
  244                        if ($item[
"sub_txt"] != 
"")
 
  246                                $this->tpl->setVariable(
"SEP", 
", ");
 
  247                                $this->tpl->setVariable(
"SUB_TXT", $item[
"sub_txt"]);
 
  248                                if ($item[
"sub_title"] != 
"")
 
  250                                        $this->tpl->setVariable(
"SEP2", 
": ");
 
  251                                        $this->tpl->setVariable(
"SUB_TITLE", $item[
"sub_title"]);
 
  258                        $this->tpl->setVariable(
"TXT_OBJECT_NO_LINK", $this->lng->txt(
"cont_users_have_mob_in_clip1").
 
  259                                " ".$usage[
"cnt"].
" ".$this->lng->txt(
"cont_users_have_mob_in_clip2"));
 
  271                        if ($ilAccess->checkAccess(
"write", 
"", 
$ref_id))
 
An exception for terminatinating execution or to throw for unit testing.
static _lookupTermId($a_def_id)
Looks up term id for a definition id.
static _lookGlossaryTerm($term_id)
get glossary term
static _lookupTitle($a_obj_id)
Lookup title.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
TableGUI class for media pool page usages listing.
getFirstWritableRefId($a_obj_id)
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd, $a_page, $a_incl_hist)
Constructor.
Class ilObjLearningModule.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
setEnableHeader($a_enableheader)
Set Enable Header.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.