primo commit
This commit is contained in:
1
components/com_phocadownload/views/play/index.html
Normal file
1
components/com_phocadownload/views/play/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
4
components/com_phocadownload/views/play/metadata.xml
Normal file
4
components/com_phocadownload/views/play/metadata.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<view hidden="true" />
|
||||
</metadata>
|
||||
96
components/com_phocadownload/views/play/tmpl/default.php
Normal file
96
components/com_phocadownload/views/play/tmpl/default.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
// USER RIGHT - Access of categories (if file is included in some not accessed category) - - - - -
|
||||
// ACCESS is handled in SQL query, ACCESS USER ID is handled here (specific users)
|
||||
$rightDisplay = 0;
|
||||
if (!empty($this->t['file'][0])) {
|
||||
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $this->t['file'][0]->cataccessuserid, $this->t['file'][0]->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
|
||||
}
|
||||
// - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
if ($rightDisplay == 1) {
|
||||
|
||||
if ($this->t['html5_play'] == 1 && $this->t['filetype'] != 'flv') {
|
||||
|
||||
// style because of iframe
|
||||
echo '<div style="display: flex;align-items: center;justify-content: center;" class="ph-media-iframe-box">';
|
||||
if ($this->t['filetype'] == 'mp3') {
|
||||
echo '<audio width="'.$this->t['playerwidth'].'" height="'.$this->t['playerheight'].'" style="margin-top: 10px;" controls>';
|
||||
echo '<source src="'.$this->t['playfilewithpath'].'" type="audio/mpeg">';
|
||||
echo Text::_('COM_PHOCADOWNLOAD_BROWSER_DOES_NOT_SUPPORT_AUDIO_VIDEO_TAG');
|
||||
echo '</audio>'. "\n";
|
||||
} else if ($this->t['filetype'] == 'mp4') {
|
||||
echo '<video width="'.$this->t['playerwidth'].'" height="'.$this->t['playerheight'].'" style="margin-top: 10px;" controls>';
|
||||
echo '<source src="'.$this->t['playfilewithpath'].'" type="video/mp4">';
|
||||
echo Text::_('COM_PHOCADOWNLOAD_BROWSER_DOES_NOT_SUPPORT_AUDIO_VIDEO_TAG');
|
||||
echo '</video>'. "\n";
|
||||
} else if ($this->t['filetype'] == 'ogg') {
|
||||
echo '<audio width="'.$this->t['playerwidth'].'" height="'.$this->t['playerheight'].'" style="margin-top: 10px;" controls>';
|
||||
echo '<source src="'.$this->t['playfilewithpath'].'" type="audio/ogg">';
|
||||
echo Text::_('COM_PHOCADOWNLOAD_BROWSER_DOES_NOT_SUPPORT_AUDIO_VIDEO_TAG');
|
||||
echo '</audio>'. "\n";
|
||||
} else if ($this->t['filetype'] == 'ogv') {
|
||||
echo '<video width="'.$this->t['playerwidth'].'" height="'.$this->t['playerheight'].'" style="margin-top: 10px;" controls>';
|
||||
echo '<source src="'.$this->t['playfilewithpath'].'" type="video/ogg">';
|
||||
echo Text::_('COM_PHOCADOWNLOAD_BROWSER_DOES_NOT_SUPPORT_AUDIO_VIDEO_TAG');
|
||||
echo '</video>'. "\n";
|
||||
} else if ($this->t['filetype'] == 'webm') {
|
||||
echo '<video width="'.$this->t['playerwidth'].'" height="'.$this->t['playerheight'].'" style="margin-top: 10px;" controls>';
|
||||
echo '<source src="'.$this->t['playfilewithpath'].'" type="video/webm">';
|
||||
echo Text::_('COM_PHOCADOWNLOAD_BROWSER_DOES_NOT_SUPPORT_AUDIO_VIDEO_TAG');
|
||||
echo '</video>'. "\n";
|
||||
} /*else if ($this->t['filetype'] == 'flv') {
|
||||
echo '<video width="'.$this->t['playerwidth'].'" height="'.$this->t['playerheight'].'" style="margin-top: 10px;" controls>';
|
||||
echo '<source src="'.$this->t['playfilewithpath'].'" type="video/x-flv">';
|
||||
echo Text::_('COM_PHOCADOWNLOAD_BROWSER_DOES_NOT_SUPPORT_AUDIO_VIDEO_TAG');
|
||||
echo '</video>'. "\n";
|
||||
}*/
|
||||
echo '</div>';
|
||||
|
||||
} else {
|
||||
|
||||
//Flow Player
|
||||
$versionFLP = '3.2.2';
|
||||
$versionFLPJS = '3.2.2';
|
||||
$document = Factory::getDocument();
|
||||
//$document->addScript($this->t['playerpath'].'flowplayer-'.$versionFLPJS.'.min.js');
|
||||
|
||||
?>
|
||||
<div style="text-align:center;">
|
||||
<div style="margin: 10px auto;text-align:center; width:<?php echo $this->t['playerwidth']; ?>px"><a href="<?php echo $this->t['playfilewithpath']; ?>" style="display:block;width:<?php echo $this->t['playerwidth']; ?>px;height:<?php echo $this->t['playerheight']; ?>px" id="player"></a><?php
|
||||
|
||||
if ($this->t['filetype'] == 'mp3') {
|
||||
?><script>
|
||||
|
||||
flowplayer("player", "<?php echo $this->t['playerpath']; ?>flowplayer-<?php echo $versionFLP ?>.swf",
|
||||
{
|
||||
plugins: {
|
||||
controls: {
|
||||
fullscreen: false,
|
||||
height: <?php echo $this->t['playerheight']; ?>
|
||||
}
|
||||
}
|
||||
}
|
||||
);</script><?php
|
||||
} else {
|
||||
?><script>
|
||||
|
||||
flowplayer("player", "<?php echo $this->t['playerpath']; ?>flowplayer-<?php echo $versionFLP ?>.swf");</script><?php
|
||||
}
|
||||
?></div></div><?php
|
||||
}
|
||||
} else {
|
||||
echo Text::_('COM_PHOCADOWNLOAD_NO_RIGHTS_ACCESS_CATEGORY');
|
||||
}
|
||||
|
||||
|
||||
3
components/com_phocadownload/views/play/tmpl/default.xml
Normal file
3
components/com_phocadownload/views/play/tmpl/default.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
</metadata>
|
||||
1
components/com_phocadownload/views/play/tmpl/index.html
Normal file
1
components/com_phocadownload/views/play/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
75
components/com_phocadownload/views/play/view.html.php
Normal file
75
components/com_phocadownload/views/play/view.html.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla 1.5
|
||||
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
*
|
||||
* @component Phoca Component
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Language\Text;
|
||||
jimport( 'joomla.application.component.view');
|
||||
|
||||
class PhocaDownloadViewPlay extends HtmlView
|
||||
{
|
||||
|
||||
function display($tpl = null){
|
||||
|
||||
|
||||
$app = Factory::getApplication();
|
||||
$params = $app->getParams();
|
||||
$this->t = array();
|
||||
$this->t['user'] = Factory::getUser();
|
||||
$uri = Uri::getInstance();
|
||||
$model = $this->getModel();
|
||||
$document = Factory::getDocument();
|
||||
$fileId = $app->input->get('id', 0, 'int');
|
||||
$file = $model->getFile($fileId);
|
||||
|
||||
$fileExt = '';
|
||||
|
||||
$filePath = PhocaDownloadPath::getPathSet('fileplay');
|
||||
$filePath = str_replace ( '../', Uri::base(false).'', $filePath['orig_rel_ds']);
|
||||
if (isset($file[0]->filename_play) && $file[0]->filename_play != '') {
|
||||
|
||||
$fileExt = PhocaDownloadFile::getExtension($file[0]->filename_play);
|
||||
$canPlay = PhocaDownloadFile::canPlay($file[0]->filename_play);
|
||||
if ($canPlay) {
|
||||
$this->t['playfilewithpath'] = $filePath . $file[0]->filename_play;
|
||||
//$this->t['playerpath'] = JUri::base().'components/com_phocadownload/assets/jwplayer/';
|
||||
//$this->t['playerpath'] = Uri::base().'media/com_phocadownload/js/flowplayer/';
|
||||
$this->t['playerwidth'] = $params->get( 'player_width', 328 );
|
||||
$this->t['playerheight'] = $params->get( 'player_height', 200 );
|
||||
$this->t['html5_play'] = 1;//$params->get( 'html5_play', 1 );
|
||||
} else {
|
||||
echo Text::_('COM_PHOCADOWNLOAD_ERROR_NO_CORRECT_FILE_TO_PLAY_FOUND');exit;
|
||||
}
|
||||
} else {
|
||||
echo Text::_('COM_PHOCADOWNLOAD_ERROR_NO_FILE_TO_PLAY_FOUND');exit;
|
||||
}
|
||||
|
||||
$this->t['filetype'] = $fileExt;
|
||||
if ($fileExt == 'mp3') {
|
||||
$this->t['filetype'] = 'mp3';
|
||||
$this->t['playerheight'] = $params->get( 'player_mp3_height', 30 );
|
||||
} else if ($fileExt == 'ogg') {
|
||||
$this->t['filetype'] = 'ogg';
|
||||
$this->t['playerheight'] = $params->get( 'player_mp3_height', 30 );
|
||||
}
|
||||
|
||||
|
||||
$this->t['file'] = $file;
|
||||
//$this->assignRef('file', $file);
|
||||
//$this->assignRef('tmpl', $this->t);
|
||||
//$this->assignRef('params', $params);
|
||||
//$uriT = $uri->toString();
|
||||
//$this->assignRef('request_url', $uriT);
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user