Skip to content

Commit

Permalink
Merge branch 'v1.8.2' into 'main'
Browse files Browse the repository at this point in the history
Update class.xvmpGUI.php...

See merge request fluxlabs/ilias/plugins/RepositoryObjects/ViMP!52
  • Loading branch information
mstuder committed Apr 1, 2022
2 parents afa8050 + 29141ec commit 6afc59e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.8.2]
- fix: time link in modal - additional fix: https://git.fluxlabs.ch/fluxlabs/ilias/plugins/RepositoryObjects/ViMP/-/issues/2
- fix: wrong not available hint - additional fix: https://git.fluxlabs.ch/fluxlabs/ilias/plugins/RepositoryObjects/ViMP/-/issues/1

## [1.8.1]
- fix: time link in modal: https://git.fluxlabs.ch/fluxlabs/ilias/plugins/RepositoryObjects/ViMP/-/issues/2
- fix: wrong not available hint: https://git.fluxlabs.ch/fluxlabs/ilias/plugins/RepositoryObjects/ViMP/-/issues/1
Expand Down
15 changes: 7 additions & 8 deletions classes/GUI/Abstract/class.xvmpGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ protected function getAccessDeniedModal() : ilModalGUI
$modal = ilModalGUI::getInstance();
$modal->setId('xvmp_modal_player');
$modal->setType(ilModalGUI::TYPE_LARGE);
if (xvmp::is54()) {
$modal->setBody($this->dic->ui()->renderer()->render($this->dic->ui()->factory()->messageBox()->failure($this->pl->txt('access_denied'))));
} else {
$modal->setBody($this->dic->ui()->mainTemplate()->getMessageHTML($this->pl->txt('access_denied'),
"failure"));
}
$modal->setBody($this->dic->ui()->renderer()->render($this->dic->ui()->factory()->messageBox()->failure($this->pl->txt('access_denied'))));
return $modal;
}

Expand Down Expand Up @@ -311,8 +306,12 @@ public function fillModalPlayer($play_video_id = null, bool $async = true) {
$playModalDto = $this->buildPlayerContainerDTO($video);

$response = new stdClass();
$response->html = $this->renderer_factory->playerModal()->render($playModalDto, $async, ($this instanceof xvmpVideosGUI)); // TODO: change!
$response->video_title = $video->getTitle();
// TODO: Abstract classes MUST NOT know their children. this is a cognitive overload
// Refactoring Issue: https://git.fluxlabs.ch/fluxlabs/ilias/plugins/RepositoryObjects/ViMP/-/issues/3
$show_unavailable = ($this instanceof xvmpVideosGUI) || ($this instanceof xvmpContentGUI);
$response->html = $this->renderer_factory->playerModal()->render($playModalDto, $async, $show_unavailable);

$response->video_title = $video->getTitle();
/** @var xvmpUserProgress $progress */
$progress = xvmpUserProgress::where(array(xvmpUserProgress::F_USR_ID => $this->dic->user()->getId(), xvmpMedium::F_MID => $mid))->first();
if ($progress) {
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$id = 'xvmp';
$version = '1.8.1';
$version = '1.8.2';
$ilias_min_version = '6.0';
$ilias_max_version = '7.999';
$responsible = 'fluxlabs ag';
Expand Down
4 changes: 3 additions & 1 deletion templates/js/xvmp_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ var VimpContent = {
},

copyDirectLinkWithTime: function (link_tpl) {
this.copyToClipboard(link_tpl.replace('_0.', '_' + Math.floor(player.currentTime()) + '.'));
let currentTime = '_' + Math.floor(player.currentTime());
let link = link_tpl.replace('_0.', currentTime + '.').replace('_0&', currentTime + '&');
this.copyToClipboard(link);
},

copyToClipboard: function (textToCopy) {
Expand Down
2 changes: 1 addition & 1 deletion templates/js/xvmp_content.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6afc59e

Please sign in to comment.