rifiniture di stile rifiniture primo rilascio di test

This commit is contained in:
2025-01-08 19:26:51 +01:00
parent 832a39a71d
commit f9bb7e1003
96 changed files with 8256 additions and 526 deletions

View File

@ -0,0 +1,215 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Filesystem\File;
echo '<div id="phoca-dl-categories-box" class="pd-categories-view'.$this->t['p']->get( 'pageclass_sfx' ).'">';
//if ( $this->t['p']->get( 'show_page_heading' ) ) {
// echo '<h1>'. $this->escape($this->t['p']->get('page_heading')) . '</h1>';
//}
echo PhocaDownloadRenderFront::renderHeader(array());
if ( $this->t['description'] != '') {
echo '<div class="pd-desc">'. $this->t['description']. '</div>';
}
if (!empty($this->t['categories'])) {
//$i = 1;
echo ' <div class="row row-cols-1 row-cols-md-3 g-4"> ';
foreach ($this->t['categories'] as $value) {
// Categories
$numDoc = 0;
$numSubcat = 0;
$catOutput = '';
// We need $numDoc and $numSubcat always - we need to run this foreach even the subcategories will be not displayed
if (!empty($value->subcategories)) {
foreach ($value->subcategories as $valueCat) {
// USER RIGHT - Access of categories - - - - -
// ACCESS is handled in SQL query, ACCESS USER ID is handled here (specific users)
$rightDisplay = 0;
if (!empty($valueCat)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $valueCat->accessuserid, $valueCat->access, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
$catOutput .= '<li class="list-group-item"><span class="pd-subcategory"></span><a href="'. Route::_(PhocaDownloadRoute::getCategoryRoute($valueCat->id, $valueCat->alias))
.'">'. $valueCat->title.'</a>';
if ($this->t['displaynumdocsecs'] == 1) {
$catOutput .=' <small>('.$valueCat->numdoc .')</small>';
}
$catOutput .= '</li>';
$numDoc = (int)$valueCat->numdoc + (int)$numDoc;
$numSubcat++;
}
}
}
if ($this->t['display_main_cat_subcategories'] != 1) {
$catOutput = '';
}
// Don't display parent category
// - if there is no catoutput
// - if there is no rigths for it
// USER RIGHT - Access of parent category - - - - -
// ACCESS is handled in SQL query, ACCESS USER ID is handled here (specific users)
$rightDisplay = 0;
if (!empty($value)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $value->accessuserid, $value->access, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
echo '<div class="col">';
echo '<div class="card h-100">';
if (isset($value->image) && $value->image != '') {
echo '<img src="'.$this->t['cssimgpath'].$value->image.'" class="card-img-top" alt="'.htmlspecialchars(strip_tags($value->title)).'" />';
}
echo '<div class="card-body">';
echo '<h3 class="card-title">';
echo '<a href="'. Route::_(PhocaDownloadRoute::getCategoryRoute($value->id, $value->alias)).'">'. $value->title.'</a>';
/*if ($this->t['displaynumdocsecsheader'] == 1) {
$numDocAll = (int)$numDoc + (int)$value->numdoc;
//$numDoc ... only files in subcategories
//$value->numdoc ... only files in the main category
//$numDocAll ... files in category and in subcategories
echo ' <small>('.$numSubcat.'/' . $numDocAll .')</small>';
}*/
echo '</h3>';
if ($this->t['displaymaincatdesc'] == 1) {
echo '<p class="card-text">'.$value->description.'</p>';
}
if ($catOutput != '') {
echo '<ul class="list-group list-group-flush">'.$catOutput. '</ul>';
}
echo '</div>'; // end card body
if ($this->t['displaynumdocsecsheader'] == 1) {
echo '<div class="card-footer pd-categories-card">';
echo '<small class="text-muted float-end">';
if ($this->t['displaynumdocsecsheader'] == 1) {
$numDocAll = (int)$numDoc + (int)$value->numdoc;
//$numDoc ... only files in subcategories
//$value->numdoc ... only files in the main category
//$numDocAll ... files in category and in subcategories
echo '<span class="pd-categories-number">'.Text::_('COM_PHOCADOWNLOAD_CATEGORIES').': '.$numSubcat.'</span>';
echo '<span class="pd-sep-number">&nbsp;/&nbsp;</span>';
echo '<span class="pd-files-number">'.Text::_('COM_PHOCADOWNLOAD_FILES').': '.$numDocAll.'</span>';
}
echo '</small>';
echo '</div>';
}
echo '</div>'; // end card
echo '</div>'; // end col
}
}
echo '</div>';// end row
}
echo '</div>';
echo '<div class="pd-cb"></div>';
// - - - - - - - - - -
// Most viewed docs (files)
// - - - - - - - - - -
$outputFile = '';
if (!empty($this->t['mostvieweddocs']) && $this->t['displaymostdownload'] == 1) {
$l = new PhocaDownloadLayout();
foreach ($this->t['mostvieweddocs'] as $value) {
// 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($value)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $value->cataccessuserid, $value->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
// FILESIZE
if ($value->filename !='') {
$absFile = str_replace('/', '/', Path::clean($this->t['absfilepath'] . $value->filename));
if (File::exists($absFile)) {
$fileSize = PhocaDownloadFile::getFileSizeReadable(filesize($absFile));
} else {
$fileSize = '';
}
}
// IMAGE FILENAME
//$imageFileName = '';
//if ($value->image_filename !='') {
$imageFileName = $l->getImageFileName($value->image_filename, $value->filename, 2);
/*$thumbnail = false;
$thumbnail = preg_match("/phocathumbnail/i", $value->image_filename);
if ($thumbnail) {
$imageFileName = '';
} else {
$imageFileName = 'style="background: url(\''.$this->t['cssimgpath'].$value->image_filename.'\') 0 center no-repeat;"';
}*/
//}
//$outputFile .= '<div class="pd-document'.$this->t['file_icon_size_md'].'" '.$imageFileName.'>';
$outputFile .= '<div class="pd-filename">'. $imageFileName['filenamethumb']
. '<div class="pd-document'.$this->t['file_icon_size_md'].'" '
. $imageFileName['filenamestyle'].'>';
$outputFile .= '<a href="'
. Route::_(PhocaDownloadRoute::getCategoryRoute($value->categoryid,$value->categoryalias))
.'">'. $value->title.'</a>'
.' <small>(' .$value->categorytitle.')</small>';
$outputFile .= PhocaDownloadRenderFront::displayNewIcon($value->date, $this->t['displaynew']);
$outputFile .= PhocaDownloadRenderFront::displayHotIcon($value->hits, $this->t['displayhot']);
$outputFile .= '</div></div>' . "\n";
}
}
if ($outputFile != '') {
echo '<div class="pd-hr ph-cb">&nbsp;</div>';
echo '<div id="phoca-dl-most-viewed-box">';
echo '<div class="pd-documents"><h3>'. Text::_('COM_PHOCADOWNLOAD_MOST_DOWNLOADED_FILES').'</h3>';
echo $outputFile;
echo '</div></div>';
}
}
echo '<div class="pd-cb">&nbsp;</div>';
echo PhocaDownloadUtils::getInfo();
?>

View File

@ -0,0 +1,182 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
echo '<div id="phoca-dl-categories-box" class="pd-categories-view'.$this->t['p']->get( 'pageclass_sfx' ).'">';
//if ( $this->t['p']->get( 'show_page_heading' ) ) {
// echo '<h1>'. $this->escape($this->t['p']->get('page_heading')) . '</h1>';
//}
echo PhocaDownloadRenderFront::renderHeader(array());
if ( $this->t['description'] != '') {
echo '<div class="pd-desc">'. $this->t['description']. '</div>';
}
if (!empty($this->t['categories'])) {
//$i = 1;
echo '<div class="row">';
foreach ($this->t['categories'] as $value) {
// Categories
$numDoc = 0;
$numSubcat = 0;
$catOutput = '';
if (!empty($value->subcategories)) {
foreach ($value->subcategories as $valueCat) {
// USER RIGHT - Access of categories - - - - -
// ACCESS is handled in SQL query, ACCESS USER ID is handled here (specific users)
$rightDisplay = 0;
if (!empty($valueCat)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $valueCat->accessuserid, $valueCat->access, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
$catOutput .= '<div class="pd-subcategory">';
$catOutput .= '<a href="'. JRoute::_(PhocaDownloadRoute::getCategoryRoute($valueCat->id, $valueCat->alias))
.'">'. $valueCat->title.'</a>';
if ($this->t['displaynumdocsecs'] == 1) {
$catOutput .=' <small>('.$valueCat->numdoc .')</small>';
}
$catOutput .= '</div>' . "\n";
$numDoc = (int)$valueCat->numdoc + (int)$numDoc;
$numSubcat++;
}
}
}
// Don't display parent category
// - if there is no catoutput
// - if there is no rigths for it
// USER RIGHT - Access of parent category - - - - -
// ACCESS is handled in SQL query, ACCESS USER ID is handled here (specific users)
$rightDisplay = 0;
if (!empty($value)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $value->accessuserid, $value->access, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
echo '<div class="col-sm-4 col-md-4">';
echo '<div class="thumbnail ph-thumbnail">';
echo '<h3>';
echo '<a href="'. JRoute::_(PhocaDownloadRoute::getCategoryRoute($value->id, $value->alias)).'">'. $value->title.'</a>';
if ($this->t['displaynumdocsecsheader'] == 1) {
$numDocAll = (int)$numDoc + (int)$value->numdoc;
//$numDoc ... only files in subcategories
//$value->numdoc ... only files in the main category
//$numDocAll ... files in category and in subcategories
echo ' <small>('.$numSubcat.'/' . $numDocAll .')</small>';
}
echo '</h3>';
if (isset($value->image) && $value->image != '') {
echo '<div class="ph-img"><img src="'.$this->t['cssimgpath'].$value->image.'" alt="'.htmlspecialchars(strip_tags($value->title)).'" /></div>';
}
if ($this->t['displaymaincatdesc'] == 1) {
echo '<div class="ph-desc">'.$value->description.'</div>';
} else {
if ($catOutput != '') {
echo '<div class="ph-subcategories">'.$catOutput. '</div>';
} else {
echo '<div class="pd-no-subcat">'.JText::_('COM_PHOCADOWNLOAD_NO_SUBCATEGORIES').'</div>';
}
}
echo '</div></div>';
}
}
echo '</div>';// end row
}
echo '</div>';
echo '<div class="pd-cb"></div>';
// - - - - - - - - - -
// Most viewed docs (files)
// - - - - - - - - - -
$outputFile = '';
if (!empty($this->t['mostvieweddocs']) && $this->t['displaymostdownload'] == 1) {
$l = new PhocaDownloadLayout();
foreach ($this->t['mostvieweddocs'] as $value) {
// 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($value)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $value->cataccessuserid, $value->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
// FILESIZE
if ($value->filename !='') {
$absFile = str_replace('/', '/', JPath::clean($this->t['absfilepath'] . $value->filename));
if (JFile::exists($absFile)) {
$fileSize = PhocaDownloadFile::getFileSizeReadable(filesize($absFile));
} else {
$fileSize = '';
}
}
// IMAGE FILENAME
//$imageFileName = '';
//if ($value->image_filename !='') {
$imageFileName = $l->getImageFileName($value->image_filename, $value->filename, 2);
/*$thumbnail = false;
$thumbnail = preg_match("/phocathumbnail/i", $value->image_filename);
if ($thumbnail) {
$imageFileName = '';
} else {
$imageFileName = 'style="background: url(\''.$this->t['cssimgpath'].$value->image_filename.'\') 0 center no-repeat;"';
}*/
//}
//$outputFile .= '<div class="pd-document'.$this->t['file_icon_size_md'].'" '.$imageFileName.'>';
$outputFile .= '<div class="pd-filename">'. $imageFileName['filenamethumb']
. '<div class="pd-document'.$this->t['file_icon_size_md'].'" '
. $imageFileName['filenamestyle'].'>';
$outputFile .= '<a href="'
. JRoute::_(PhocaDownloadRoute::getCategoryRoute($value->categoryid,$value->categoryalias))
.'">'. $value->title.'</a>'
.' <small>(' .$value->categorytitle.')</small>';
$outputFile .= PhocaDownloadRenderFront::displayNewIcon($value->date, $this->t['displaynew']);
$outputFile .= PhocaDownloadRenderFront::displayHotIcon($value->hits, $this->t['displayhot']);
$outputFile .= '</div></div>' . "\n";
}
}
if ($outputFile != '') {
echo '<div class="pd-hr" style="clear:both">&nbsp;</div>';
echo '<div id="phoca-dl-most-viewed-box">';
echo '<div class="pd-documents"><h3>'. JText::_('COM_PHOCADOWNLOAD_MOST_DOWNLOADED_FILES').'</h3>';
echo $outputFile;
echo '</div></div>';
}
}
echo '<div class="pd-cb">&nbsp;</div>';
echo PhocaDownloadUtils::getInfo();
?>

View File

@ -0,0 +1,154 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Component\ComponentHelper;
echo '<div id="phoca-dl-category-box" class="pd-category-view'.$this->t['p']->get( 'pageclass_sfx' ).'">';
//if ( $this->t['p']->get( 'show_page_heading' ) ) {
// echo '<h1>'. $this->escape($this->t['p']->get('page_heading')) . '</h1>';
//}
echo PhocaDownloadRenderFront::renderHeader(array());
// Search by tags - the category rights must be checked for every file
$this->checkRights = 1;
// -------------------------------------------------------------------
if ((int)$this->t['tagid'] > 0) {
echo $this->loadTemplate('files');
$this->checkRights = 1;
if (!empty($this->files)) {
echo $this->loadTemplate('pagination');
}
} else {
if (!empty($this->category[0])) {
echo '<div class="pd-category">';
if ($this->t['display_up_icon'] == 1) {
if (isset($this->category[0]->parent_id)) {
if ($this->category[0]->parent_id == 0) {
$linkUp = Route::_(PhocaDownloadRoute::getCategoriesRoute());
$linkUpText = Text::_('COM_PHOCADOWNLOAD_CATEGORIES');
} else if ($this->category[0]->parent_id > 0) {
$linkUp = Route::_(PhocaDownloadRoute::getCategoryRoute($this->category[0]->parent_id, $this->category[0]->parentalias));
$linkUpText = $this->category[0]->parenttitle;
} else {
$linkUp = '#';
$linkUpText = '';
}
echo '<div class="ph-top">'
.'<a class="btn btn-primary" title="'.$linkUpText.'" href="'. $linkUp.'" ><span class="icon-fw icon-arrow-left"></span> '
. $linkUpText
.'</a></div>';
}
}
} else {
echo '<div class="pd-category"><div class="pdtop"></div>';
}
if (!empty($this->category[0])) {
// 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->category[0])) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $this->category[0]->cataccessuserid, $this->category[0]->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
$this->checkRights = 0;
$l = new PhocaDownloadLayout();
//echo '<h3>'.$this->category[0]->title. '</h3>';
echo PhocaDownloadRenderFront::renderSubHeader(array($this->category[0]->title), '', 'pd-ctitle');
// Description
/*if ($l->isValueEditor($this->category[0]->description)) {
echo '<div class="pd-cdesc">'.$this->category[0]->description.'</div>';
}*/
// Description
if ($l->isValueEditor($this->category[0]->description)) {
echo '<div class="pd-cdesc">';
echo HTMLHelper::_('content.prepare', $this->category[0]->description);
echo '</div>';
}
if (!empty($this->subcategories)) {
foreach ($this->subcategories as $valueSubCat) {
$rightDisplaySub = 0;
if (!empty($valueSubCat)) {
$rightDisplaySub = PhocaDownloadAccess::getUserRight('accessuserid', $valueSubCat->cataccessuserid, $valueSubCat->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplaySub == 1) {
echo '<div class="pd-subcategory">';
echo '<a href="'. Route::_(PhocaDownloadRoute::getCategoryRoute($valueSubCat->id, $valueSubCat->alias))
.'">'. $valueSubCat->title.'</a>';
echo ' <small>('.$valueSubCat->numdoc.')</small></div>' . "\n";
$subcategory = 1;
}
}
echo '<div class="pd-hr-cb"></div>';
}
// =====================================================================================
// BEGIN LAYOUT AREA
// =====================================================================================
echo $this->loadTemplate('files');
// =====================================================================================
// END LAYOUT AREA
// =====================================================================================
if (!empty($this->category)) {
echo $this->loadTemplate('pagination');
}
/* if ($this->t['display_category_comments'] == 1) {
if (ComponentHelper::isEnabled('com_jcomments', true)) {
include_once(JPATH_BASE.'/components/com_jcomments/jcomments.php');
echo JComments::showComments($this->category[0]->id, 'com_phocadownload', Text::_('COM_PHOCADOWNLOAD_CATEGORY') .' '. $this->category[0]->title);
}
}
if ($this->t['display_category_comments'] == 2) {
echo '<div class="pd-fbcomments">'.$this->loadTemplate('comments-fb').'</div>';
}*/
} else {
echo '<h3>'.Text::_('COM_PHOCADOWNLOAD_CATEGORY'). '</h3>';
echo '<div class="alert alert-danger alert-danger">'.Text::_('COM_PHOCADOWNLOAD_NO_RIGHTS_ACCESS_CATEGORY').'</div>';
}
echo '</div>';
} else {
//echo '<h3>&nbsp;</h3>';
echo '</div>';
}
}
echo $this->t['bootstrapmodal'];
echo '</div><div class="pd-cb">&nbsp;</div>';
echo PhocaDownloadUtils::getInfo();
?>

View File

@ -0,0 +1,150 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
echo '<div id="phoca-dl-category-box" class="pd-category-view'.$this->t['p']->get( 'pageclass_sfx' ).'">';
//if ( $this->t['p']->get( 'show_page_heading' ) ) {
// echo '<h1>'. $this->escape($this->t['p']->get('page_heading')) . '</h1>';
//}
echo PhocaDownloadRenderFront::renderHeader(array());
// Search by tags - the category rights must be checked for every file
$this->checkRights = 1;
// -------------------------------------------------------------------
if ((int)$this->t['tagid'] > 0) {
echo $this->loadTemplate('files');
$this->checkRights = 1;
if (!empty($this->files)) {
echo $this->loadTemplate('pagination');
}
} else {
if (!empty($this->category[0])) {
echo '<div class="pd-category">';
if ($this->t['display_up_icon'] == 1) {
if (isset($this->category[0]->parentid)) {
if ($this->category[0]->parentid == 0) {
$linkUp = JRoute::_(PhocaDownloadRoute::getCategoriesRoute());
$linkUpText = JText::_('COM_PHOCADOWNLOAD_CATEGORIES');
} else if ($this->category[0]->parentid > 0) {
$linkUp = JRoute::_(PhocaDownloadRoute::getCategoryRoute($this->category[0]->parentid, $this->category[0]->parentalias));
$linkUpText = $this->category[0]->parenttitle;
} else {
$linkUp = '#';
$linkUpText = '';
}
echo '<div class="ph-top">'
.'<a class="btn btn-default" title="'.$linkUpText.'" href="'. $linkUp.'" ><span class="glyphicon glyphicon-arrow-left"></span> '
. $linkUpText
.'</a></div>';
}
}
} else {
echo '<div class="pd-category"><div class="pdtop"></div>';
}
if (!empty($this->category[0])) {
// 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->category[0])) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $this->category[0]->cataccessuserid, $this->category[0]->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplay == 1) {
$this->checkRights = 0;
$l = new PhocaDownloadLayout();
//echo '<h3>'.$this->category[0]->title. '</h3>';
echo PhocaDownloadRenderFront::renderSubHeader(array($this->category[0]->title), '', 'pd-ctitle');
// Description
/*if ($l->isValueEditor($this->category[0]->description)) {
echo '<div class="pd-cdesc">'.$this->category[0]->description.'</div>';
}*/
// Description
if ($l->isValueEditor($this->category[0]->description)) {
echo '<div class="pd-cdesc">';
echo Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $this->category[0]->description);
echo '</div>';
}
if (!empty($this->subcategories)) {
foreach ($this->subcategories as $valueSubCat) {
$rightDisplaySub = 0;
if (!empty($valueSubCat)) {
$rightDisplaySub = PhocaDownloadAccess::getUserRight('accessuserid', $valueSubCat->cataccessuserid, $valueSubCat->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
if ($rightDisplaySub == 1) {
echo '<div class="pd-subcategory">';
echo '<a href="'. JRoute::_(PhocaDownloadRoute::getCategoryRoute($valueSubCat->id, $valueSubCat->alias))
.'">'. $valueSubCat->title.'</a>';
echo ' <small>('.$valueSubCat->numdoc.')</small></div>' . "\n";
$subcategory = 1;
}
}
echo '<div class="pd-hr-cb"></div>';
}
// =====================================================================================
// BEGIN LAYOUT AREA
// =====================================================================================
echo $this->loadTemplate('files_bootstrap');
// =====================================================================================
// END LAYOUT AREA
// =====================================================================================
if (!empty($this->category)) {
echo $this->loadTemplate('pagination');
}
if ($this->t['display_category_comments'] == 1) {
if (JComponentHelper::isEnabled('com_jcomments', true)) {
include_once(JPATH_BASE.'/components/com_jcomments/jcomments.php');
echo JComments::showComments($this->category[0]->id, 'com_phocadownload', JText::_('COM_PHOCADOWNLOAD_CATEGORY') .' '. $this->category[0]->title);
}
}
if ($this->t['display_category_comments'] == 2) {
echo '<div class="pd-fbcomments">'.$this->loadTemplate('comments-fb').'</div>';
}
} else {
echo '<h3>'.JText::_('COM_PHOCADOWNLOAD_CATEGORY'). '</h3>';
echo '<div class="alert alert-error alert-danger">'.JText::_('COM_PHOCADOWNLOAD_NO_RIGHTS_ACCESS_CATEGORY').'</div>';
}
echo '</div>';
} else {
//echo '<h3>&nbsp;</h3>';
echo '</div>';
}
}
echo $this->t['bootstrapmodal'];
echo '</div><div class="pd-cb">&nbsp;</div>';
echo PhocaDownloadUtils::getInfo();
?>

View File

@ -0,0 +1,50 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
?><div id="phocadownload-comments"><?php
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$getParamsArray = explode(',', 'start,limitstart,template,fb_comment_id');
if (!empty($getParamsArray) ) {
foreach($getParamsArray as $key => $value) {
$uri->delVar($value);
}
}
if ($this->t['fb_comment_app_id'] == '') {
echo JText::_('COM_PHOCADOWNLOAD_ERROR_FB_APP_ID_EMPTY');
} else {
$cCount = '';
if ((int)$this->t['fb_comment_count'] > 0) {
$cCount = 'numposts="'.$this->t['fb_comment_count'].'"';
}
?><fb:comments href="<?php echo $uri->toString(); ?>" simple="1" <?php echo $cCount;?> width="<?php echo (int)$this->t['fb_comment_width'] ?>"></fb:comments>
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId: '<?php echo $this->t['fb_comment_app_id'] ?>',
status: true,
cookie: true,
xfbml: true
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol + '//connect.facebook.net/<?php echo $this->t['fb_comment_lang']; ?>/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<?php } ?>
</div>

View File

@ -0,0 +1,630 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
$l = new PhocaDownloadLayout();
$layoutCM = new FileLayout('category_modal', null, array('component' => 'com_phocadownload'));
if (!empty($this->files)) {
foreach ($this->files as $v) {
if ($this->checkRights == 1) {
// 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 (!isset($v->cataccessuserid)) {
$v->cataccessuserid = 0;
}
if (isset($v->catid) && isset($v->cataccessuserid) && isset($v->cataccess)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $v->cataccessuserid, $v->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
} else {
$rightDisplay = 1;
}
if ($rightDisplay == 1) {
// Test if we have information about category - if we are displaying items by e.g. search outcomes - tags
// we don't have any ID of category so we need to load it for each file.
$this->catitem[$v->id] = new StdClass();
$this->catitem[$v->id]->id = 0;
$this->catitem[$v->id]->alias = '';
if (isset($this->category[0]->id) && isset($this->category[0]->alias)) {
$this->catitem[$v->id]->id = (int)$this->category[0]->id;
$this->catitem[$v->id]->alias = $this->category[0]->alias;
} else {
$catDb = PhocaDownloadCategory::getCategoryByFile($v->id);
if (isset($catDb->id) && isset($catDb->alias)) {
$this->catitem[$v->id]->id = (int)$catDb->id;
$this->catitem[$v->id]->alias = $catDb->alias;
}
$categorySetTemp = 1;
}
// General
$linkDownloadB = '';
$linkDownloadE = '';
if ((int)$v->confirm_license > 0 || $this->t['display_file_view'] == 1) {
$linkDownloadB = '<a class="" href="'. Route::_(PhocaDownloadRoute::getFileRoute($v->id, $v->catid,$v->alias, $v->categoryalias, $v->sectionid). $this->t['limitstarturl']).'" >'; // we need pagination to go back
$linkDownloadE ='</a>';
} else {
if ($v->link_external != '' && $v->directlink == 1) {
$linkDownloadB = '<a class="" href="'.$v->link_external.'" target="'.$this->t['download_external_link'].'" >';
$linkDownloadE ='</a>';
} else {
$linkDownloadB = '<a class="" href="'. Route::_(PhocaDownloadRoute::getFileRoute($v->id, $this->catitem[$v->id]->id,$v->alias, $this->catitem[$v->id]->alias, $v->sectionid, 'download').$this->t['limitstarturl']).'" >';
$linkDownloadE ='</a>';
}
}
// pdfile
if ($v->filename != '') {
$imageFileName = $l->getImageFileName($v->image_filename, $v->filename);
$pdFile = '<div class="pd-filenamebox-bt">';
if ($this->t['filename_or_name'] == 'filenametitle') {
$pdFile .= '<div class="pd-title">'. $v->title . '</div>';
}
$pdFile .= '<div class="pd-filename">'. $imageFileName['filenamethumb']
. '<div class="pd-document'.$this->t['file_icon_size'].'" '
. $imageFileName['filenamestyle'].'>';
$pdFile .= '<div class="pd-float">';
$pdFile .= $linkDownloadB .$l->getName($v->title, $v->filename) .$linkDownloadE;
$pdFile .= '</div>';
$pdFile .= PhocaDownloadRenderFront::displayNewIcon($v->date, $this->t['displaynew']);
$pdFile .= PhocaDownloadRenderFront::displayHotIcon($v->hits, $this->t['displayhot']);
// String Tags - title suffix
$tagsS = $l->displayTagsString($v->tags_string);
if ($tagsS != '') {
$pdFile .= '<div class="pd-float">'.$tagsS.'</div>';
}
// Tags - title suffix
if ($this->t['display_tags_links'] == 4 || $this->t['display_tags_links'] == 6) {
$tags = $l->displayTags($v->id, 1);
if ($tags != '') {
$pdFile .= '<div class="pd-float">'.$tags.'</div>';
}
}
// Specific icons
if (isset($v->image_filename_spec1) && $v->image_filename_spec1 != '') {
$pdFile .= '<div class="pd-float">'.$l->getImageDownload($v->image_filename_spec1).'</div>';
}
if (isset($v->image_filename_spec2) && $v->image_filename_spec2 != '') {
$pdFile .= '<div class="pd-float">'.$l->getImageDownload($v->image_filename_spec2).'</div>';
}
$pdFile .= '</div></div></div>' . "\n";
}
// pdbuttonplay
$pdButtonPlay = '';
if ($this->t['display_play'] == 1 && isset($v->filename_play) && $v->filename_play != '') {
$fileExt = PhocaDownloadFile::getExtension($v->filename_play);
$canPlay = PhocaDownloadFile::canPlay($v->filename_play);
if ($canPlay) {
$playLink = Route::_(PhocaDownloadRoute::getFileRoute($v->id,$v->catid,$v->alias, $v->categoryalias,0, 'play').$this->t['limitstarturl']);
//$pdButtonPlay .= '<div class="pd-button-play">';
if ($this->t['play_popup_window'] == 1) {
// Special height for music only
$buttonPlOptions = $this->t['buttonpl']->options;
$dataType = 'play';
if ($fileExt == 'mp3' || $fileExt == 'ogg') {
$buttonPlOptions = $this->t['buttonpl']->optionsmp3;
$dataType="play-thin";
}
$pdButtonPlay = '<a class="btn btn-danger" href="'.$playLink.'" onclick="'. $buttonPlOptions.'" >'. Text::_('COM_PHOCADOWNLOAD_PLAY').'</a>';
} else {
// Special height for music only
$buttonPlOptions = $this->t['buttonpl']->optionsB;
$dataType = 'play';
if ($fileExt == 'mp3' || $fileExt == 'ogg') {
$buttonPlOptions = $this->t['buttonpl']->optionsmp3B;
$dataType="play-thin";
}
//$pdButtonPlay .= '<a class="btn btn-danger pd-bs-modal-button" href="'.$playLink.'" rel="'. $buttonPlOptions.'" >'. JText::_('COM_PHOCADOWNLOAD_PLAY').'</a>';
//$pdButtonPlay = '<a class="btn btn-danger pd-bs-modal-button" data-toggle="modal" data-target="#phModalPlay" data-href="'.$playLink.'" '.$buttonPlOptions.' >'. Text::_('COM_PHOCADOWNLOAD_PLAY').'</a>';
$pdButtonPlay = '<a class="btn btn-danger pd-bs-modal-button" data-type="'.$dataType.'" data-title="'. Text::_('COM_PHOCADOWNLOAD_PLAY').'" href="'.$playLink.'">'. Text::_('COM_PHOCADOWNLOAD_PLAY').'</a>';
}
//$pdButtonPlay .= '</div>';
}
}
// pdbuttonpreview
$pdButtonPreview = '';
if ($this->t['display_preview'] == 1 && isset($v->filename_preview) && $v->filename_preview != '') {
$fileExt = PhocaDownloadFile::getExtension($v->filename_preview);
if ($fileExt == 'pdf' || $fileExt == 'jpeg' || $fileExt == 'jpg' || $fileExt == 'png' || $fileExt == 'gif') {
$dataType = 'image';
if ($fileExt == 'pdf') {
$dataType = 'document';
}
$filePath = PhocaDownloadPath::getPathSet('filepreview');
$filePath = str_replace ( '../', Uri::base(true).'/', $filePath['orig_rel_ds']);
$previewLink = $filePath . $v->filename_preview;
//$pdButtonPreview .= '<div class="pd-button-preview">';
if ($this->t['preview_popup_window'] == 1) {
$pdButtonPreview .= '<a class="btn btn-warning" href="'.$previewLink.'" onclick="'. $this->t['buttonpr']->options.'" >'. Text::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
} else {
if ($fileExt == 'pdf') {
// Iframe - modal
//$pdButtonPreview .= '<a class="btn btn-warning pd-bs-modal-button" href="'.$previewLink.'" rel="'. $this->t['buttonpr']->options.'" >'. JText::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
//$pdButtonPreview = '<a class="btn btn-warning pd-bs-modal-button" data-toggle="modal" data-target="#phModalPreview" data-href="'.$previewLink.'" '. $this->t['buttonpr']->optionsB.' >'. Text::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
$pdButtonPreview = '<a class="btn btn-warning pd-bs-modal-button" data-type="'.$dataType.'" data-title="'. Text::_('COM_PHOCADOWNLOAD_PREVIEW').'" href="'.$previewLink.'">'. Text::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
} else {
// Image - modal
//$pdButtonPreview .= '<a class="btn btn-warning pd-bs-modal-button" href="'.$previewLink.'" rel="'. $this->t['buttonpr']->optionsimg.'" >'. JText::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
//$pdButtonPreview = '<a class="btn btn-warning pd-bs-modal-button" data-toggle="modal" data-target="#phModalPreview" data-href="'.$previewLink.'" '. $this->t['buttonpr']->optionsimgB.' >'. Text::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
$pdButtonPreview = '<a class="btn btn-warning pd-bs-modal-button" data-type="'.$dataType.'" data-title="'. Text::_('COM_PHOCADOWNLOAD_PREVIEW').'" href="'.$previewLink.'">'. Text::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
}
}
//$pdButtonPreview .= '</div>';
}
}
// pdbuttondownload
//$pdButtonDownload = '<div class="pd-button-download">';
$pdButtonDownload = str_replace('class=""', 'class="btn btn-success"', $linkDownloadB) . Text::_('COM_PHOCADOWNLOAD_DOWNLOAD') .$linkDownloadE;
//$pdButtonDownload .= '</div>';
// pdbuttondetails
$d = '';
$pdTitle = '';
if ($v->title != '') {
$pdTitle .= '<div class="pd-title pd-colfull">'.$v->title.'</div>';
$d .= $pdTitle;
}
$pdImage = '';
if ($v->image_download != '') {
$pdImage .= '<div class="pd-image pd-colfull">'.$l->getImageDownload($v->image_download).'</div>';
$d .= $pdImage;
}
$pdDescription = '';
if ($l->isValueEditor($v->description) && $this->t['display_description'] != 1 & $this->t['display_description'] != 2 & $this->t['display_description'] != 3) {
$pdDescription .= '<div class="pd-fdesc pd-colfull">'.$v->description.'</div>';
$d .= $pdDescription;
}
$pdFileSize = '';
$fileSize = $l->getFilesize($v->filename);
if ($fileSize != '') {
$pdFileSize .= '<div class="pd-filesize-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_FILESIZE').':</div>';
$pdFileSize .= '<div class="pd-fl-m pd-col2">'.$fileSize.'</div>';
$d .= $pdFileSize;
}
$pdVersion = '';
if ($v->version != '') {
$pdVersion .= '<div class="pd-version-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_VERSION').':</div>';
$pdVersion .= '<div class="pd-fl-m pd-col2">'.$v->version.'</div>';
$d .= $pdVersion;
}
$pdLicense = '';
if ($v->license != '') {
if ($v->license_url != '') {
$pdLicense .= '<div class="pd-license-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_LICENSE').':</div>';
$pdLicense .= '<div class="pd-fl-m pd-col2"><a href="'.$v->license_url.'" target="_blank">'.$v->license.'</a></div>';
} else {
$pdLicense .= '<div class="pd-license-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_LICENSE').':</div>';
$pdLicense .= '<div class="pd-fl-m pd-col2">'.$v->license.'</div>';
}
$d .= $pdLicense;
}
$pdAuthor = '';
if ($v->author != '') {
if ($v->author_url != '') {
$pdAuthor .= '<div class="pd-author-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_AUTHOR').':</div>';
$pdAuthor .= '<div class="pd-fl-m pd-col2"><a href="'.$v->author_url.'" target="_blank">'.$v->author.'</a></div>';
} else {
$pdAuthor .= '<div class="pd-author-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_AUTHOR').':</div>';
$pdAuthor .= '<div class="pd-fl-m pd-col2">'.$v->author.'</div>';
}
$d .= $pdAuthor;
}
$pdAuthorEmail = '';
if ($v->author_email != '') {
$pdAuthorEmail .= '<div class="pd-email-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_EMAIL').':</div>';
$pdAuthorEmail .= '<div class="pd-fl-m pd-col2">'. $l->getProtectEmail($v->author_email).'</div>';
$d .= $pdAuthorEmail;
}
$pdFileDate = '';
$fileDate = $l->getFileDate($v->filename, $v->date);
if ($fileDate != '') {
$pdFileDate .= '<div class="pd-date-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_DATE').':</div>';
$pdFileDate .= '<div class="pd-fl-m pd-col2">'.$fileDate.'</div>';
$d .= $pdFileDate;
}
$pdDownloads = '';
if ($this->t['display_downloads'] == 1) {
$pdDownloads .= '<div class="pd-downloads-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_DOWNLOADS').':</div>';
$pdDownloads .= '<div class="pd-fl-m pd-col2">'.$v->hits.' x</div>';
$d .= $pdDownloads;
}
$pdFeatures = '';
if ($l->isValueEditor($v->features)) {
$pdFeatures .= '<div class="pd-features-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_FEATURES').'</div>';
$pdFeatures .= '<div class="pd-features pd-col2">'.$v->features.'</div>';
}
$pdChangelog = '';
if ($l->isValueEditor($v->changelog)) {
$pdChangelog .= '<div class="pd-changelog-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_CHANGELOG').'</div>';
$pdChangelog .= '<div class="pd-changelog pd-col2">'.$v->changelog.'</div>';
}
$pdNotes = '';
if ($l->isValueEditor($v->notes)) {
$pdNotes .= '<div class="pd-notes-txt pd-col1">'.Text::_('COM_PHOCADOWNLOAD_NOTES').'</div>';
$pdNotes .= '<div class="pd-notes pd-col2">'.$v->notes.'</div>';
}
// pdfiledesc
$description = $l->isValueEditor($v->description);
$pdFileDescTop = '';
$pdFileDescBottom = '';
$oFileDesc = '';
if ($description) {
switch ($this->t['display_description']) {
case 1:
$pdFileDescTop = '<div class="pd-fdesc">' . $v->description . '</div>';
break;
case 2:
$pdFileDescBottom = '<div class="pd-fdesc">' . $v->description . '</div>';
break;
case 3:
$oFileDesc = '<div class="pd-fdesc">' . $v->description . '</div>';
break;
case 4:
$pdFileDescTop = '<div class="pd-fdesc">' . $v->description . '</div>';
$oFileDesc = '<div class="pd-fdesc">' . PhocaDownloadUtils::strTrimAll($d) . '</div>';
break;
case 5:
$pdFileDescBottom = '<div class="pd-fdesc">' . $v->description . '</div>';
$oFileDesc = '<div class="pd-fdesc">' . PhocaDownloadUtils::strTrimAll($d) . '</div>';
break;
case 6:
$pdFileDescTop = '<div class="pd-fdesc">' . $d . '</div>';
$oFileDesc = '<div class="pd-fdesc">' . PhocaDownloadUtils::strTrimAll($d) . '</div>';
break;
case 7:
$pdFileDescBottom = '<div class="pd-fdesc">' . $d . '</div>';
$oFileDesc = '<div class="pd-fdesc">' . PhocaDownloadUtils::strTrimAll($d) . '</div>';
break;
case 8:
$oFileDesc = '<div class="pd-fdesc">' . PhocaDownloadUtils::strTrimAll($d) . '</div>';
break;
default:
break;
}
}
// Detail Button
if ($this->t['display_detail'] == 1) {
if ($oFileDesc != '') {
$tooltipcontent = $oFileDesc;
} else {
$tooltipcontent = $d;
}
$tooltipcontent = str_replace('"', '\'', $tooltipcontent);
//$sA = array(utf8_encode(chr(11)), utf8_encode(chr(160)));
$eA = array("\t", "\n", "\r", "\0");
//$tooltipcontent = str_replace($sA, ' ', $tooltipcontent);
$tooltipcontent = str_replace($eA, '', $tooltipcontent);
//$textO = htmlspecialchars(addslashes('<div style=\'text-align:left;padding:5px\'>'.$tooltipcontent.'</div>'));
//$overlib = "\n\n" ."onmouseover=\"return overlib('".$textO."', CAPTION, '".Text::_('COM_PHOCADOWNLOAD_DETAILS')."', BELOW, RIGHT, CSSCLASS, TEXTFONTCLASS, 'fontPhocaPDClass', FGCLASS, 'fgPhocaPDClass', BGCLASS, 'bgPhocaPDClass', CAPTIONFONTCLASS,'capfontPhocaPDClass', CLOSEFONTCLASS, 'capfontclosePhocaPDClass', STICKY, MOUSEOFF, CLOSETEXT, '".Text::_('COM_PHOCADOWNLOAD_CLOSE')."');\"";
//$overlib .= " onmouseout=\"return nd();\"" . "\n";
//$pdButtonDetails = '<div class="pd-button-details">';
//$pdButtonDetails = '<a class="btn btn-info" '.$overlib.' href="javascript:void(0)">'. Text::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
/*$pdButtonDetails .= '<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-html="true" title="<div class=\'te-st\'><em>Tooltip</em> <u>with</u> <b>HTML</b></div><div><em>Tooltip</em> <u>with</u> <b>HTML</b></div><div><em>Tooltip</em> <u>with</u> <b>HTML</b></div>">
Tooltip with HTML
</button>';*/
$tooltipcontent = '<div class=\'pd-tooltip-box\'>' . $tooltipcontent . '</div>';
$pdButtonDetails = '<a class="btn btn-info" title="'.$tooltipcontent.'" data-bs-toggle="tooltip" data-bs-html="true">'. Text::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
//$pdButtonDetails = '</div>';
} else if ($this->t['display_detail'] == 2) {
// Bootstrap
$buttonDOptions = $this->t['buttond']->options;
$detailLink = Route::_(PhocaDownloadRoute::getFileRoute($v->id, $this->catitem[$v->id]->id,$v->alias, $this->catitem[$v->id]->alias, 0, 'detail').$this->t['limitstarturl']);
//$pdButtonDetails = '<div class="pd-button-details">';
$pdButtonDetails = '<a class="btn btn-info pd-bs-modal-button" data-type="detail" data-title="'. Text::_('COM_PHOCADOWNLOAD_DETAILS').'" href="'.$detailLink.'">'. Text::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
//$pdButtonDetails .= '</div>';
//$pdButtonDetails = '<div class="pd-button-details">';
//$pdButtonDetails = '<a class="btn btn-info pd-bs-modal-button" href="'.$detailLink.'" onclick="'. $buttonDOptions.'">'. Text::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
//$pdButtonDetails .= '</div>';
} else if ($this->t['display_detail'] == 3) {
$detailLink = Route::_(PhocaDownloadRoute::getFileRoute($v->id, $this->catitem[$v->id]->id,$v->alias, $this->catitem[$v->id]->alias, 0, 'detail').$this->t['limitstarturl']);
//$pdButtonDetails = '<div class="pd-button-details">';
$buttonDOptions = $this->t['buttond']->options;
$pdButtonDetails = '<a class="btn btn-info" href="'.$detailLink.'" onclick="'. $buttonDOptions.'">'. Text::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
//$pdButtonDetails .= '</div>';
} else {
$pdButtonDetails = '';
}
/// pdmirrorlink1
$pdMirrorLink1 = '';
$mirrorOutput1 = PhocaDownloadRenderFront::displayMirrorLinks(1, $v->mirror1link, $v->mirror1title, $v->mirror1target);
if ($mirrorOutput1 != '') {
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
$classMirror = '';//'pd-button-mirror1';
$mirrorOutput1 = str_replace('class=""', 'class="btn btn-primary "', $mirrorOutput1);
} else {
$classMirror = 'pd-mirror-bp';
}
$pdMirrorLink1 = '<div class="'.$classMirror.'">'.$mirrorOutput1.'</div>';
}
/// pdmirrorlink2
$pdMirrorLink2 = '';
$mirrorOutput2 = PhocaDownloadRenderFront::displayMirrorLinks(1, $v->mirror2link, $v->mirror2title, $v->mirror2target);
if ($mirrorOutput2 != '') {
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
$classMirror = '';//'pd-button-mirror2';
$mirrorOutput2 = str_replace('class=""', 'class="btn btn-primary "', $mirrorOutput2);
} else {
$classMirror = 'pd-mirror-bp';
}
$pdMirrorLink2 = '<div class="'.$classMirror.'">'.$mirrorOutput2.'</div>';
}
/// pdreportlink
$pdReportLink = PhocaDownloadRenderFront::displayReportLink(1, $v->title);
/// pdrating
$pdRating = PhocaDownloadRate::renderRateFile($v->id, $this->t['display_rating_file']);
/// pdtags
$pdTags = '';
if ($this->t['display_tags_links'] == 1 || $this->t['display_tags_links'] == 3) {
$tags2 = $l->displayTags($v->id);
if ($tags2 != '') {
$pdTags .= '<div class="pd-float">'.$tags2.'</div>';
}
}
/// pdvideo
$pdVideo = $l->displayVideo($v->video_filename, 0);
// ---------------------------------------------------
// Output
// ---------------------------------------------------
if ($v->textonly == 1) {
echo '<div class="row pd-row2-bp">';
echo '<div class="col-sm-12 col-md-12">';
echo $v->description;
echo '</div>';
echo '</div>';// end row
} else {
// ======= ROW 1 LEFT
echo '<div class="row ">';
if ($pdFileDescTop != '') {
echo '<div class="col-sm-12 col-md-12">';
echo $pdFileDescTop;
echo '</div>';
}
echo '<div class="col-sm-'.$this->t['bt_cat_col_left'].' col-md-'.$this->t['bt_cat_col_left'].'">';
echo $pdFile;
echo '</div>';
// ======= ROW 1 RIGHT
echo '<div class="col-sm-'.$this->t['bt_cat_col_right'].' col-md-'.$this->t['bt_cat_col_right'].'">';
echo '<div class="pd-button-box-bt">'.$pdButtonDownload . '</div>';
echo '<div class="pd-button-box-bt">'.$pdButtonDetails . '</div>';
echo '<div class="pd-button-box-bt">'.$pdButtonPreview . '</div>';
echo '<div class="pd-button-box-bt">'.$pdButtonPlay . '</div>';
echo '</div>';
echo '</div>';// end row
// ======== ROW 2 LEFT
echo '<div class="row pd-row2-bp">';
echo '<div class="col-sm-6 col-md-6">';
if ($pdVideo != '') {
echo '<div class="pd-video">'.$pdVideo.'</div>';
}
echo '<div class="pd-rating">'.$pdRating.'</div>';
echo '</div>';
// ======== ROW 2 RIGHT
echo '<div class="col-sm-6 col-md-6">';
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
if ($pdMirrorLink2 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink2.'</div>';
}
if ($pdMirrorLink1 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink1.'</div>';
}
} else if ($this->t['display_mirror_links'] == 1 || $this->t['display_mirror_links'] == 3) {
echo '<div class="pd-mirrors">'.$pdMirrorLink2.$pdMirrorLink1.'</div>';
}
if ($pdTags != '') {
echo '<div class="pd-tags-bp">'.$pdTags.'</div>';
}
if ($pdReportLink != '') {
echo '<div class="pd-report-bp">'.$pdReportLink.'</div>';
}
echo '</div>';
if ($pdFileDescBottom != '') {
echo '<div class="col-sm-12 col-md-12">';
echo $pdFileDescBottom;
echo '</div>';
}
echo '</div>';// end row
/*echo '<div class="pd-filebox">';
echo $pdFileDescTop;
echo $pdFile;
echo '<div class="pd-buttons">'.$pdButtonDownload.'</div>';
/*
if ($this->t['display_detail'] == 1 || $this->t['display_detail'] == 2) {
echo '<div class="pd-buttons">'.$pdButtonDetails.'</div>';
}
if ($this->t['display_preview'] == 1 && $pdButtonPreview != '') {
echo '<div class="pd-buttons">'.$pdButtonPreview.'</div>';
}
if ($this->t['display_play'] == 1 && $pdButtonPlay != '') {
echo '<div class="pd-buttons">'.$pdButtonPlay.'</div>';
}
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
if ($pdMirrorLink2 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink2.'</div>';
}
if ($pdMirrorLink1 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink1.'</div>';
}
} else if ($this->t['display_mirror_links'] == 1 || $this->t['display_mirror_links'] == 3) {
echo '<div class="pd-mirrors">'.$pdMirrorLink2.$pdMirrorLink1.'</div>';
}
if ($pdVideo != '') {
echo '<div class="pd-video">'.$pdVideo.'</div>';
}
if ($pdReportLink != '') {
echo '<div class="pd-report">'.$pdReportLink.'</div>';
}
if ($pdRating != '') {
echo '<div class="pd-rating">'.$pdRating.'</div>';
}
if ($pdTags != '') {
echo '<div class="pd-tags">'.$pdTags.'</div>';
}
echo $pdFileDescBottom;
echo '<div class="pd-cb"></div>';
echo '</div>';*/
// ---------------------------------------------------
}
}
}
$d = array();
$d['t'] = $this->t;
echo $layoutCM->render($d);
}
?>

View File

@ -0,0 +1,566 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
$l = new PhocaDownloadLayout();
if (!empty($this->files)) {
foreach ($this->files as $v) {
if ($this->checkRights == 1) {
// 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 (!isset($v->cataccessuserid)) {
$v->cataccessuserid = 0;
}
if (isset($v->catid) && isset($v->cataccessuserid) && isset($v->cataccess)) {
$rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $v->cataccessuserid, $v->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
// - - - - - - - - - - - - - - - - - - - - - -
} else {
$rightDisplay = 1;
}
if ($rightDisplay == 1) {
// Test if we have information about category - if we are displaying items by e.g. search outcomes - tags
// we don't have any ID of category so we need to load it for each file.
$this->catitem[$v->id] = new StdClass();
$this->catitem[$v->id]->id = 0;
$this->catitem[$v->id]->alias = '';
if (isset($this->category[0]->id) && isset($this->category[0]->alias)) {
$this->catitem[$v->id]->id = (int)$this->category[0]->id;
$this->catitem[$v->id]->alias = $this->category[0]->alias;
} else {
$catDb = PhocaDownloadCategory::getCategoryByFile($v->id);
if (isset($catDb->id) && isset($catDb->alias)) {
$this->catitem[$v->id]->id = (int)$catDb->id;
$this->catitem[$v->id]->alias = $catDb->alias;
}
$categorySetTemp = 1;
}
// General
$linkDownloadB = '';
$linkDownloadE = '';
if ((int)$v->confirm_license > 0 || $this->t['display_file_view'] == 1) {
$linkDownloadB = '<a class="" href="'. JRoute::_(PhocaDownloadRoute::getFileRoute($v->id, $v->catid,$v->alias, $v->categoryalias, $v->sectionid). $this->t['limitstarturl']).'" >'; // we need pagination to go back
$linkDownloadE ='</a>';
} else {
if ($v->link_external != '' && $v->directlink == 1) {
$linkDownloadB = '<a class="" href="'.$v->link_external.'" target="'.$this->t['download_external_link'].'" >';
$linkDownloadE ='</a>';
} else {
$linkDownloadB = '<a class="" href="'. JRoute::_(PhocaDownloadRoute::getFileRoute($v->id, $this->catitem[$v->id]->id,$v->alias, $this->catitem[$v->id]->alias, $v->sectionid, 'download').$this->t['limitstarturl']).'" >';
$linkDownloadE ='</a>';
}
}
// pdfile
if ($v->filename != '') {
$imageFileName = $l->getImageFileName($v->image_filename, $v->filename);
$pdFile = '<div class="pd-filenamebox-bt">';
if ($this->t['filename_or_name'] == 'filenametitle') {
$pdFile .= '<div class="pd-title">'. $v->title . '</div>';
}
$pdFile .= '<div class="pd-filename">'. $imageFileName['filenamethumb']
. '<div class="pd-document'.$this->t['file_icon_size'].'" '
. $imageFileName['filenamestyle'].'>';
$pdFile .= '<div class="pd-float">';
$pdFile .= $linkDownloadB .$l->getName($v->title, $v->filename) .$linkDownloadE;
$pdFile .= '</div>';
$pdFile .= PhocaDownloadRenderFront::displayNewIcon($v->date, $this->t['displaynew']);
$pdFile .= PhocaDownloadRenderFront::displayHotIcon($v->hits, $this->t['displayhot']);
// String Tags - title suffix
$tagsS = $l->displayTagsString($v->tags_string);
if ($tagsS != '') {
$pdFile .= '<div class="pd-float">'.$tagsS.'</div>';
}
// Tags - title suffix
if ($this->t['display_tags_links'] == 4 || $this->t['display_tags_links'] == 6) {
$tags = $l->displayTags($v->id, 1);
if ($tags != '') {
$pdFile .= '<div class="pd-float">'.$tags.'</div>';
}
}
// Specific icons
if (isset($v->image_filename_spec1) && $v->image_filename_spec1 != '') {
$pdFile .= '<div class="pd-float">'.$l->getImageDownload($v->image_filename_spec1).'</div>';
}
if (isset($v->image_filename_spec2) && $v->image_filename_spec2 != '') {
$pdFile .= '<div class="pd-float">'.$l->getImageDownload($v->image_filename_spec2).'</div>';
}
$pdFile .= '</div></div></div>' . "\n";
}
// pdbuttonplay
$pdButtonPlay = '';
if (isset($v->filename_play) && $v->filename_play != '') {
$fileExt = PhocaDownloadFile::getExtension($v->filename_play);
$canPlay = PhocaDownloadFile::canPlay($v->filename_play);
if ($canPlay) {
// Special height for music only
$buttonPlOptions = $this->t['buttonpl']->optionsB;
if ($fileExt == 'mp3' || $fileExt == 'ogg') {
$buttonPlOptions = $this->t['buttonpl']->optionsmp3B;
}
$playLink = JRoute::_(PhocaDownloadRoute::getFileRoute($v->id,$v->catid,$v->alias, $v->categoryalias,0, 'play').$this->t['limitstarturl']);
//$pdButtonPlay .= '<div class="pd-button-play">';
if ($this->t['play_popup_window'] == 1) {
$pdButtonPlay = '<a class="btn btn-danger" href="'.$playLink.'" onclick="'. $buttonPlOptions.'" >'. JText::_('COM_PHOCADOWNLOAD_PLAY').'</a>';
} else {
//$pdButtonPlay .= '<a class="btn btn-danger pd-modal-button" href="'.$playLink.'" rel="'. $buttonPlOptions.'" >'. JText::_('COM_PHOCADOWNLOAD_PLAY').'</a>';
$pdButtonPlay = '<a class="btn btn-danger pd-modal-button" data-toggle="modal" data-target="#phModalPlay" data-href="'.$playLink.'" '.$buttonPlOptions.' >'. JText::_('COM_PHOCADOWNLOAD_PLAY').'</a>';
}
//$pdButtonPlay .= '</div>';
}
}
// pdbuttonpreview
$pdButtonPreview = '';
if (isset($v->filename_preview) && $v->filename_preview != '') {
$fileExt = PhocaDownloadFile::getExtension($v->filename_preview);
if ($fileExt == 'pdf' || $fileExt == 'jpeg' || $fileExt == 'jpg' || $fileExt == 'png' || $fileExt == 'gif') {
$filePath = PhocaDownloadPath::getPathSet('filepreview');
$filePath = str_replace ( '../', JURI::base(true).'/', $filePath['orig_rel_ds']);
$previewLink = $filePath . $v->filename_preview;
//$pdButtonPreview .= '<div class="pd-button-preview">';
if ($this->t['preview_popup_window'] == 1) {
$pdButtonPreview .= '<a class="btn btn-warning" href="'.$previewLink.'" onclick="'. $this->t['buttonpr']->options.'" >'. JText::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
} else {
if ($fileExt == 'pdf') {
// Iframe - modal
//$pdButtonPreview .= '<a class="btn btn-warning pd-modal-button" href="'.$previewLink.'" rel="'. $this->t['buttonpr']->options.'" >'. JText::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
$pdButtonPreview = '<a class="btn btn-warning pd-modal-button" data-toggle="modal" data-target="#phModalPreview" data-href="'.$previewLink.'" '. $this->t['buttonpr']->optionsB.' >'. JText::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
} else {
// Image - modal
//$pdButtonPreview .= '<a class="btn btn-warning pd-modal-button" href="'.$previewLink.'" rel="'. $this->t['buttonpr']->optionsimg.'" >'. JText::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
$pdButtonPreview = '<a class="btn btn-warning pd-modal-button" data-toggle="modal" data-target="#phModalPreview" data-href="'.$previewLink.'" '. $this->t['buttonpr']->optionsimgB.' >'. JText::_('COM_PHOCADOWNLOAD_PREVIEW').'</a>';
}
}
//$pdButtonPreview .= '</div>';
}
}
// pdbuttondownload
//$pdButtonDownload = '<div class="pd-button-download">';
$pdButtonDownload = str_replace('class=""', 'class="btn btn-success"', $linkDownloadB) . JText::_('COM_PHOCADOWNLOAD_DOWNLOAD') .$linkDownloadE;
//$pdButtonDownload .= '</div>';
// pdbuttondetails
$d = '';
$pdTitle = '';
if ($v->title != '') {
$pdTitle .= '<div class="pd-title">'.$v->title.'</div>';
$d .= $pdTitle;
}
$pdImage = '';
if ($v->image_download != '') {
$pdImage .= '<div class="pd-image">'.$l->getImageDownload($v->image_download).'</div>';
$d .= $pdImage;
}
$pdFileSize = '';
$fileSize = $l->getFilesize($v->filename);
if ($fileSize != '') {
$pdFileSize .= '<div class="pd-filesize-txt">'.JText::_('COM_PHOCADOWNLOAD_FILESIZE').':</div>';
$pdFileSize .= '<div class="pd-fl-m">'.$fileSize.'</div>';
$d .= $pdFileSize;
}
$pdVersion = '';
if ($v->version != '') {
$pdVersion .= '<div class="pd-version-txt">'.JText::_('COM_PHOCADOWNLOAD_VERSION').':</div>';
$pdVersion .= '<div class="pd-fl-m">'.$v->version.'</div>';
$d .= $pdVersion;
}
$pdLicense = '';
if ($v->license != '') {
if ($v->license_url != '') {
$pdLicense .= '<div class="pd-license-txt">'.JText::_('COM_PHOCADOWNLOAD_LICENSE').':</div>';
$pdLicense .= '<div class="pd-fl-m"><a href="'.$v->license_url.'" target="_blank">'.$v->license.'</a></div>';
} else {
$pdLicense .= '<div class="pd-license-txt">'.JText::_('COM_PHOCADOWNLOAD_LICENSE').':</div>';
$pdLicense .= '<div class="pd-fl-m">'.$v->license.'</div>';
}
$d .= $pdLicense;
}
$pdAuthor = '';
if ($v->author != '') {
if ($v->author_url != '') {
$pdAuthor .= '<div class="pd-author-txt">'.JText::_('COM_PHOCADOWNLOAD_AUTHOR').':</div>';
$pdAuthor .= '<div class="pd-fl-m"><a href="'.$v->author_url.'" target="_blank">'.$v->author.'</a></div>';
} else {
$pdAuthor .= '<div class="pd-author-txt">'.JText::_('COM_PHOCADOWNLOAD_AUTHOR').':</div>';
$pdAuthor .= '<div class="pd-fl-m">'.$v->author.'</div>';
}
$d .= $pdAuthor;
}
$pdAuthorEmail = '';
if ($v->author_email != '') {
$pdAuthorEmail .= '<div class="pd-email-txt">'.JText::_('COM_PHOCADOWNLOAD_EMAIL').':</div>';
$pdAuthorEmail .= '<div class="pd-fl-m">'. $l->getProtectEmail($v->author_email).'</div>';
$d .= $pdAuthorEmail;
}
$pdFileDate = '';
$fileDate = $l->getFileDate($v->filename, $v->date);
if ($fileDate != '') {
$pdFileDate .= '<div class="pd-date-txt">'.JText::_('COM_PHOCADOWNLOAD_DATE').':</div>';
$pdFileDate .= '<div class="pd-fl-m">'.$fileDate.'</div>';
$d .= $pdFileDate;
}
$pdDownloads = '';
if ($this->t['display_downloads'] == 1) {
$pdDownloads .= '<div class="pd-downloads-txt">'.JText::_('COM_PHOCADOWNLOAD_DOWNLOADS').':</div>';
$pdDownloads .= '<div class="pd-fl-m">'.$v->hits.' x</div>';
$d .= $pdDownloads;
}
$pdDescription = '';
if ($l->isValueEditor($v->description) && $this->t['display_description'] != 1 & $this->t['display_description'] != 2 & $this->t['display_description'] != 3) {
$pdDescription .= '<div class="pd-fdesc">'.$v->description.'</div>';
$d .= $pdDescription;
}
$pdFeatures = '';
if ($l->isValueEditor($v->features)) {
$pdFeatures .= '<div class="pd-features-txt">'.JText::_('COM_PHOCADOWNLOAD_FEATURES').'</div>';
$pdFeatures .= '<div class="pd-features">'.$v->features.'</div>';
}
$pdChangelog = '';
if ($l->isValueEditor($v->changelog)) {
$pdChangelog .= '<div class="pd-changelog-txt">'.JText::_('COM_PHOCADOWNLOAD_CHANGELOG').'</div>';
$pdChangelog .= '<div class="pd-changelog">'.$v->changelog.'</div>';
}
$pdNotes = '';
if ($l->isValueEditor($v->notes)) {
$pdNotes .= '<div class="pd-notes-txt">'.JText::_('COM_PHOCADOWNLOAD_NOTES').'</div>';
$pdNotes .= '<div class="pd-notes">'.$v->notes.'</div>';
}
// pdfiledesc
$description = $l->isValueEditor($v->description);
$pdFileDescTop = '';
$pdFileDescBottom = '';
$oFileDesc = '';
if ($description) {
switch($this->t['display_description']) {
case 1:
$pdFileDescTop = '<div class="pd-fdesc">'.$v->description.'</div>';
break;
case 2:
$pdFileDescBottom = '<div class="pd-fdesc">'.$v->description.'</div>';
break;
case 3:
$oFileDesc = '<div class="pd-fdesc">'.$v->description.'</div>';
break;
case 4:
$pdFileDescTop = '<div class="pd-fdesc">'.$v->description.'</div>';
$oFileDesc = '<div class="pd-fdesc">'.PhocaDownloadUtils::strTrimAll($d).'</div>';
break;
case 5:
$pdFileDescBottom = '<div class="pd-fdesc">'.$v->description.'</div>';
$oFileDesc = '<div class="pd-fdesc">'.PhocaDownloadUtils::strTrimAll($d).'</div>';
break;
case 6:
$pdFileDescTop = '<div class="pd-fdesc">'.$d.'</div>';
$oFileDesc = '<div class="pd-fdesc">'.PhocaDownloadUtils::strTrimAll($d).'</div>';
break;
case 7:
$pdFileDescBottom = '<div class="pd-fdesc">'.$d.'</div>';
$oFileDesc = '<div class="pd-fdesc">'.PhocaDownloadUtils::strTrimAll($d).'</div>';
break;
case 8:
$oFileDesc = '<div class="pd-fdesc">'.PhocaDownloadUtils::strTrimAll($d).'</div>';
break;
default:
break;
}
}
// Detail Button
if ($this->t['display_detail'] == 1) {
if ($oFileDesc != '') {
$overlibcontent = $oFileDesc;
} else {
$overlibcontent = $d;
}
$overlibcontent = str_replace('"', '\'', $overlibcontent);
$sA = array(utf8_encode(chr(11)), utf8_encode(chr(160)));
$eA = array("\t", "\n", "\r", "\0");
$overlibcontent = str_replace($sA, ' ', $overlibcontent);
$overlibcontent = str_replace($eA, '', $overlibcontent);
$textO = htmlspecialchars(addslashes('<div style=\'text-align:left;padding:5px\'>'.$overlibcontent.'</div>'));
$overlib = "\n\n" ."onmouseover=\"return overlib('".$textO."', CAPTION, '".JText::_('COM_PHOCADOWNLOAD_DETAILS')."', BELOW, RIGHT, CSSCLASS, TEXTFONTCLASS, 'fontPhocaPDClass', FGCLASS, 'fgPhocaPDClass', BGCLASS, 'bgPhocaPDClass', CAPTIONFONTCLASS,'capfontPhocaPDClass', CLOSEFONTCLASS, 'capfontclosePhocaPDClass', STICKY, MOUSEOFF, CLOSETEXT, '".JText::_('COM_PHOCADOWNLOAD_CLOSE')."');\"";
$overlib .= " onmouseout=\"return nd();\"" . "\n";
//$pdButtonDetails = '<div class="pd-button-details">';
$pdButtonDetails = '<a class="btn btn-info" '.$overlib.' href="javascript:void(0)">'. JText::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
//$pdButtonDetails = '</div>';
} else if ($this->t['display_detail'] == 2) {
$detailLink = JRoute::_(PhocaDownloadRoute::getFileRoute($v->id, $this->catitem[$v->id]->id,$v->alias, $this->catitem[$v->id]->alias, 0, 'detail').$this->t['limitstarturl']);
//$pdButtonDetails = '<div class="pd-button-details">';
$pdButtonDetails = '<a class="btn btn-info pd-modal-button" data-toggle="modal" data-target="#phModalDetail" data-href="'.$detailLink.'" data-height="300px" data-width="auto">'. JText::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
//$pdButtonDetails .= '</div>';
} else if ($this->t['display_detail'] == 3) {
$detailLink = JRoute::_(PhocaDownloadRoute::getFileRoute($v->id, $this->catitem[$v->id]->id,$v->alias, $this->catitem[$v->id]->alias, 0, 'detail').$this->t['limitstarturl']);
//$pdButtonDetails = '<div class="pd-button-details">';
$buttonDOptions = $this->t['buttond']->options;
$pdButtonDetails = '<a class="btn btn-info pd-modal-button" href="'.$detailLink.'" onclick="'. $buttonDOptions.'">'. JText::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
//$pdButtonDetails .= '</div>';
} else {
$pdButtonDetails = '';
}
/// pdmirrorlink1
$pdMirrorLink1 = '';
$mirrorOutput1 = PhocaDownloadRenderFront::displayMirrorLinks(1, $v->mirror1link, $v->mirror1title, $v->mirror1target);
if ($mirrorOutput1 != '') {
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
$classMirror = '';//'pd-button-mirror1';
$mirrorOutput1 = str_replace('class=""', 'class="btn btn-primary "', $mirrorOutput1);
} else {
$classMirror = 'pd-mirror-bp';
}
$pdMirrorLink1 = '<div class="'.$classMirror.'">'.$mirrorOutput1.'</div>';
}
/// pdmirrorlink2
$pdMirrorLink2 = '';
$mirrorOutput2 = PhocaDownloadRenderFront::displayMirrorLinks(1, $v->mirror2link, $v->mirror2title, $v->mirror2target);
if ($mirrorOutput2 != '') {
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
$classMirror = '';//'pd-button-mirror2';
$mirrorOutput2 = str_replace('class=""', 'class="btn btn-primary "', $mirrorOutput2);
} else {
$classMirror = 'pd-mirror-bp';
}
$pdMirrorLink2 = '<div class="'.$classMirror.'">'.$mirrorOutput2.'</div>';
}
/// pdreportlink
$pdReportLink = PhocaDownloadRenderFront::displayReportLink(1, $v->title);
/// pdrating
$pdRating = PhocaDownloadRate::renderRateFile($v->id, $this->t['display_rating_file']);
/// pdtags
$pdTags = '';
if ($this->t['display_tags_links'] == 1 || $this->t['display_tags_links'] == 3) {
$tags2 = $l->displayTags($v->id);
if ($tags2 != '') {
$pdTags .= '<div class="pd-float">'.$tags2.'</div>';
}
}
/// pdvideo
$pdVideo = $l->displayVideo($v->video_filename, 0);
// ---------------------------------------------------
// Output
// ---------------------------------------------------
if ($v->textonly == 1) {
echo '<div class="row pd-row2-bp">';
echo '<div class="col-sm-12 col-md-12">';
echo $v->description;
echo '</div>';
echo '</div>';// end row
} else {
// ======= ROW 1 LEFT
echo '<div class="row ">';
if ($pdFileDescTop != '') {
echo '<div class="col-sm-12 col-md-12">';
echo $pdFileDescTop;
echo '</div>';
}
echo '<div class="col-sm-'.$this->t['bt_cat_col_left'].' col-md-'.$this->t['bt_cat_col_left'].'">';
echo $pdFile;
echo '</div>';
// ======= ROW 1 RIGHT
echo '<div class="col-sm-'.$this->t['bt_cat_col_right'].' col-md-'.$this->t['bt_cat_col_right'].'">';
echo '<div class="pd-button-box-bt">'.$pdButtonDownload . '</div>';
echo '<div class="pd-button-box-bt">'.$pdButtonDetails . '</div>';
echo '<div class="pd-button-box-bt">'.$pdButtonPreview . '</div>';
echo '<div class="pd-button-box-bt">'.$pdButtonPlay . '</div>';
echo '</div>';
echo '</div>';// end row
// ======== ROW 2 LEFT
echo '<div class="row pd-row2-bp">';
echo '<div class="col-sm-6 col-md-6">';
if ($pdVideo != '') {
echo '<div class="pd-video">'.$pdVideo.'</div>';
}
echo '<div class="pd-rating">'.$pdRating.'</div>';
echo '</div>';
// ======== ROW 2 RIGHT
echo '<div class="col-sm-6 col-md-6">';
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
if ($pdMirrorLink2 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink2.'</div>';
}
if ($pdMirrorLink1 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink1.'</div>';
}
} else if ($this->t['display_mirror_links'] == 1 || $this->t['display_mirror_links'] == 3) {
echo '<div class="pd-mirrors">'.$pdMirrorLink2.$pdMirrorLink1.'</div>';
}
if ($pdTags != '') {
echo '<div class="pd-tags-bp">'.$pdTags.'</div>';
}
if ($pdReportLink != '') {
echo '<div class="pd-report-bp">'.$pdReportLink.'</div>';
}
echo '</div>';
if ($pdFileDescBottom != '') {
echo '<div class="col-sm-12 col-md-12">';
echo $pdFileDescBottom;
echo '</div>';
}
echo '</div>';// end row
/*echo '<div class="pd-filebox">';
echo $pdFileDescTop;
echo $pdFile;
echo '<div class="pd-buttons">'.$pdButtonDownload.'</div>';
/*
if ($this->t['display_detail'] == 1 || $this->t['display_detail'] == 2) {
echo '<div class="pd-buttons">'.$pdButtonDetails.'</div>';
}
if ($this->t['display_preview'] == 1 && $pdButtonPreview != '') {
echo '<div class="pd-buttons">'.$pdButtonPreview.'</div>';
}
if ($this->t['display_play'] == 1 && $pdButtonPlay != '') {
echo '<div class="pd-buttons">'.$pdButtonPlay.'</div>';
}
if ($this->t['display_mirror_links'] == 4 || $this->t['display_mirror_links'] == 6) {
if ($pdMirrorLink2 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink2.'</div>';
}
if ($pdMirrorLink1 != '') {
echo '<div class="pd-buttons">'.$pdMirrorLink1.'</div>';
}
} else if ($this->t['display_mirror_links'] == 1 || $this->t['display_mirror_links'] == 3) {
echo '<div class="pd-mirrors">'.$pdMirrorLink2.$pdMirrorLink1.'</div>';
}
if ($pdVideo != '') {
echo '<div class="pd-video">'.$pdVideo.'</div>';
}
if ($pdReportLink != '') {
echo '<div class="pd-report">'.$pdReportLink.'</div>';
}
if ($pdRating != '') {
echo '<div class="pd-rating">'.$pdRating.'</div>';
}
if ($pdTags != '') {
echo '<div class="pd-tags">'.$pdTags.'</div>';
}
echo $pdFileDescBottom;
echo '<div class="pd-cb"></div>';
echo '</div>';*/
// ---------------------------------------------------
}
}
}
}
?>

View File

@ -0,0 +1,102 @@
<?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
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
$this->t['action'] = str_replace('&amp;', '&', $this->t['action']);
//$this->t['action'] = str_replace('&', '&amp;', $this->t['action']);
$this->t['action'] = htmlspecialchars($this->t['action']);
if ($this->t['p']->get('show_ordering_files') || $this->t['p']->get('show_pagination_limit') || $this->t['p']->get('show_pagination')) {
echo '<form action="'.$this->t['action'].'" method="post" name="adminForm">'. "\n";
if (count($this->files)) {
echo '<div class="pagination pagination-centered">';
if ($this->t['p']->get('show_ordering_files')) {
echo Text::_('COM_PHOCADOWNLOAD_ORDER_FRONT') .'&nbsp;'.$this->t['ordering'];
}
if ($this->t['p']->get('show_pagination_limit')) {
echo Text::_('COM_PHOCADOWNLOAD_DISPLAY_NUM') .'&nbsp;'.$this->t['pagination']->getLimitBox();
}
if ($this->t['p']->get('show_pagination')) {
echo '<div class="counter pull-right">'.$this->t['pagination']->getPagesCounter().'</div>'
.'<div class="pagination pagination-centered">'.$this->t['pagination']->getPagesLinks().'</div>';
}
echo '</div>'. "\n";
}
echo '<input type="hidden" name="controller" value="category" />';
echo HTMLHelper::_( 'form.token' );
echo '</form>';
echo '<div class="ph-cb pd-cv-paginaton">&nbsp;</div>';
} else {
echo '<div class="ph-cb pd-csv-paginaton">&nbsp;</div>';
}
/*
echo '<div class="pagination pagination-centered">';
if ($this->t['p']->get('show_ordering_files') || $this->t['p']->get('show_pagination_limit') || $this->t['p']->get('show_pagination')) {
echo '<div class="pginline">';
if ($this->t['p']->get('show_ordering_files')) {
echo Text::_('COM_PHOCADOWNLOAD_ORDER_FRONT') .'&nbsp;'.$this->t['ordering']. ' &nbsp;';
}
if ($this->t['p']->get('show_pagination_limit')) {
echo Text::_('COM_PHOCADOWNLOAD_DISPLAY_NUM') .'&nbsp;'
.$this->t['pagination']->getLimitBox() . ' &nbsp;';
}
if ($this->t['p']->get('show_pagination')) {
echo $this->t['pagination']->getPagesCounter();
}
echo '</div>';
}
if ($this->t['p']->get('show_pagination')) {
echo '<div style="margin:0 10px 0 10px;display:inline;" class="sectiontablefooter'.$this->t['p']->get( 'pageclass_sfx' ).'" id="pg-pagination" >'
.$this->t['pagination']->getPagesLinks()
.'</div>';
/*.'<div style="margin:0 10px 0 10px;display:inline;" class="pagecounter">'
.$this->t['pagination']->getPagesCounter()
.'</div>';*//*
}
echo '</div></div>'. "\n";
//echo '<input type="hidden" name="controller" value="category" />';
echo HTMLHelper::_( 'form.token' );
echo '</form>';
*/
?>