ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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

ILIAS MediaCast InternalGUIService $gui
 
ILIAS MediaCast MediaCastManager $mc_manager
 
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 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 38 of file class.McstPodcastGUI.php.

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

42  {
43  global $DIC;
44 
45  $this->ui = $DIC->ui();
46  $this->lng = $DIC->language();
47  $this->media_cast = $obj;
48  $this->tpl = $tpl;
49  $this->user = $DIC->user();
50  $this->ctrl = $DIC->ctrl();
51  $this->rss_link = $rss_link;
52  $this->player_wrapper = $DIC->mediaObjects()
53  ->internal()
54  ->gui()
55  ->player()
56  ->wrapper();
57  $this->mc_manager = $DIC->mediaCast()->internal()->domain()->mediaCast($obj);
58  $this->gui = $DIC->mediaCast()->internal()->gui();
59  }
ilGlobalTemplateInterface $tpl
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

McstPodcastGUI::executeCommand ( )
Exceptions
ilCtrlException

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

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

64  : void
65  {
67 
68  $next_class = $ctrl->getNextClass($this);
69  $cmd = $ctrl->getCmd("show");
70 
71  switch ($next_class) {
72  case strtolower(ilMediaObjectsPlayerWrapperGUI::class):
73  $ctrl->forwardCommand($this->player_wrapper);
74  break;
75 
76  default:
77  if (in_array($cmd, array(""))) {
78  $this->$cmd();
79  }
80  }
81  }
getCmd(?string $fallback_command=null)
getNextClass($a_gui_class=null)
+ Here is the call graph for this function:

◆ getHTML()

McstPodcastGUI::getHTML ( )

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

References $ctrl, Vendor\Package\$f, $lng, $renderer, $rss_link, ilCtrl\getLinkTargetByClass(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilCtrl\setParameterByClass(), ILIAS\Repository\ui(), and ILIAS\GlobalScreen\Scope\Footer\Factory\withOpenInNewViewport().

83  : string
84  {
85  $f = $this->ui->factory();
86  $renderer = $this->ui->renderer();
88  $lng = $this->lng;
89 
90  $items = [];
91  foreach ($this->media_cast->getSortedItemsArray() as $med_item) {
92  $mob = new \ilObjMediaObject($med_item["mob_id"]);
93  $ctrl->setParameterByClass("ilobjmediacastgui", "item_id", $med_item["id"]);
94 
95  $audio = $this->player_wrapper->audio(
96  $mob,
97  $this->media_cast->getRefId()
98  );
99 
100  if (is_null($audio)) {
101  continue;
102  }
103 
104  $actions = [];
105  $properties = [];
106  $properties[$this->lng->txt("mcst_duration")] = $med_item["playtime"];
107 
108  if ($this->mc_manager->commentsActive()) {
109  $comments_gui = $this->gui->comments()->commentGUI(
110  $this->media_cast->getRefId(),
111  (int) $med_item["id"]
112  );
113  //var_dump($med_item["id"]);
114  $properties[$this->lng->txt("comments")] = $renderer->render($f->legacy()->content($comments_gui->getNumber()));
115  $actions[] = $comments_gui->getTriggerShyButton();
116  }
117 
118  $item = $f->item()->standard($mob->getTitle())
119  ->withAudioPlayer($audio)
120  ->withProperties($properties)
121  ->withDescription($mob->getDescription());
122 
123  // $f->image()->responsive($mob->getVideoPreviewPic(), "")
124  if ($mob->getVideoPreviewPic() != "") {
125  $item = $item->withLeadImage(
126  $f->image()->responsive($mob->getVideoPreviewPic(), "")
127  );
128  }
129 
130  if ($this->media_cast->getDownloadable()) {
131  $ctrl->setParameterByClass("ilobjmediacastgui", "purpose", "Standard");
132  $download = $ctrl->getLinkTargetByClass("ilobjmediacastgui", "downloadItem");
133  $actions[] = $f->button()->shy($lng->txt("download"), $download);
134  }
135 
136  if (count($actions) > 0) {
137  $dd = $f->dropdown()->standard($actions);
138  $item = $item->withActions($dd);
139  }
140 
141  $items[] = $item;
142  }
143  //exit;
144 
145  $list = $f->panel()->listing()->standard(
146  $this->lng->txt("mcst_audio_files"),
147  [
148  $f->item()->group("", $items)
149  ]
150  );
151 
152  if ($this->rss_link !== "") {
153  $actions = [
154  $f->link()->standard(
155  $lng->txt("mcst_webfeed"),
157  )->withOpenInNewViewport(true)
158  ];
159  $list = $list->withActions($f->dropdown()->standard($actions));
160  }
161 
162  return $renderer->render($list);
163  }
$renderer
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...
setParameterByClass(string $a_class, string $a_parameter, $a_value)
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl McstPodcastGUI::$ctrl
protected

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

Referenced by executeCommand(), and getHTML().

◆ $gui

ILIAS MediaCast InternalGUIService McstPodcastGUI::$gui
protected

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

◆ $lng

ilLanguage McstPodcastGUI::$lng
protected

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

Referenced by getHTML().

◆ $mc_manager

ILIAS MediaCast MediaCastManager McstPodcastGUI::$mc_manager
protected

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

◆ $media_cast

ilObjMediaCast McstPodcastGUI::$media_cast
protected

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

◆ $player_wrapper

ilMediaObjectsPlayerWrapperGUI McstPodcastGUI::$player_wrapper
protected

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

◆ $rss_link

string McstPodcastGUI::$rss_link = ""
protected

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

Referenced by __construct(), and getHTML().

◆ $tpl

ilGlobalTemplateInterface McstPodcastGUI::$tpl
protected

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

Referenced by __construct().

◆ $ui

ILIAS DI UIServices McstPodcastGUI::$ui
protected

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

◆ $user

ilObjUser McstPodcastGUI::$user
protected

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


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