ILIAS  release_8 Revision v8.24
ilObjMediaPoolSubItemListGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjMediaPoolSubItemListGUI:
+ Collaboration diagram for ilObjMediaPoolSubItemListGUI:

Public Member Functions

 getHTML ()
 
- Public Member Functions inherited from ilSubItemListGUI
 __construct (string $cmd_class)
 
 getCmdClass ()
 
 setHighlighter (?ilLuceneHighlighterResultParser $highlighter)
 
 getHighlighter ()
 
 getRefId ()
 
 getObjId ()
 
 getType ()
 
 getSubItemIds (bool $limited=false)
 
 getItemListGUI ()
 
 init (ilObjectListGUI $item_list_gui, int $ref_id, array $subitem_ids)
 
 getHTML ()
 

Protected Member Functions

 parseImage (int $a_sub_id)
 
- Protected Member Functions inherited from ilSubItemListGUI
 showDetailsLink ()
 
 parseRelevance (int $sub_item)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSubItemListGUI
static setShowDetails (int $obj_id)
 set show details. More...
 
static resetDetails ()
 As long as static::resetDetails is not possible this method is final. More...
 
static enabledDetails (int $obj_id)
 As long as static::enableDetails is not possible this method is final. More...
 
- Protected Attributes inherited from ilSubItemListGUI
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
string $cmd_class = ''
 
ilTemplate $tpl = null
 
ilLuceneHighlighterResultParser $highlighter = null
 
array $subitem_ids = []
 
ilObjectListGUI $item_list_gui = null
 
int $ref_id = 0
 
int $obj_id = 0
 
string $type = ''
 
- Static Protected Attributes inherited from ilSubItemListGUI
static int $MAX_SUBITEMS = 5
 
static array $details = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Show media pool items

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilObjMediaPoolSubItemListGUI.php.

Member Function Documentation

◆ getHTML()

ilObjMediaPoolSubItemListGUI::getHTML ( )

Reimplemented from ilSubItemListGUI.

Definition at line 25 of file class.ilObjMediaPoolSubItemListGUI.php.

25 : string
26 {
28
29 $lng->loadLanguageModule('content');
30 foreach ($this->getSubItemIds(true) as $sub_item) {
31 if (
32 is_object($this->getHighlighter()) &&
33 $this->getHighlighter()->getContent($this->getObjId(), $sub_item) !== ''
34 ) {
35 $this->tpl->setCurrentBlock('sea_fragment');
36 $this->tpl->setVariable('TXT_FRAGMENT', $this->getHighlighter()->getContent($this->getObjId(), $sub_item));
37 $this->tpl->parseCurrentBlock();
38 }
39 $this->tpl->setCurrentBlock('subitem');
40 $this->tpl->setVariable('SEPERATOR', ': ');
41
42 switch (ilMediaPoolItem::lookupType($sub_item)) {
43 case 'fold':
44 $this->tpl->setVariable('LINK', ilLink::_getLink($this->getRefId(), 'mep', array(), '_' . $sub_item));
45 $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
46 break;
47
48 case 'mob':
49 $this->tpl->setVariable(
50 'LINK',
51 $this->getItemListGUI()->getCommandLink('allMedia') .
52 '&force_filter=' . $sub_item
53 );
54 $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
55 break;
56
57 case 'pg':
58 $pool = new ilObjMediaPool($this->getRefId());
59 $parent_id = $pool->getParentId($sub_item);
60 if ($parent_id !== null) {
61 $this->tpl->setVariable('LINK', ilLink::_getLink($this->getRefId(), 'mep', [], '_' . $parent_id));
62 $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
63 } else {
64 $this->tpl->setVariable('LINK', ilLink::_getLink($this->getRefId(), 'mep', []));
65 $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
66 }
67 break;
68 }
69
70
71 $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('obj_' . ilMediaPoolItem::lookupType($sub_item)));
72 $this->tpl->setVariable('TITLE', ilMediaPoolItem::lookupTitle($sub_item));
73 #$this->getItemListGUI()->setChildId($sub_item);
74
75 // begin-patch mime_filter
76
77 if (!$this->parseImage($sub_item)) {
78 $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('obj_' . ilMediaPoolItem::lookupType($sub_item)));
79 $this->tpl->setVariable('SEPERATOR', ':');
80 }
81
82
83 if (count($this->getSubItemIds(true)) > 1) {
84 $this->parseRelevance($sub_item);
85 }
86
87 $this->tpl->parseCurrentBlock();
88 }
89
90 $this->showDetailsLink();
91
92 return $this->tpl->get();
93 }
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static lookupTitle(int $a_id)
static lookupType(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSubItemIds(bool $limited=false)
parseRelevance(int $sub_item)

References ilSubItemListGUI\$lng, ilLink\_getLink(), ILIAS\UI\Implementation\Component\Input\ViewControl\getContent(), ilSubItemListGUI\getHighlighter(), ilSubItemListGUI\getItemListGUI(), ilSubItemListGUI\getObjId(), ilSubItemListGUI\getRefId(), ilSubItemListGUI\getSubItemIds(), ilLanguage\loadLanguageModule(), ilMediaPoolItem\lookupTitle(), ilMediaPoolItem\lookupType(), parseImage(), ilSubItemListGUI\parseRelevance(), ilSubItemListGUI\showDetailsLink(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ parseImage()

ilObjMediaPoolSubItemListGUI::parseImage ( int  $a_sub_id)
protected

Definition at line 95 of file class.ilObjMediaPoolSubItemListGUI.php.

95 : bool
96 {
97 $sub_id = ilMediaPoolItem::lookupForeignId($a_sub_id);
98 // output thumbnail (or mob icon)
99 if (ilObject::_lookupType($sub_id) === "mob") {
100 $mob = new ilObjMediaObject($sub_id);
101 $med = $mob->getMediaItem("Standard");
102 $target = $med->getThumbnailTarget();
103
104 if ($target != "") {
105 // begin-patch mime_filter
106 $this->tpl->setVariable(
107 'LINKED_LINK',
109 $this->getRefId(),
110 'mep',
111 array('action' => 'showMedia', 'mob_id' => $sub_id,'mepitem_id' => $a_sub_id)
112 )
113 );
114 $this->tpl->setVariable('LINKED_TARGET', '_blank');
115 $this->tpl->setVariable("LINKED_IMAGE", ilUtil::img($target));
116 // end-patch mime_filter
117 } else {
118 $this->tpl->setVariable("SUB_ITEM_IMAGE", ilUtil::img(ilUtil::getImagePath("icon_" . "mob" . ".gif")));
119 }
120 if (ilUtil::deducibleSize($med->getFormat()) && $med->getLocationType() === "Reference") {
121 $size = getimagesize($med->getLocation());
122 if ($size[0] > 0 && $size[1] > 0) {
123 $wr = $size[0] / 80;
124 $hr = $size[1] / 80;
125 $r = max($wr, $hr);
126 $w = (int) ($size[0] / $r);
127 $h = (int) ($size[1] / $r);
128 $this->tpl->setVariable("SUB_ITEM_IMAGE", ilUtil::img($med->getLocation(), "", $w, $h));
129 return true;
130 }
131 }
132 }
133 return false;
134 }
static lookupForeignId(int $a_id)
static _lookupType(int $id, bool $reference=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static deducibleSize(string $a_mime)
checks if mime type is provided by getimagesize()
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.

References ilLink\_getLink(), ilObject\_lookupType(), ilUtil\deducibleSize(), ilUtil\getImagePath(), ilSubItemListGUI\getRefId(), ilUtil\img(), ILIAS\Repository\int(), and ilMediaPoolItem\lookupForeignId().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: