ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 

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 $this->tpl->parseCurrentBlock();
83 }
84
85 $this->showDetailsLink();
86
87 return $this->tpl->get();
88 }
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)

References ilSubItemListGUI\$lng, 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\showDetailsLink(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ parseImage()

ilObjMediaPoolSubItemListGUI::parseImage ( int  $a_sub_id)
protected

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

90 : bool
91 {
92 global $DIC;
93 $thumbs_gui = $DIC->mediaObjects()->internal()->gui()->thumbs();
94
95 $sub_id = ilMediaPoolItem::lookupForeignId($a_sub_id);
96 // output thumbnail (or mob icon)
97 if (ilObject::_lookupType($sub_id) === "mob") {
98 $mob = new ilObjMediaObject($sub_id);
99 $this->tpl->setVariable(
100 "SUB_ITEM_IMAGE",
101 $thumbs_gui->getThumbHtml($sub_id)
102 );
103 }
104 return false;
105 }
static lookupForeignId(int $a_id)
static _lookupType(int $id, bool $reference=false)
global $DIC
Definition: shib_login.php:26

References $DIC, ilObject\_lookupType(), 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: