6 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
29 $a_edit_order =
false,
30 $a_presentation_mode =
false 34 $this->ctrl = $DIC->ctrl();
35 $this->lng = $DIC->language();
36 $this->access = $DIC->access();
38 $lng = $DIC->language();
40 $this->edit_order = (bool) $a_edit_order;
41 $this->presentation_mode = (bool) $a_presentation_mode;
43 parent::__construct($a_parent_obj, $a_parent_cmd);
47 $this->downloadable = $mediacast->getDownloadable();
49 if (!$this->presentation_mode) {
54 if (!$this->edit_order) {
60 "tpl.table_media_cast_row.html",
82 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
85 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
87 if ($this->presentation_mode) {
88 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"presentation",
"1");
92 if ($enable_internal_rss && !$this->presentation_mode) {
93 $this->tpl->setCurrentBlock(
"access");
94 $this->tpl->setVariable(
"TXT_ACCESS",
$lng->txt(
"news_news_item_visibility"));
96 $this->tpl->setVariable(
"VAL_ACCESS",
$lng->txt(
"news_visibility_public"));
98 $this->tpl->setVariable(
"VAL_ACCESS",
$lng->txt(
"news_visibility_users"));
100 $this->tpl->parseCurrentBlock();
103 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"item_id",
"");
106 if ($a_set[
"update_date"] !=
"") {
107 $this->tpl->setCurrentBlock(
"last_update");
108 $this->tpl->setVariable(
110 $lng->txt(
"last_update")
112 $this->tpl->setVariable(
116 $this->tpl->parseCurrentBlock();
120 $med = $mob->getMediaItem(
"Standard");
122 $this->tpl->setVariable(
126 $this->tpl->setVariable(
130 $this->tpl->setVariable(
134 $this->tpl->setVariable(
139 $this->tpl->setVariable(
141 $lng->txt(
"mcst_play_time")
144 if ($a_set[
"playtime"] !=
"00:00:00") {
145 $this->tpl->setVariable(
150 $this->tpl->setVariable(
"VAL_DURATION",
"-");
153 if (!$this->edit_order) {
154 if ($this->downloadable) {
155 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"item_id", $a_set[
"id"]);
159 $a_mob = $mob->getMediaItem($purpose);
160 if (!is_object($a_mob)) {
163 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"purpose", $a_mob->getPurpose());
165 if (is_file($file)) {
166 $size = filesize($file);
167 $size =
", " . sprintf(
"%.1f MB",
$size / 1024 / 1024);
169 $format = ($a_mob->getFormat() !=
"")?$a_mob->getFormat():
"audio/mpeg";
170 $this->tpl->setCurrentBlock(
"downloadable");
171 $this->tpl->setVariable(
"TXT_DOWNLOAD",
$lng->txt(
"mcst_download_" . strtolower($a_mob->getPurpose())));
172 $this->tpl->setVariable(
"CMD_DOWNLOAD",
$ilCtrl->getLinkTargetByClass(
"ilobjmediacastgui",
"downloadItem"));
173 $this->tpl->setVariable(
"TITLE_DOWNLOAD",
"(" .
$format .
$size .
")");
174 $this->tpl->parseCurrentBlock();
178 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
181 $event_url = ($this->presentation_mode)
182 ?
$ilCtrl->getLinkTarget($this->parent_obj,
"handlePlayerEvent",
"",
true,
false)
185 if (is_object($med)) {
186 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
187 if (strcasecmp(
"Reference", $med->getLocationType()) == 0) {
188 $a_file = $med->getLocation();
193 $mpl->setMimeType($med->getFormat());
195 $mpl->setDisplayWidth(
"640");
196 $mpl->setDisplayHeight(
"480");
198 $mpl->setTitle($a_set[
"title"]);
199 $mpl->setDescription($a_set[
"content"]);
201 $med_alt = $mob->getMediaItem(
"VideoAlternative");
202 if (is_object($med_alt)) {
205 $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
210 $this->tpl->setVariable(
"PLAYER", $mpl->getPreviewHtml());
213 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"item_id", $a_set[
"id"]);
214 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]) &&
215 !$this->presentation_mode) {
216 $this->tpl->setCurrentBlock(
"edit");
217 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
218 $this->tpl->setVariable(
220 $ilCtrl->getLinkTargetByClass(
"ilobjmediacastgui",
"editCastItem")
223 if (!is_int(strpos($med->getFormat(),
"image/"))) {
224 $this->tpl->setVariable(
"TXT_DET_PLAYTIME",
$lng->txt(
"mcst_det_playtime"));
225 $this->tpl->setVariable(
227 $ilCtrl->getLinkTargetByClass(
"ilobjmediacastgui",
"determinePlaytime")
230 $this->tpl->parseCurrentBlock();
232 $this->tpl->setCurrentBlock(
"edit_checkbox");
233 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
234 $this->tpl->parseCurrentBlock();
238 $this->tpl->setCurrentBlock(
"edit_order");
239 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
240 $this->tpl->setVariable(
"VAL_ORDER", $a_set[
"order"]);
241 $this->tpl->parseCurrentBlock();
246 if (!$this->presentation_mode) {
247 if ($a_set[
"mob_cnt_download"] > 0) {
248 $this->tpl->setCurrentBlock(
"prop");
249 $this->tpl->setVariable(
"TXT_PROP",
$lng->txt(
"mcst_download_cnt"));
250 $this->tpl->setVariable(
"VAL_PROP", $a_set[
"mob_cnt_download"]);
251 $this->tpl->parseCurrentBlock();
253 if ($a_set[
"mob_cnt_play"] > 0) {
254 $this->tpl->setCurrentBlock(
"prop");
255 $this->tpl->setVariable(
"TXT_PROP",
$lng->txt(
"mcst_play_cnt"));
256 $this->tpl->setVariable(
"VAL_PROP", $a_set[
"mob_cnt_play"]);
257 $this->tpl->parseCurrentBlock();
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static signFile($path_to_file)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.