primo commit
This commit is contained in:
1
components/com_phocadownload/views/categories/index.html
Normal file
1
components/com_phocadownload/views/categories/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<view title="_COM_PHOCADOWNLOAD_CATEGORIES_GROUP">
|
||||
<message><![CDATA[_COM_PHOCADOWNLOAD_CATEGORIES_GROUP_DESC]]></message>
|
||||
</view>
|
||||
</metadata>
|
||||
215
components/com_phocadownload/views/categories/tmpl/default.php
Normal file
215
components/com_phocadownload/views/categories/tmpl/default.php
Normal 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"> / </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"> </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"> </div>';
|
||||
echo PhocaDownloadUtils::getInfo();
|
||||
?>
|
||||
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_PHOCADOWNLOAD_CATEGORIES_LIST_LAYOUT">
|
||||
<message>
|
||||
<![CDATA[COM_PHOCADOWNLOAD_CATEGORIES_LIST_LAYOUT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<name>COM_PHOCADOWNLOAD_CATEGORIES_LIST_LAYOUT</name>
|
||||
<description>COM_PHOCADOWNLOAD_CATEGORIES_LIST_LAYOUT_DESC</description>
|
||||
|
||||
<fields name="params">
|
||||
<fieldset name="basic" addfieldpath="/administrator/components/com_phocadownload/models/fields" >
|
||||
|
||||
|
||||
<field name="show_pagination" type="list" default="1" label="COM_PHOCADOWNLOAD_FIELD_SHOW_PAGINATION_LABEL" description="COM_PHOCADOWNLOAD_FIELD_SHOW_PAGINATION_DESC">
|
||||
<option value="0">COM_PHOCADOWNLOAD_HIDE</option>
|
||||
<option value="1">COM_PHOCADOWNLOAD_DISPLAY</option>
|
||||
</field>
|
||||
|
||||
<field name="show_pagination_limit" type="list" default="1" label="COM_PHOCADOWNLOAD_FIELD_SHOW_PAGINATION_LIMIT_LABEL" description="COM_PHOCADOWNLOAD_FIELD_SHOW_PAGINATION_LIMIT_DESC">
|
||||
<option value="0">COM_PHOCADOWNLOAD_HIDE</option>
|
||||
<option value="1">COM_PHOCADOWNLOAD_DISPLAY</option>
|
||||
</field>
|
||||
|
||||
<field name="show_ordering_files" type="list" default="1" label="COM_PHOCADOWNLOAD_FIELD_DISPLAY_ORDERING_CATEGORY_VIEW_LABEL" description="COM_PHOCADOWNLOAD_FIELD_DISPLAY_ORDERING_CATEGORY_VIEW_DESC">
|
||||
<option value="0">COM_PHOCADOWNLOAD_HIDE</option>
|
||||
<option value="1">COM_PHOCADOWNLOAD_DISPLAY</option>
|
||||
</field>
|
||||
|
||||
<field name="file_ordering" type="list" useglobal="true" label="COM_PHOCADOWNLOAD_FIELD_FILE_ORDERING_LABEL" description="COM_PHOCADOWNLOAD_FIELD_FILE_ORDERING_DESC">
|
||||
<option value="1">COM_PHOCADOWNLOAD_ORDERING_ASC</option>
|
||||
<option value="2">COM_PHOCADOWNLOAD_ORDERING_DESC</option>
|
||||
<option value="3">COM_PHOCADOWNLOAD_TITLE_ASC</option>
|
||||
<option value="4">COM_PHOCADOWNLOAD_TITLE_DESC</option>
|
||||
<option value="5">COM_PHOCADOWNLOAD_DATE_ASC</option>
|
||||
<option value="6">COM_PHOCADOWNLOAD_DATE_DESC</option>
|
||||
<option value="7">COM_PHOCADOWNLOAD_ID_ASC</option>
|
||||
<option value="8">COM_PHOCADOWNLOAD_ID_DESC</option>
|
||||
<option value="11">COM_PHOCADOWNLOAD_FILENAME_ASC</option>
|
||||
<option value="12">COM_PHOCADOWNLOAD_FILENAME_DESC</option>
|
||||
<option value="15">COM_PHOCADOWNLOAD_RATING_COUNT_ASC</option>
|
||||
<option value="16">COM_PHOCADOWNLOAD_RATING_COUNT_DESC</option>
|
||||
<option value="13">COM_PHOCADOWNLOAD_AVERAGE_ASC</option>
|
||||
<option value="14">COM_PHOCADOWNLOAD_AVERAGE_DESC</option>
|
||||
<option value="9">COM_PHOCADOWNLOAD_DOWNLOADS_ASC</option>
|
||||
<option value="10">COM_PHOCADOWNLOAD_DOWNLOADS_DESC</option>
|
||||
</field>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</fields>
|
||||
|
||||
</metadata>
|
||||
@ -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"> </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"> </div>';
|
||||
echo PhocaDownloadUtils::getInfo();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
153
components/com_phocadownload/views/categories/view.html.php
Normal file
153
components/com_phocadownload/views/categories/view.html.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla.Framework
|
||||
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @component Phoca Component
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Language\Text;
|
||||
jimport( 'joomla.application.component.view');
|
||||
|
||||
class PhocaDownloadViewCategories extends HtmlView
|
||||
{
|
||||
protected $t;
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$model = $this->getModel();
|
||||
$document = Factory::getDocument();
|
||||
$this->t['p'] = $app->getParams();
|
||||
$this->t['user'] = Factory::getUser();
|
||||
$this->t['categories'] = $model->getCategoriesList();
|
||||
$this->t['mostvieweddocs'] = $model->getMostViewedDocsList($this->t['p']);
|
||||
$this->t['dev'] = PhocaDownloadRenderFront::renderPhocaDownload();
|
||||
$this->t['displaynew'] = $this->t['p']->get( 'display_new', 0 );
|
||||
$this->t['displayhot'] = $this->t['p']->get( 'display_hot', 0 );
|
||||
$this->t['displaymostdownload'] = $this->t['p']->get( 'display_most_download', 1 );
|
||||
$this->t['displaynumdocsecs'] = $this->t['p']->get( 'display_num_doc_secs', 0 );
|
||||
$this->t['displaynumdocsecsheader'] = $this->t['p']->get( 'display_num_doc_secs_header', 1 );
|
||||
$this->t['file_icon_size_md'] = $this->t['p']->get( 'file_icon_size_md', 16 );
|
||||
$this->t['download_metakey'] = $this->t['p']->get( 'download_metakey', '' );
|
||||
$this->t['download_metadesc'] = $this->t['p']->get( 'download_metadesc', '' );
|
||||
$this->t['description'] = $this->t['p']->get( 'description', '' );
|
||||
$this->t['displaymaincatdesc'] = $this->t['p']->get( 'display_main_cat_desc', 0 );
|
||||
$this->t['display_specific_layout'] = $this->t['p']->get( 'display_specific_layout', 0 );
|
||||
$this->t['display_main_cat_subcategories'] = (int)$this->t['p']->get( 'display_main_cat_subcategories', 1 );
|
||||
|
||||
|
||||
|
||||
// Bootstrap 3 Layout
|
||||
/* $this->t['display_bootstrap3_layout'] = $this->t['p']->get( 'display_bootstrap3_layout', 0 );
|
||||
if ((int)$this->t['display_bootstrap3_layout'] > 0) {
|
||||
|
||||
HTMLHelper::_('jquery.framework', false);
|
||||
if ((int)$this->t['display_bootstrap3_layout'] == 2) {
|
||||
HTMLHelper::stylesheet('media/com_phocadownload/bootstrap/css/bootstrap.min.css' );
|
||||
HTMLHelper::stylesheet('media/com_phocadownload/bootstrap/css/bootstrap.extended.css' );
|
||||
// Loaded by jquery.framework;
|
||||
$document->addScript(Uri::root(true).'/media/com_phocadownload/bootstrap/js/bootstrap.min.js');
|
||||
}
|
||||
|
||||
/* $document->addScript(Uri::root(true).'/media/com_phocadownload/js/jquery.matchHeight.js');
|
||||
$document->addScriptDeclaration(
|
||||
'jQuery(window).load(function(){
|
||||
jQuery(\'.ph-thumbnail\').matchHeight();
|
||||
});');*/
|
||||
|
||||
/*$document->addScript(JUri::root(true).'/media/com_phocadownload/js/jquery.equalheights.min.js');
|
||||
$document->addScriptDeclaration(
|
||||
'jQuery(window).load(function(){
|
||||
jQuery(\'.ph-thumbnail\').equalHeights();
|
||||
});');*//*
|
||||
|
||||
}*/
|
||||
|
||||
PhocaDownloadRenderFront::renderMainJs();
|
||||
PhocaDownloadRenderFront::renderAllCSS();
|
||||
|
||||
$imagePath = PhocaDownloadPath::getPathSet('icon');
|
||||
|
||||
$this->t['cssimgpath'] = str_replace ( '../', Uri::base(true).'/', $imagePath['orig_rel_ds']);
|
||||
$filePath = PhocaDownloadPath::getPathSet('file');
|
||||
$this->t['absfilepath'] = $filePath['orig_abs_ds'];
|
||||
|
||||
$this->_prepareDocument();
|
||||
/*if ($this->t['display_bootstrap3_layout'] > 0) {
|
||||
parent::display('bootstrap');
|
||||
} else {
|
||||
parent::display($tpl);
|
||||
}*/
|
||||
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
protected function _prepareDocument() {
|
||||
|
||||
$app = Factory::getApplication();
|
||||
$menus = $app->getMenu();
|
||||
$menu = $menus->getActive();
|
||||
$pathway = $app->getPathway();
|
||||
$title = null;
|
||||
|
||||
$this->t['downloadmetakey'] = $this->t['p']->get( 'download_metakey', '' );
|
||||
$this->t['downloadmetadesc'] = $this->t['p']->get( 'download_metadesc', '' );
|
||||
|
||||
if ($menu) {
|
||||
$this->t['p']->def('page_heading', $this->t['p']->get('page_title', $menu->title));
|
||||
} else {
|
||||
$this->t['p']->def('page_heading', Text::_('JGLOBAL_ARTICLES'));
|
||||
}
|
||||
/*
|
||||
$title = $this->t['p']->get('page_heading', '');
|
||||
if (empty($title)) {
|
||||
$title = htmlspecialchars_decode($app->get('sitename'));
|
||||
} else if ($app->get('sitename_pagetitles', 0)) {
|
||||
$title = Text::sprintf('JPAGETITLE', htmlspecialchars_decode($app->get('sitename')), $title);
|
||||
}
|
||||
//$this->document->setTitle($title);
|
||||
|
||||
if (empty($title) || (isset($title) && $title == '')) {
|
||||
$title = $this->item->title;
|
||||
}
|
||||
$this->document->setTitle($title);*/
|
||||
|
||||
$title = $this->t['p']->get('page_title', '');
|
||||
if (empty($title)) {
|
||||
$title = htmlspecialchars_decode($app->get('sitename'));
|
||||
} else if ($app->get('sitename_pagetitles', 0) == 1) {
|
||||
$title = Text::sprintf('JPAGETITLE', htmlspecialchars_decode($app->get('sitename')), $title);
|
||||
} else if ($app->get('sitename_pagetitles', 0) == 2) {
|
||||
$title = Text::sprintf('JPAGETITLE', $title, htmlspecialchars_decode($app->get('sitename')));
|
||||
}
|
||||
$this->document->setTitle($title);
|
||||
|
||||
|
||||
|
||||
if ($this->t['downloadmetadesc'] != '') {
|
||||
$this->document->setDescription($this->t['downloadmetadesc']);
|
||||
} else if ($this->t['p']->get('menu-meta_description', '')) {
|
||||
$this->document->setDescription($this->t['p']->get('menu-meta_description', ''));
|
||||
}
|
||||
|
||||
if ($this->t['downloadmetakey'] != '') {
|
||||
$this->document->setMetadata('keywords', $this->t['downloadmetakey']);
|
||||
} else if ($this->t['p']->get('menu-meta_keywords', '')) {
|
||||
$this->document->setMetadata('keywords', $this->t['p']->get('menu-meta_keywords', ''));
|
||||
}
|
||||
|
||||
if ($app->get('MetaTitle') == '1' && $this->t['p']->get('menupage_title', '')) {
|
||||
$this->document->setMetaData('title', $this->t['p']->get('page_title', ''));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user