ILIAS  release_8 Revision v8.24
McstPodcastGUI Class Reference

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

+ Collaboration diagram for McstPodcastGUI:

Public Member Functions

 __construct (\ilObjMediaCast $obj, ilGlobalTemplateInterface $tpl=null, string $rss_link="")
 
 executeCommand ()
 
 getHTML ()
 

Protected Attributes

string $rss_link = ""
 
ilMediaObjectsPlayerWrapperGUI $player_wrapper
 
ilCtrl $ctrl
 
ilObjMediaCast $media_cast
 
ilGlobalTemplateInterface $tpl
 
ILIAS DI UIServices $ui
 
ilLanguage $lng
 
ilObjUser $user
 

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 Podcast GUI for mediacasts

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls McstPodcastGUI: ilMediaObjectsPlayerWrapperGUI

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

Constructor & Destructor Documentation

◆ __construct()

McstPodcastGUI::__construct ( \ilObjMediaCast  $obj,
ilGlobalTemplateInterface  $tpl = null,
string  $rss_link = "" 
)

Definition at line 36 of file class.McstPodcastGUI.php.

40 {
41 global $DIC;
42
43 $this->ui = $DIC->ui();
44 $this->lng = $DIC->language();
45 $this->media_cast = $obj;
46 $this->tpl = $tpl;
47 $this->user = $DIC->user();
48 $this->ctrl = $DIC->ctrl();
49 $this->rss_link = $rss_link;
50 $this->player_wrapper = $DIC->mediaObjects()
51 ->internal()
52 ->gui()
53 ->player()
54 ->wrapper();
55 }
ilGlobalTemplateInterface $tpl
global $DIC
Definition: feed.php:28

References $DIC, $rss_link, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

McstPodcastGUI::executeCommand ( )
Exceptions
ilCtrlException

Definition at line 60 of file class.McstPodcastGUI.php.

60 : void
61 {
63
64 $next_class = $ctrl->getNextClass($this);
65 $cmd = $ctrl->getCmd("show");
66
67 switch ($next_class) {
68 case strtolower(ilMediaObjectsPlayerWrapperGUI::class):
69 $ctrl->forwardCommand($this->player_wrapper);
70 break;
71
72 default:
73 if (in_array($cmd, array(""))) {
74 $this->$cmd();
75 }
76 }
77 }
getNextClass($a_gui_class=null)
@inheritDoc
getCmd(string $fallback_command=null)
@inheritDoc

References $ctrl, ilCtrl\forwardCommand(), ilCtrl\getCmd(), and ilCtrl\getNextClass().

+ Here is the call graph for this function:

◆ getHTML()

McstPodcastGUI::getHTML ( )

Definition at line 79 of file class.McstPodcastGUI.php.

79 : string
80 {
81 $f = $this->ui->factory();
82 $renderer = $this->ui->renderer();
85
86 $items = [];
87 foreach ($this->media_cast->getSortedItemsArray() as $med_item) {
88 $mob = new \ilObjMediaObject($med_item["mob_id"]);
89
90 $audio = $this->player_wrapper->audio(
91 $mob,
92 $this->media_cast->getRefId()
93 );
94
95 if (is_null($audio)) {
96 continue;
97 }
98
99 $item = $f->item()->standard($mob->getTitle())
100 ->withAudioPlayer($audio)
101 ->withProperties([$this->lng->txt("mcst_duration") => $med_item["playtime"]])
102 ->withDescription($mob->getDescription());
103
104 // $f->image()->responsive($mob->getVideoPreviewPic(), "")
105 if ($mob->getVideoPreviewPic() != "") {
106 $item = $item->withLeadImage(
107 $f->image()->responsive($mob->getVideoPreviewPic(), "")
108 );
109 }
110
111 if ($this->media_cast->getDownloadable()) {
112 $ctrl->setParameterByClass("ilobjmediacastgui", "item_id", $med_item["id"]);
113 $ctrl->setParameterByClass("ilobjmediacastgui", "purpose", "Standard");
114 $download = $ctrl->getLinkTargetByClass("ilobjmediacastgui", "downloadItem");
115 $actions = $f->dropdown()->standard(array(
116 $f->button()->shy($lng->txt("download"), $download),
117 ));
118 $item = $item->withActions($actions);
119 }
120
121
122 $items[] = $item;
123 }
124
125 $list = $f->panel()->listing()->standard(
126 $this->lng->txt("mcst_audio_files"),
127 [
128 $f->item()->group("", $items)
129 ]
130 );
131
132 if ($this->rss_link !== "") {
133 $actions = [
134 $f->link()->standard(
135 $lng->txt("mcst_webfeed"),
136 $this->rss_link
137 )->withOpenInNewViewport(true)
138 ];
139 $list = $list->withActions($f->dropdown()->standard($actions));
140 }
141
142 return $renderer->render($list);
143 }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
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...

References $ctrl, Vendor\Package\$f, $lng, ilCtrl\getLinkTargetByClass(), ILIAS\Repository\lng(), ilCtrl\setParameterByClass(), ilLanguage\txt(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl McstPodcastGUI::$ctrl
protected

Definition at line 29 of file class.McstPodcastGUI.php.

Referenced by executeCommand(), and getHTML().

◆ $lng

ilLanguage McstPodcastGUI::$lng
protected

Definition at line 33 of file class.McstPodcastGUI.php.

Referenced by getHTML().

◆ $media_cast

ilObjMediaCast McstPodcastGUI::$media_cast
protected

Definition at line 30 of file class.McstPodcastGUI.php.

◆ $player_wrapper

ilMediaObjectsPlayerWrapperGUI McstPodcastGUI::$player_wrapper
protected

Definition at line 28 of file class.McstPodcastGUI.php.

◆ $rss_link

string McstPodcastGUI::$rss_link = ""
protected

Definition at line 27 of file class.McstPodcastGUI.php.

Referenced by __construct().

◆ $tpl

ilGlobalTemplateInterface McstPodcastGUI::$tpl
protected

Definition at line 31 of file class.McstPodcastGUI.php.

Referenced by __construct().

◆ $ui

ILIAS DI UIServices McstPodcastGUI::$ui
protected

Definition at line 32 of file class.McstPodcastGUI.php.

◆ $user

ilObjUser McstPodcastGUI::$user
protected

Definition at line 34 of file class.McstPodcastGUI.php.


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