primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1,37 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
jimport('joomla.application.component.controller');
class PhocaGalleryController extends BaseController
{
public function display($cachable = false, $urlparams = false)
{
$paramsC = ComponentHelper::getParams('com_phocagallery');
$cache = $paramsC->get( 'enable_cache', 0 );
$cachable = false;
if ($cache == 1) {
$cachable = true;
}
$document = Factory::getDocument();
$safeurlparams = array('catid'=>'INT','id'=>'INT','cid'=>'ARRAY','year'=>'INT','month'=>'INT','limit'=>'INT','limitstart'=>'INT',
'showall'=>'INT','return'=>'BASE64','filter'=>'STRING','filter_order'=>'CMD','filter_order_Dir'=>'CMD','filter-search'=>'STRING','print'=>'BOOLEAN','lang'=>'CMD');
parent::display($cachable,$safeurlparams);
return $this;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,118 @@
<?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();
use Joomla\CMS\Factory;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
phocagalleryimport('phocagallery.access.access');
phocagalleryimport('phocagallery.comment.comment');
phocagalleryimport('phocagallery.comment.commentimage');
class PhocaGalleryControllerComment extends PhocaGalleryController
{
function display($cachable = false, $urlparams = false) {
if ( ! Factory::getApplication()->input->get('view') ) {
Factory::getApplication()->input->set('view', 'comment' );
}
parent::display($cachable, $urlparams);
}
function comment() {
Session::checkToken() or jexit( 'Invalid Token' );
phocagalleryimport('phocagallery.comment.comment');
phocagalleryimport('phocagallery.comment.commentimage');
$app = Factory::getApplication();
$user = Factory::getUser();
$view = $this->input->get('view', '', 'string');
$catid = $this->input->get('catid', '', 'string');
$id = $this->input->get('id', '', 'string' );
$post['title'] = $this->input->get('phocagallerycommentstitle', '', 'string');
$post['comment'] = $this->input->get('phocagallerycommentseditor', '', 'string');
$Itemid = $this->input->get('Itemid', 0, 'int');
$limitStart = $this->input->get('limitstart', 0, 'int');
$tab = $this->input->get('tab', 0, 'int' );
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
$params = $app->getParams();
$detailWindow = $params->get( 'detail_window', 0 );
$maxCommentChar = $params->get( 'max_comment_char', 1000 );
$displayCommentNoPopup = $params->get( 'display_comment_nopup', 0);
// Maximum of character, they will be saved in database
$post['comment'] = substr($post['comment'], 0, (int)$maxCommentChar);
if ($detailWindow == 7 || $displayCommentNoPopup == 1) {
$tCom = '';
} else {
$tCom = '&tmpl=component';
}
// Close Tags
$post['comment'] = PhocaGalleryComment::closeTags($post['comment'], '[u]', '[/u]');
$post['comment'] = PhocaGalleryComment::closeTags($post['comment'], '[i]', '[/i]');
$post['comment'] = PhocaGalleryComment::closeTags($post['comment'], '[b]', '[/b]');
$post['imgid'] = (int)$id;
$post['userid'] = $user->id;
$catidAlias = $catid;
$imgidAlias = $id;
if ($view != 'comment') {
$this->setRedirect( Route::_('index.php?option=com_phocagallery', false) );
}
$model = $this->getModel('comment');
$checkUserComment = PhocaGalleryCommentImage::checkUserComment( $post['imgid'], $post['userid'] );
// User has already submitted a comment
if ($checkUserComment) {
$msg = Text::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED');
} else {
// If javascript will not protect the empty form
$msg = '';
$emptyForm = 0;
if ($post['title'] == '') {
$msg .= Text::_('COM_PHOCAGALLERY_ERROR_COMMENT_TITLE') . ' ';
$emtyForm = 1;
}
if ($post['comment'] == '') {
$msg .= Text::_('COM_PHOCAGALLERY_ERROR_COMMENT_COMMENT');
$emtyForm = 1;
}
if ($emptyForm == 0) {
if ($access > 0 && $user->id > 0) {
if(!$model->comment($post)) {
$msg = Text::_('COM_PHOCAGALLERY_ERROR_COMMENT_SUBMITTING');
} else {
$msg = Text::_('COM_PHOCAGALLERY_SUCCESS_COMMENT_SUBMIT');
// Features by Bernard Gilly - alphaplug.com
// load external plugins
//$dispatcher = JDispatcher::getInstance();
PluginHelper::importPlugin('phocagallery');
$results = Factory::getApplication()->triggerEvent('onCommentImage', array($id, $catid, $post['title'], $post['comment'], $user->id ) );
}
} else {
$app->enqueueMessage(Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
$app->redirect(Route::_('index.php?option=com_users&view=login', false));
exit;
}
}
}
$app->enqueueMessage($msg);
$this->setRedirect( Route::_('index.php?option=com_phocagallery&view=detail&catid='.$catidAlias.'&id='.$imgidAlias.$tCom.'&Itemid='. $Itemid, false));
}
}
?>

View File

@ -0,0 +1,187 @@
<?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();
use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Session\Session;
phocagalleryimport('phocagallery.access.access');
phocagalleryimport('phocagallery.rate.rateimage');
class PhocaGalleryControllerDetail extends PhocaGalleryController
{
function display($cachable = false, $urlparams = false) {
if ( ! Factory::getApplication()->input->get('view') ) {
Factory::getApplication()->input->set('view', 'detail' );
}
parent::display($cachable, $urlparams);
}
function rate() {
$app = Factory::getApplication();
$params = $app->getParams();
$detailWindow = $params->get( 'detail_window', 0 );
$user = Factory::getUser();
$view = $this->input->get( 'view', '', 'string' );
$imgid = $this->input->get( 'id', '', 'string' );
$catid = $this->input->get( 'catid', '', 'string' );
$rating = $this->input->get( 'rating', '', 'string' );
$Itemid = $this->input->get( 'Itemid', 0, 'int');
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
if ($detailWindow == 7) {
$tCom = '';
} else {
$tCom = '&tmpl=component';
}
$post['imgid'] = (int)$imgid;
$post['userid'] = $user->id;
$post['rating'] = (int)$rating;
$imgIdAlias = $imgid;
$catIdAlias = $catid; //Itemid
if ($view != 'detail') {
$this->setRedirect( Route::_('index.php?option=com_phocagallery', false) );
}
$model = $this->getModel('detail');
$checkUserVote = PhocaGalleryRateImage::checkUserVote( $post['imgid'], $post['userid'] );
// User has already rated this category
if ($checkUserVote) {
$msg = Text::_('COM_PHOCAGALLERY_RATING_IMAGE_ALREADY_RATED');
} else {
if ((int)$post['rating'] < 1 || (int)$post['rating'] > 5) {
$app->redirect( Route::_('index.php?option=com_phocagallery', false) );
exit;
}
if ($access > 0 && $user->id > 0) {
if(!$model->rate($post)) {
$msg = Text::_('COM_PHOCAGALLERY_ERROR_RATING_IMAGE');
} else {
$msg = Text::_('COM_PHOCAGALLERY_SUCCESS_RATING_IMAGE');
// Features added by Bernard Gilly - alphaplug.com
// load external plugins
//$dispatcher = JDispatcher::getInstance();
PluginHelper::importPlugin('phocagallery');
$results = Factory::getApplication()->triggerEvent('onVoteImage', array($imgid, $rating, $user->id ) );
}
} else {
$app->enqueueMessage(Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'), 'error');
$app->redirect(Route::_('index.php?option=com_users&view=login', false));
exit;
}
}
// Do not display System Message in Detail Window as there are no scrollbars, so other items will be not displayed
// we send infor about already rated via get and this get will be worked in view (detail - default.php) - vote=1
$msg = '';
//$this->setRedirect( JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$catIdAlias.'&id='.$imgIdAlias.$tCom.'&vote=1&Itemid='. $Itemid, false), $msg );
$this->setRedirect( Route::_('index.php?option=com_phocagallery&view=detail&catid='.$catIdAlias.'&id='.$imgIdAlias.$tCom.'&vote=1&Itemid='. $Itemid, false) );
}
function comment() {
Session::checkToken() or jexit( 'Invalid Token' );
phocagalleryimport('phocagallery.comment.comment');
phocagalleryimport('phocagallery.comment.commentimage');
$app = Factory::getApplication();
$user = Factory::getUser();
$view = $this->input->get('view', '', 'string');
$catid = $this->input->get('catid', '', 'string');
$id = $this->input->get('id', '', 'string' );
$post['title'] = $this->input->get('phocagallerycommentstitle', '', 'string');
$post['comment'] = $this->input->get('phocagallerycommentseditor', '', 'string');
$Itemid = $this->input->get('Itemid', 0, 'int');
$limitStart = $this->input->get('limitstart', 0, 'int');
$tab = $this->input->get('tab', 0, 'int' );
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
$params = $app->getParams();
$detailWindow = $params->get( 'detail_window', 0 );
$maxCommentChar = $params->get( 'max_comment_char', 1000 );
$displayCommentNoPopup = $params->get( 'display_comment_nopup', 0);
// Maximum of character, they will be saved in database
$post['comment'] = substr($post['comment'], 0, (int)$maxCommentChar);
if ($detailWindow == 7 || $displayCommentNoPopup == 1) {
$tCom = '';
} else {
$tCom = '&tmpl=component';
}
// Close Tags
$post['comment'] = PhocaGalleryComment::closeTags($post['comment'], '[u]', '[/u]');
$post['comment'] = PhocaGalleryComment::closeTags($post['comment'], '[i]', '[/i]');
$post['comment'] = PhocaGalleryComment::closeTags($post['comment'], '[b]', '[/b]');
$post['imgid'] = (int)$id;
$post['userid'] = $user->id;
$catidAlias = $catid;
$imgidAlias = $id;
if ($view != 'comment') {
$this->setRedirect( Route::_('index.php?option=com_phocagallery', false) );
}
$model = $this->getModel('detail');
$checkUserComment = PhocaGalleryCommentImage::checkUserComment( $post['imgid'], $post['userid'] );
// User has already submitted a comment
if ($checkUserComment) {
$msg = Text::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED');
} else {
// If javascript will not protect the empty form
$msg = '';
$emptyForm = 0;
if ($post['title'] == '') {
$msg .= Text::_('COM_PHOCAGALLERY_ERROR_COMMENT_TITLE') . ' ';
$emtyForm = 1;
}
if ($post['comment'] == '') {
$msg .= Text::_('COM_PHOCAGALLERY_ERROR_COMMENT_COMMENT');
$emtyForm = 1;
}
if ($emptyForm == 0) {
if ($access > 0 && $user->id > 0) {
if(!$model->comment($post)) {
$msg = Text::_('COM_PHOCAGALLERY_ERROR_COMMENT_SUBMITTING');
} else {
$msg = Text::_('COM_PHOCAGALLERY_SUCCESS_COMMENT_SUBMIT');
// Features by Bernard Gilly - alphaplug.com
// load external plugins
//$dispatcher = JDispatcher::getInstance();
PluginHelper::importPlugin('phocagallery');
$results = Factory::getApplication()->triggerEvent('onCommentImage', array($id, $catid, $post['title'], $post['comment'], $user->id ) );
}
} else {
$app->enqueueMessage(Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
$app->redirect(Route::_('index.php?option=com_users&view=login', false));
exit;
}
}
}
$app->enqueueMessage($msg);
$this->setRedirect( Route::_('index.php?option=com_phocagallery&view=detail&catid='.$catidAlias.'&id='.$imgidAlias.$tCom.'&Itemid='. $Itemid, false));
}
}
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,354 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Component\Router\Rules\RulesInterface;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
class PhocagalleryRouterRulesLegacy implements RulesInterface
{
public function __construct($router)
{
$this->router = $router;
}
public function preprocess(&$query)
{
}
public function build(&$query, &$segments)
{
// Get a menu item based on Itemid or currently active
$params = ComponentHelper::getParams('com_phocagallery');
$advanced = $params->get('sef_advanced_link', 0);
if (empty($query['Itemid']))
{
$menuItem = $this->router->menu->getActive();
}
else
{
$menuItem = $this->router->menu->getItem($query['Itemid']);
}
$mView = empty($menuItem->query['view']) ? null : $menuItem->query['view'];
$mId = empty($menuItem->query['id']) ? null : $menuItem->query['id'];
if (isset($query['view']))
{
$view = $query['view'];
if (empty($menuItem) || $menuItem->component !== 'com_phocagallery' || empty($query['Itemid']))
{
$segments[] = $query['view'];
}
unset($query['view']);
}
// Are we dealing with a view that is attached to a menu item?
if (isset($query['view'], $query['id']) && $mView == $query['view'] && $mId == (int) $query['id'])
{
unset($query['view'], $query['catid'], $query['id']);
return;
}
if (isset($view) && ($view === 'category' || $view === 'detail'))
{
if ($mId != (int) $query['id'] || $mView != $view)
{
if ($view === 'detail' && isset($query['catid']))
{
$catid = $query['catid'];
}
elseif (isset($query['id']))
{
$catid = $query['id'];
}
$menuCatid = $mId;
$category = PhocaGalleryCategory::getCategoryById($catid);
if (isset($category->id)) {
$path = PhocaGalleryCategory::getPath(array(), (int)$category->id, $category->parent_id, $category->title, $category->alias);
}
if (!empty($path)) {
$path = array_reverse($path, true);
$array = array();
foreach ($path as $id)
{
if ((int) $id === (int) $menuCatid)
{
break;
}
if ($advanced)
{
list($tmp, $id) = explode(':', $id, 2);
}
$array[] = $id;
}
$segments = array_merge($segments, $array);
}
/*$categories = JCategories::getInstance('Newsfeeds');
$category = $categories->get($catid);*/
//$path = PhocaGalleryCategory::getPath(array(), (int)$catid);
/*if ($category)
{
$path = $category->getPath();
$path = array_reverse($path);
$array = array();
foreach ($path as $id)
{
if ((int) $id === (int) $menuCatid)
{
break;
}
if ($advanced)
{
list($tmp, $id) = explode(':', $id, 2);
}
$array[] = $id;
}
$segments = array_merge($segments, array_reverse($array));
}*/
/* if ($view === 'category')
{
if ($advanced)
{
list($tmp, $id) = explode(':', $query['id'], 2);
}
else
{
$id = $query['id'];
}
$segments[] = $id;
}*/
if ($view === 'detail')
{
if ($advanced)
{
list($tmp, $id) = explode(':', $query['id'], 2);
}
else
{
$id = $query['id'];
}
$segments[] = $id;
}
}
unset($query['id'], $query['catid']);
}
if (isset($query['layout']))
{
if (!empty($query['Itemid']) && isset($menuItem->query['layout']))
{
if ($query['layout'] == $menuItem->query['layout'])
{
unset($query['layout']);
}
}
else
{
if ($query['layout'] === 'default')
{
unset($query['layout']);
}
}
}
$total = count($segments);
for ($i = 0; $i < $total; $i++)
{
$segments[$i] = str_replace(':', '-', $segments[$i]);
}
}
public function parse(&$segments, &$vars)
{
$total = count($segments);
for ($i = 0; $i < $total; $i++)
{
$segments[$i] = preg_replace('/-/', ':', $segments[$i], 1);
}
// Get the active menu item.
$item = $this->router->menu->getActive();
$params = ComponentHelper::getParams('com_phocagallery');
$advanced = $params->get('sef_advanced_link', 0);
// Count route segments
$count = count($segments);
// Standard routing for newsfeeds.
if (!isset($item))
{
$vars['view'] = $segments[0];
$vars['id'] = $segments[$count - 1];
return;
}
// From the categories view, we can only jump to a category.
$id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : '';
//$categories = JCategories::getInstance('Newsfeeds')->get($id)->getChildren();
$vars['catid'] = $id;
$vars['id'] = $id;
$found = 0;
$categories = [];
$categories[0] = new stdClass();
$categories[0]->slug = '1:architecture';
$categories[0]->alias = 'architecture';
$categories[0]->id = '1';
$newCategories = [];
$newCategories[0] = new stdClass();
$newCategories[0]->slug = '3:tri';
$newCategories[0]->alias = 'tri';
$newCategories[0]->id = '3';
$newCategories[1] = new stdClass();
$newCategories[1]->slug = '2:autumn';
$newCategories[1]->alias = 'autumn';
$newCategories[1]->id = '2';
/*$newCategories[1] = new stdClass();
$newCategories[1]->slug = '4:ctyri';
$newCategories[1]->alias = 'ctyri';
$newCategories[1]->id = '4';*/
foreach ($segments as $segment) {
foreach ($categories as $category) {
if (($category->slug == $segment) || ($advanced && $category->alias == str_replace(':', '-', $segment))) {
$vars['id'] = $category->id;
$vars['view'] = 'calendar';
$categories = $newCategories;
$found = 1;
break;
}
}
if ($found == 0)
{
echo "not found";
}
}
exit;
foreach ($segments as $segment)
{
$segment = $advanced ? str_replace(':', '-', $segment) : $segment;
/*foreach ($categories as $category)
{
if ($category->slug == $segment || $category->alias == $segment)
{
$vars['id'] = $category->id;
$vars['catid'] = $category->id;
$vars['view'] = 'category';
$categories = $category->getChildren();
$found = 1;
break;
}
}*/
if ($found == 0)
{
if ($advanced)
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from('#__newsfeeds')
->where($db->quoteName('catid') . ' = ' . (int) $vars['catid'])
->where($db->quoteName('alias') . ' = ' . $db->quote($segment));
$db->setQuery($query);
$nid = $db->loadResult();
}
else
{
$nid = $segment;
}
$vars['id'] = $nid;
$vars['view'] = 'category';
}
$found = 0;
}
unset($segments[0]);
//unset($vars['catid']);
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,31 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die('Restricted access');
$d = $displayData;
$item = $d['item'];
$t = $d['t'];
// Make SVG image the same responsive like the standard images - get the same ratio like images for the box and have the max width of the images
$styleDiv = ' style="max-width:'.$t['medium_image_width'].'px;aspect-ratio: '.(int)$t['medium_image_width'].'/'.(int)$t['medium_image_height']. '"';
$styleSVG = ' style="width:100%;height:100%"';
echo '<a class="'.$item->button->methodname.'" href="'. $item->link.'">';
echo '<div class="pg-item-box-image pg-svg-box"'.$styleDiv.'>';
if (isset($item->rightdisplaykey) && $item->rightdisplaykey == 0) {
echo '<svg alt="'.$item->altvalue.'" class="ph-si ph-si-lock-medium pg-image c-Image c-Image--shaded"'.$styleSVG.' itemprop="thumbnail"><use xlink:href="#ph-si-lock"></use></svg>';
} else {
echo '<svg alt="'.$item->altvalue.'" class="ph-si ph-si-back-medium pg-image c-Image c-Image--shaded"'.$styleSVG.' itemprop="thumbnail"><use xlink:href="#ph-si-back"></use></svg>';
}
echo '</div>';
echo '</a>';

View File

@ -0,0 +1,59 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die('Restricted access');
$d = $displayData;
$item = $d['item'];
$t = $d['t'];
// Make SVG image the same responsive like the standard images - get the same ratio like images for the box and have the max width of the images
$styleDiv = ' style="max-width:'.$t['medium_image_width'].'px;aspect-ratio: '.(int)$t['medium_image_width'].'/'.(int)$t['medium_image_height']. '"';
$styleSVG = ' style="width:100%;height:100%"';
echo '<a class="'.$item->button->methodname.'" href="'. $item->link.'">';
if ($item->linkthumbnailpath != false || (isset($item->extid) && (int)$item->extid > 0)) {
echo '<div class="pg-item-box-image pg-svg-box">';
echo HTMLHelper::_( 'image', isset($item->extid) & (int)$item->extid > 0 ? $item->extm : $item->linkthumbnailpath, $item->altvalue, array( 'class' => 'pg-image c-Image c-Image--shaded', 'itemprop' => "thumbnail"));
echo '</div>';
echo '</a>';
} else {
echo '<div class="pg-item-box-image pg-svg-box"'.$styleDiv.'">';
// style="width:'.$t['medium_image_width'].'px;height:'.$t['medium_image_height'].'px"
if (isset($item->rightdisplaykey) && $item->rightdisplaykey == 0) {
echo '<svg alt="'.$item->altvalue.'" class="ph-si ph-si-lock-medium pg-image c-Image c-Image--shaded"'.$styleSVG.' itemprop="thumbnail"><use xlink:href="#ph-si-lock"></use></svg>';
} else {
echo '<svg alt="'.$item->altvalue.'" class="ph-si ph-si-category-medium pg-image c-Image c-Image--shaded"'.$styleSVG.' itemprop="thumbnail"><use xlink:href="#ph-si-category"></use></svg>';
}
echo '</div>';
echo '</a>';
}
/*
echo '<div class="pg-item-box-image">';
echo HTMLHelper::_( 'image', isset($item->extid) & (int)$item->extid> 0 ? $item->extm : $item->linkthumbnailpath, $item->altvalue, array( 'class' => 'pg-image c-Image c-Image--shaded', 'itemprop' => "thumbnail"));
echo '</div>';
*/

View File

@ -0,0 +1,42 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die('Restricted access');
$d = $displayData;
$item = $d['item'];
$t = $d['t'];
echo '<a class="'.$item->class.'" href="'. $item->link.'" data-img-title="'.$item->title.'" id="pgImg'.$item->id.'"';
if (isset($item->onclick) && $item->onclick != '') {
echo ' onclick="'.$item->onclick.'"';
}
if (isset($item->itemprop) && $item->itemprop != '') {
echo ' itemprop="'.$item->itemprop.'"';
}
if (isset($item->datasize)) { echo ' '. $item->datasize;}
if (isset($item->videocode) && $item->videocode != '' && $item->videocode != '0') {
echo ' data-type="video" data-video="<div class=\'ph-pswp-wrapper\'><div class=\'ph-pswp-video-wrapper\'>' . str_replace('"', "'", PhocaGalleryYoutube::displayVideo($item->videocode)) . '</div></div>"';
}
echo ' >';
echo '<div class="pg-item-box-image">';
echo HTMLHelper::_( 'image', isset($item->extid) & $item->extid != '' ? $item->extm : $item->linkthumbnailpath, $item->oimgalt, array( 'class' => 'pg-image c-Image c-Image--shaded', 'itemprop' => "thumbnail"));
echo '</div>';
echo '</a>';

View File

@ -0,0 +1,34 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die('Restricted access');
$d = $displayData;
$t = $d['t'];
// we need to change the title dynamically when iframe loads new image - with help of function pgFrameOnLoad() (in main.js)
?><div class="modal fade" id="pgCategoryModal" tabindex="-1" aria-labelledby="pgCategoryModal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="pgCategoryModalLabel"><?php echo Text::_('COM_PHOCAGALLERY_TITLE') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?php echo Text::_('COM_PHOCAGALLERY_CLOSE') ?>"></button>
</div>
<div class="modal-body">
<iframe id="pgCategoryModalIframe" height="100%" frameborder="0" onload="pgFrameOnLoad()"></iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_PHOCAGALLERY_CLOSE') ?></button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,119 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die('Restricted access');
$d = $displayData;
$t = $d['t'];
echo '<div id="phocagallery-comments">'. "\n";
if (!empty($t['commentitem'])){
$smileys = PhocaGalleryComment::getSmileys();
foreach ($t['commentitem'] as $v) {
$date = HTMLHelper::_('date', $v->date, Text::_('DATE_FORMAT_LC2') );
$comment = $v->comment;
$comment = PhocaGalleryComment::bbCodeReplace($comment);
foreach ($smileys as $smileyKey => $smileyValue) {
$comment = str_replace($smileyKey, $smileyValue, $comment);
}
echo '<blockquote>'
.'<h4><svg class="ph-si ph-si-user"><use xlink:href="#ph-si-user"></use></svg>'.$v->name.'</h4>'
.'<p><strong>'.PhocaGalleryText::wordDelete($v->title, 50, '...').'</strong></p>'
.'<p>'.$comment.'</p>'
.'<p style="text-align:right"><small>'.$date.'</small></p>'
.'</blockquote>';
}
}
echo '<h4>'.Text::_('COM_PHOCAGALLERY_ADD_COMMENT').'</h4>';
if ($t['already_commented']) {
echo '<p>'.Text::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED').'</p>';
} else if ($t['not_registered']) {
echo '<p>'.Text::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_SUBMIT_COMMENT').'</p>';
} else {
?>
<form action="<?php echo htmlspecialchars($t['action']);?>" name="phocagallerycommentsform" id="phocagallery-comments-form" method="post" >
<table>
<tr>
<td><?php echo Text::_('COM_PHOCAGALLERY_NAME');?>:</td>
<td><?php echo $t['name']; ?></td>
</tr>
<tr>
<td><?php echo Text::_('COM_PHOCAGALLERY_TITLE');?>:</td>
<td><input type="text" name="phocagallerycommentstitle" id="phocagallery-comments-title" value="" maxlength="255" class="form-control comment-input" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<a class="pg-comment-btn pg-b" href="#" onclick="pgPasteTag('b', true); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_BOLD') ?>">B</a>
<a class="pg-comment-btn pg-i" href="#" onclick="pgPasteTag('i', true); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_ITALIC') ?>">I</a>
<a class="pg-comment-btn pg-u" href="#" onclick="pgPasteTag('u', true); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_UNDERLINE') ?>">U</a>
<a class="pg-comment-btn" href="#" onclick="pgPasteSmiley(':)'); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_SMILE') ?>">&#x1F642</a>
<a class="pg-comment-btn" href="#" onclick="pgPasteSmiley(':lol:'); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_LOL') ?>">&#x1F604</a>
<a class="pg-comment-btn" href="#" onclick="pgPasteSmiley(':('); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_SAD') ?>">&#x2639</a>
<a class="pg-comment-btn" href="#" onclick="pgPasteSmiley(':?'); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_CONFUSED') ?>">&#x1F615</a>
<a class="pg-comment-btn" href="#" onclick="pgPasteSmiley(':wink:'); return false;" title="<?php echo Text::_('COM_PHOCAGALLERY_WINK') ?>">&#x1F609</a>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<textarea name="phocagallerycommentseditor" id="phocagallery-comments-editor" cols="30" rows="10" class= "form-control comment-input" onkeyup="pgCountChars(<?php echo $t['max_comment_char'];?>);" ></textarea>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><?php echo Text::_('COM_PHOCAGALLERY_CHARACTERS_WRITTEN');?> <input name="phocagallerycommentscountin" value="0" readonly="readonly" class="form-control comment-input2" /> <?php echo Text::_('COM_PHOCAGALLERY_AND_LEFT_FOR_COMMENT');?> <input name="phocagallerycommentscountleft" value="<?php echo $t['max_comment_char'];?>" readonly="readonly" class="form-control comment-input2" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right">
<input class="btn btn-primary" type="submit" id="phocagallerycommentssubmit" onclick="return(pgCheckCommentsForm());" value="<?php echo Text::_('COM_PHOCAGALLERY_SUBMIT_COMMENT'); ?>"/>
</td>
</tr>
</table>
<?php
echo '<input type="hidden" name="task" value="'.$d['form']['task'].'" />';
echo '<input type="hidden" name="view" value="'.$d['form']['view'].'" />';
echo '<input type="hidden" name="controller" value="'.$d['form']['controller'].'" />';
echo '<input type="hidden" name="tab" value="'.$d['form']['tab'].'" />';
echo '<input type="hidden" name="id" value="'. $d['form']['id'].'" />';
echo '<input type="hidden" name="catid" value="'. $d['form']['catid'].'" />';
echo '<input type="hidden" name="Itemid" value="'. $d['form']['itemid'] .'" />';
echo HTMLHelper::_( 'form.token' );
echo '</form>';
}
echo '</div>'. "\n";
?>

View File

@ -0,0 +1,130 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
?><svg aria-hidden="true" class="ph-sr-only" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="ph-si-feed" viewBox="0 0 512 512">
<path d="M108.56 342.78a60.34 60.34 0 1060.56 60.44 60.63 60.63 0 00-60.56-60.44z" />
<path d="M48 186.67v86.55c52 0 101.94 15.39 138.67 52.11s52 86.56 52 138.67h86.66c0-151.56-125.66-277.33-277.33-277.33z" />
<path d="M48 48v86.56c185.25 0 329.22 144.08 329.22 329.44H464C464 234.66 277.67 48 48 48z" />
</symbol>
<symbol id="ph-si-category" viewBox="0 0 512 512">
<path d="M72 64c-30.928 0-56 25.072-56 56v272c0 30.928 25.072 56 56 56h368c30.928 0 56-25.072 56-56V152c0-30.928-25.072-56-56-56H220.11a23.885 23.885 0 01-13.31-4L179 73.41A55.768 55.768 0 00147.89 64H72z" />
</symbol>
<symbol id="ph-si-back" viewBox="0 0 512 512">
<path d="M48 256c0 114.87 93.13 208 208 208s208-93.13 208-208S370.87 48 256 48 48 141.13 48 256zm212.65-91.36a16 16 0 01.09 22.63L208.42 240H342a16 16 0 010 32H208.42l52.32 52.73A16 16 0 11238 347.27l-79.39-80a16 16 0 010-22.54l79.39-80a16 16 0 0122.65-.09z" />
</symbol>
<symbol id="ph-si-prev" viewBox="0 0 512 512">
<path d="M48 256c0 114.87 93.13 208 208 208s208-93.13 208-208S370.87 48 256 48 48 141.13 48 256zm212.65-91.36a16 16 0 01.09 22.63L208.42 240H342a16 16 0 010 32H208.42l52.32 52.73A16 16 0 11238 347.27l-79.39-80a16 16 0 010-22.54l79.39-80a16 16 0 0122.65-.09z" />
</symbol>
<symbol id="ph-si-next" viewBox="0 0 512 512">
<path d="M464 256c0-114.87-93.13-208-208-208S48 141.13 48 256s93.13 208 208 208 208-93.13 208-208zm-212.65 91.36a16 16 0 01-.09-22.63L303.58 272H170a16 16 0 010-32h133.58l-52.32-52.73A16 16 0 11274 164.73l79.39 80a16 16 0 010 22.54l-79.39 80a16 16 0 01-22.65.09z"/>
</symbol>
<symbol id="ph-si-image" viewBox="0 0 512 512">
<ellipse cx="373.14" cy="219.33" rx="46.29" ry="46" fill="none" />
<path d="M80 132v328a20 20 0 0020 20h392a20 20 0 0020-20V132a20 20 0 00-20-20H100a20 20 0 00-20 20zm293.14 41.33a46 46 0 11-46.28 46 46.19 46.19 0 0146.28-46zm-261.41 276v-95.48l122.76-110.2L328.27 337l-113 112.33zm368.27 0H259l144.58-144L480 370.59z" />
<path d="M20 32A20 20 0 000 52v344a20 20 0 0020 20h28V100a20 20 0 0120-20h380V52a20 20 0 00-20-20z" />
</symbol>
<symbol id="ph-si-lock" viewBox="0 0 512 512">
<path d="M368 192h-16v-80a96 96 0 10-192 0v80h-16a64.07 64.07 0 00-64 64v176a64.07 64.07 0 0064 64h224a64.07 64.07 0 0064-64V256a64.07 64.07 0 00-64-64zm-48 0H192v-80a64 64 0 11128 0z" />
</symbol>
<symbol id="ph-si-download" viewBox="0 0 512 512">
<path d="M376 160H272v153.37l52.69-52.68a16 16 0 0122.62 22.62l-80 80a16 16 0 01-22.62 0l-80-80a16 16 0 0122.62-22.62L240 313.37V160H136a56.06 56.06 0 00-56 56v208a56.06 56.06 0 0056 56h240a56.06 56.06 0 0056-56V216a56.06 56.06 0 00-56-56zM272 48a16 16 0 00-32 0v112h32z" />
</symbol>
<symbol id="ph-si-view" viewBox="0 0 512 512">
<path d="M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z" />
</symbol>
<symbol id="ph-si-earth" viewBox="0 0 512 512">
<path d="M414.39 97.74A224 224 0 1097.61 414.52 224 224 0 10414.39 97.74zM64 256.13a191.63 191.63 0 016.7-50.31c7.34 15.8 18 29.45 25.25 45.66 9.37 20.84 34.53 15.06 45.64 33.32 9.86 16.21-.67 36.71 6.71 53.67 5.36 12.31 18 15 26.72 24 8.91 9.08 8.72 21.52 10.08 33.36a305.36 305.36 0 007.45 41.27c0 .1 0 .21.08.31C117.8 411.13 64 339.8 64 256.13zm192 192a193.12 193.12 0 01-32-2.68c.11-2.71.16-5.24.43-7 2.43-15.9 10.39-31.45 21.13-43.35 10.61-11.74 25.15-19.68 34.11-33 8.78-13 11.41-30.5 7.79-45.69-5.33-22.44-35.82-29.93-52.26-42.1-9.45-7-17.86-17.82-30.27-18.7-5.72-.4-10.51.83-16.18-.63-5.2-1.35-9.28-4.15-14.82-3.42-10.35 1.36-16.88 12.42-28 10.92-10.55-1.41-21.42-13.76-23.82-23.81-3.08-12.92 7.14-17.11 18.09-18.26 4.57-.48 9.7-1 14.09.68 5.78 2.14 8.51 7.8 13.7 10.66 9.73 5.34 11.7-3.19 10.21-11.83-2.23-12.94-4.83-18.21 6.71-27.12 8-6.14 14.84-10.58 13.56-21.61-.76-6.48-4.31-9.41-1-15.86 2.51-4.91 9.4-9.34 13.89-12.27 11.59-7.56 49.65-7 34.1-28.16-4.57-6.21-13-17.31-21-18.83-10-1.89-14.44 9.27-21.41 14.19-7.2 5.09-21.22 10.87-28.43 3-9.7-10.59 6.43-14.06 10-21.46 1.65-3.45 0-8.24-2.78-12.75q5.41-2.28 11-4.23a15.6 15.6 0 008 3c6.69.44 13-3.18 18.84 1.38 6.48 5 11.15 11.32 19.75 12.88 8.32 1.51 17.13-3.34 19.19-11.86 1.25-5.18 0-10.65-1.2-16a190.83 190.83 0 01105 32.21c-2-.76-4.39-.67-7.34.7-6.07 2.82-14.67 10-15.38 17.12-.81 8.08 11.11 9.22 16.77 9.22 8.5 0 17.11-3.8 14.37-13.62-1.19-4.26-2.81-8.69-5.42-11.37a193.27 193.27 0 0118 14.14c-.09.09-.18.17-.27.27-5.76 6-12.45 10.75-16.39 18.05-2.78 5.14-5.91 7.58-11.54 8.91-3.1.73-6.64 1-9.24 3.08-7.24 5.7-3.12 19.4 3.74 23.51 8.67 5.19 21.53 2.75 28.07-4.66 5.11-5.8 8.12-15.87 17.31-15.86a15.4 15.4 0 0110.82 4.41c3.8 3.94 3.05 7.62 3.86 12.54 1.43 8.74 9.14 4 13.83-.41a192.12 192.12 0 019.24 18.77c-5.16 7.43-9.26 15.53-21.67 6.87-7.43-5.19-12-12.72-21.33-15.06-8.15-2-16.5.08-24.55 1.47-9.15 1.59-20 2.29-26.94 9.22-6.71 6.68-10.26 15.62-17.4 22.33-13.81 13-19.64 27.19-10.7 45.57 8.6 17.67 26.59 27.26 46 26 19.07-1.27 38.88-12.33 38.33 15.38-.2 9.81 1.85 16.6 4.86 25.71 2.79 8.4 2.6 16.54 3.24 25.21a158 158 0 004.74 30.07A191.75 191.75 0 01256 448.13z" />
</symbol>
<symbol id="ph-si-camera" viewBox="0 0 512 512">
<path d="M432 144h-59c-3 0-6.72-1.94-9.62-5l-25.94-40.94a15.52 15.52 0 00-1.37-1.85C327.11 85.76 315 80 302 80h-92c-13 0-25.11 5.76-34.07 16.21a15.52 15.52 0 00-1.37 1.85l-25.94 41c-2.22 2.42-5.34 5-8.62 5v-8a16 16 0 00-16-16h-24a16 16 0 00-16 16v8h-4a48.05 48.05 0 00-48 48V384a48.05 48.05 0 0048 48h352a48.05 48.05 0 0048-48V192a48.05 48.05 0 00-48-48zM256 368a96 96 0 1196-96 96.11 96.11 0 01-96 96z" />
</symbol>
<symbol id="ph-si-comment" viewBox="0 0 512 512">
<path d="M144 464a16 16 0 01-16-16v-64h-24a72.08 72.08 0 01-72-72V120a72.08 72.08 0 0172-72h304a72.08 72.08 0 0172 72v192a72.08 72.08 0 01-72 72H245.74l-91.49 76.29A16.05 16.05 0 01144 464z" />
</symbol>
<symbol id="ph-si-ext-link" viewBox="0 0 512 512">
<path d="M200.66 352H144a96 96 0 010-192h55.41m113.18 0H368a96 96 0 010 192h-56.66m-142.27-96h175.86" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" />
</symbol>
<symbol id="ph-si-up" viewBox="0 0 512 512">
<path d="M256 48C141.13 48 48 141.13 48 256s93.13 208 208 208 208-93.13 208-208S370.87 48 256 48zm91.36 212.65a16 16 0 01-22.63.09L272 208.42V342a16 16 0 01-32 0V208.42l-52.73 52.32A16 16 0 11164.73 238l80-79.39a16 16 0 0122.54 0l80 79.39a16 16 0 01.09 22.65z" />
</symbol>
<symbol id="ph-si-upload" viewBox="0 0 512 512">
<path d="M255.803 64a45.006 45.006 0 00-31.623 13.178L122.926 178.432a45.002 45.002 0 000 63.642 45.002 45.002 0 0063.64 0l24.432-24.431v110.74A45.002 45.002 0 00256 373.385a45.002 45.002 0 0045.002-45.002v-110.74l24.432 24.431a45.002 45.002 0 0063.64 0 45.002 45.002 0 000-63.642L287.82 77.178A45.006 45.006 0 00255.803 64zM36 330.984c-11.08 0-20 8.92-20 20V428c0 11.08 8.92 20 20 20h440c11.08 0 20-8.92 20-20v-77.016c0-11.08-8.92-20-20-20H320.947A65 65 0 01256 393.383a65 65 0 01-64.947-62.399H36zm396.256 25.12h23.922c11.08 0 20 8.92 20 20v26.777c0 11.08-8.92 20-20 20h-23.922c-11.08 0-20-8.92-20-20v-26.777c0-11.08 8.92-20 20-20z" />
</symbol>
<symbol id="ph-si-upload-multiple" viewBox="0 0 512 512">
<path d="M255.803 64a45.006 45.006 0 00-31.623 13.178L122.926 178.432a45.002 45.002 0 000 63.642 45.002 45.002 0 0063.64 0l24.432-24.431v110.74A45.002 45.002 0 00256 373.385a45.002 45.002 0 0045.002-45.002v-110.74l24.432 24.431a45.002 45.002 0 0063.64 0 45.002 45.002 0 000-63.642L287.82 77.178A45.006 45.006 0 00255.803 64zM36 330.984c-11.08 0-20 8.92-20 20V428c0 11.08 8.92 20 20 20h440c11.08 0 20-8.92 20-20v-77.016c0-11.08-8.92-20-20-20H320.947A65 65 0 01256 393.383a65 65 0 01-64.947-62.399H36zm312.256 25.12h23.92c11.08 0 20 8.92 20 20v26.777c0 11.08-8.92 20-20 20h-23.92c-11.08 0-20-8.92-20-20v-26.777c0-11.08 8.92-20 20-20zm84 0h23.922c11.08 0 20 8.92 20 20v26.777c0 11.08-8.92 20-20 20h-23.922c-11.08 0-20-8.92-20-20v-26.777c0-11.08 8.92-20 20-20z" />
</symbol>
<symbol id="ph-si-cart" viewBox="0 0 512 512">
<circle cx="176" cy="416" r="32" />
<circle cx="400" cy="416" r="32" />
<path d="M456.8 120.78a23.92 23.92 0 00-18.56-8.78H133.89l-6.13-34.78A16 16 0 00112 64H48a16 16 0 000 32h50.58l45.66 258.78A16 16 0 00160 368h256a16 16 0 000-32H173.42l-5.64-32h241.66A24.07 24.07 0 00433 284.71l28.8-144a24 24 0 00-5-19.93z" />
</symbol>
<symbol id="ph-si-trash" viewBox="0 0 512 512">
<path d="M296 64h-80a7.91 7.91 0 00-8 8v24h96V72a7.91 7.91 0 00-8-8z" fill="none"/><path d="M432 96h-96V72a40 40 0 00-40-40h-80a40 40 0 00-40 40v24H80a16 16 0 000 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 000-32zM192.57 416H192a16 16 0 01-16-15.43l-8-224a16 16 0 1132-1.14l8 224A16 16 0 01192.57 416zM272 400a16 16 0 01-32 0V176a16 16 0 0132 0zm32-304h-96V72a7.91 7.91 0 018-8h80a7.91 7.91 0 018 8zm32 304.57A16 16 0 01320 416h-.58A16 16 0 01304 399.43l8-224a16 16 0 1132 1.14z"/>
</symbol>
<symbol id="ph-si-enabled" viewBox="0 0 512 512">
<path d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"/>
</symbol>
<symbol id="ph-si-disabled" viewBox="0 0 512 512">
<path d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm80 224H176a16 16 0 010-32h160a16 16 0 010 32z"/>
</symbol>
<symbol id="ph-si-star" viewBox="0 0 512 512">
<path d="M394 480a16 16 0 01-9.39-3L256 383.76 127.39 477a16 16 0 01-24.55-18.08L153 310.35 23 221.2a16 16 0 019-29.2h160.38l48.4-148.95a16 16 0 0130.44 0l48.4 149H480a16 16 0 019.05 29.2L359 310.35l50.13 148.53A16 16 0 01394 480z"/>
</symbol>
<symbol id="ph-si-user" viewBox="0 0 512 512">
<path d="M332.64 64.58C313.18 43.57 286 32 256 32c-30.16 0-57.43 11.5-76.8 32.38-19.58 21.11-29.12 49.8-26.88 80.78C156.76 206.28 203.27 256 256 256s99.16-49.71 103.67-110.82c2.27-30.7-7.33-59.33-27.03-80.6zM432 480H80a31 31 0 01-24.2-11.13c-6.5-7.77-9.12-18.38-7.18-29.11C57.06 392.94 83.4 353.61 124.8 326c36.78-24.51 83.37-38 131.2-38s94.42 13.5 131.2 38c41.4 27.6 67.74 66.93 76.18 113.75 1.94 10.73-.68 21.34-7.18 29.11A31 31 0 01432 480z"/>
</symbol>
<symbol id="ph-si-stats" viewBox="0 0 512 512">
<path d="M104 496H72a24 24 0 01-24-24V328a24 24 0 0124-24h32a24 24 0 0124 24v144a24 24 0 01-24 24zm224 0h-32a24 24 0 01-24-24V232a24 24 0 0124-24h32a24 24 0 0124 24v240a24 24 0 01-24 24zm112 0h-32a24 24 0 01-24-24V120a24 24 0 0124-24h32a24 24 0 0124 24v352a24 24 0 01-24 24zm-224 0h-32a24 24 0 01-24-24V40a24 24 0 0124-24h32a24 24 0 0124 24v432a24 24 0 01-24 24z"/>
</symbol>
<symbol id="ph-si-ytb" viewBox="0 0 512 512">
<path d="M508.64 148.79c0-45-33.1-81.2-74-81.2C379.24 65 322.74 64 265 64h-18c-57.6 0-114.2 1-169.6 3.6C36.6 67.6 3.5 104 3.5 149 1 184.59-.06 220.19 0 255.79q-.15 53.4 3.4 106.9c0 45 33.1 81.5 73.9 81.5 58.2 2.7 117.9 3.9 178.6 3.8q91.2.3 178.6-3.8c40.9 0 74-36.5 74-81.5 2.4-35.7 3.5-71.3 3.4-107q.34-53.4-3.26-106.9zM207 353.89v-196.5l145 98.2z"/>
</symbol>
<symbol id="ph-si-search" viewBox="0 0 512 512">
<path d="M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"/>
</symbol>
<symbol id="ph-si-save" viewBox="0 0 512 512">
<path d="M465.94 119.76l-73.7-73.7A47.68 47.68 0 00358.3 32H96a64 64 0 00-64 64v320a64 64 0 0064 64h320a64 64 0 0064-64V153.7a47.68 47.68 0 00-14.06-33.94zM120 112h176a8 8 0 018 8v48a8 8 0 01-8 8H120a8 8 0 01-8-8v-48a8 8 0 018-8zm139.75 319.91a80 80 0 1176.16-76.16 80.06 80.06 0 01-76.16 76.16z"/><circle cx="256" cy="352" r="48"/>
</symbol>
</defs>
</svg>

View File

@ -0,0 +1,229 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Factory;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Object\CMSObject;
jimport('joomla.application.component.model');
class PhocagalleryModelCategories extends BaseDatabaseModel
{
var $_data = null;
var $_total = null;
var $_context = 'com_phocagallery.categories';
private $_ordering = null;
function __construct() {
parent::__construct();
$app = Factory::getApplication();
$config = Factory::getConfig();
$paramsC = ComponentHelper::getParams('com_phocagallery') ;
$default_pagination = (int)$paramsC->get( 'default_pagination_categories', '0' );
$category_ordering = $paramsC->get( 'category_ordering', 1 );
$context = $this->_context.'.';
// Get the pagination r equest variables
$this->setState('limit', $app->getUserStateFromRequest($context .'limit', 'limit', $default_pagination, 'int'));
$this->setState('limitstart', $app->input->get('limitstart', 0, 'int'));
// In case limit has been changed, adjust limitstart accordingly
$this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0));
$this->setState('filter.language',$app->getLanguageFilter());
$this->setState('catordering', $app->getUserStateFromRequest($context .'catordering', 'catordering', $category_ordering, 'int'));
// Get the filter r equest variables
//$this->setState('filter_order', J Request::get Cmd('filter_order', 'ordering'));
//$this->setState('filter_order_dir', J Request::get Cmd('filter_order_Dir', 'ASC'));
}
function getData() {
$app = Factory::getApplication();
if (empty($this->_data)) {
$query = $this->_buildQuery();
$this->_data = $this->_getList( $query );// We need all data because of tree
// Order Categories to tree
$text = ''; // test is tree name e.g. Category >> Subcategory
$tree = array();
$this->_data = $this->_categoryTree($this->_data, $tree, 0, $text, -1);
return $this->_data;
}
}
/*
* Is called after setTotal from the view
*/
function getTotal() {
return $this->_total;
}
function setTotal($total) {
$this->_total = (int)$total;
}
/*
* Is called after setTotal from the view
*/
function getPagination() {
if (empty($this->_pagination)) {
jimport('joomla.html.pagination');
$this->_pagination = new PhocaGalleryPaginationCategories( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );
}
return $this->_pagination;
}
function getOrdering() {
if(empty($this->_ordering)) {
$this->_ordering = PhocaGalleryOrdering::renderOrderingFront($this->getState('catordering'), 2);
}
return $this->_ordering;
}
function _buildQuery() {
$app = Factory::getApplication();
$user = Factory::getUser();
$gid = $user->get('aid', 0);
// Filter by language
$whereLang = '';
if ($this->getState('filter.language')) {
$whereLang = ' AND cc.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
}
// Params
$params = $app->getParams();
$display_subcategories = $params->get( 'display_subcategories', 1 );
//$show_empty_categories= $params->get( 'display_empty_categories', 0 );
//$hide_categories = $params->get( 'hide_categories', '' );
$catOrdering = PhocaGalleryOrdering::getOrderingString($this->getState('catordering'), 2);
// Display or hide subcategories in CATEGORIES VIEW
$hideSubCatSql = '';
if ((int)$display_subcategories != 1) {
$hideSubCatSql = ' AND cc.parent_id = 0';
}
// Get all categories which should be hidden
/*$hideCatArray = explode( ',', trim( $hide_categories ) );
$hideCatSql = '';
if (is_array($hideCatArray)) {
foreach ($hideCatArray as $value) {
$hideCatSql .= ' AND cc.id != '. (int) trim($value) .' ';
}
}*/
//Display or hide empty categories
/* $emptyCat = '';
if ($show_empty_categories != 1) {
$emptyCat = ' AND a.published = 1';
}*/
phocagalleryimport('phocagallery.ordering.ordering');
//$categoryOrdering = PhocaGalleryOrdering::getOrderingString($category_ordering, 2);
$query = 'SELECT cc.*, a.catid, COUNT(a.id) AS numlinks, u.username AS username, r.count AS ratingcount, r.average AS ratingaverage, uc.avatar AS avatar, uc.approved AS avatarapproved, uc.published AS avatarpublished, min(a.filename) as filename, min(a.extm) as extm, min(a.exts) as exts, min(a.exth) as exth, min(a.extw) as extw,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as slug'
. ' FROM #__phocagallery_categories AS cc'
//. ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id'
. ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id and a.published = 1'
. ' LEFT JOIN #__phocagallery_user AS uc ON uc.userid = cc.owner_id'
. ' LEFT JOIN #__users AS u ON u.id = cc.owner_id'
. ' LEFT JOIN #__phocagallery_votes_statistics AS r ON r.catid = cc.id'
. ' WHERE cc.published = 1'
. ' AND cc.approved = 1'
//. ' AND (a.published = 1 OR a.id is null)'
//. $emptyCat - need to be set in tree
. $whereLang
. $hideSubCatSql
//. $hideCatSql - need to be set in tree
. ' GROUP BY cc.id, cc.parent_id, cc.owner_id, cc.image_id, cc.title, cc.name, cc.alias, cc.image, cc.section, cc.image_position, cc.description, cc.date, cc.published, cc.approved, cc.checked_out, cc.checked_out_time, cc.editor, cc.ordering, cc.access, cc.count, cc.hits, cc.accessuserid, cc.deleteuserid, cc.uploaduserid, cc.userfolder, cc.latitude, cc.longitude, cc.zoom, cc.geotitle, cc.extid, cc.exta, cc.extu, cc.extauth, cc.extfbuid, cc.extfbcatid, cc.params, cc.metakey, cc.metadesc, cc.metadata, cc.language, a.catid, u.username, r.count, r.average, uc.avatar, uc.approved, uc.published'
//. ' ORDER BY cc.'.$categoryOrdering;
.$catOrdering['output'];
return $query;
}
/*
* Create category tree
*/
function _categoryTree( $data, $tree, $id = 0, $text='', $currentId = 0) {
foreach ($data as $key) {
$show_text = $text . $key->title;
static $iCT = 0;// All displayed items
if ($key->parent_id == $id && $currentId != $id && $currentId != $key->id ) {
$tree[$iCT] = new CMSObject();
$tree[$iCT]->id = $key->id;
$tree[$iCT]->title = $show_text;
$tree[$iCT]->title_self = $key->title;
$tree[$iCT]->parent_id = $key->parent_id;
$tree[$iCT]->image_id = $key->image_id;
$tree[$iCT]->name = $key->name;
$tree[$iCT]->alias = $key->alias;
$tree[$iCT]->image = $key->image;
$tree[$iCT]->section = $key->section;
$tree[$iCT]->image_position = $key->image_position;
$tree[$iCT]->description = $key->description;
$tree[$iCT]->published = $key->published;
$tree[$iCT]->editor = $key->editor;
$tree[$iCT]->ordering = $key->ordering;
$tree[$iCT]->access = $key->access;
$tree[$iCT]->count = $key->count;
$tree[$iCT]->params = $key->params;
$tree[$iCT]->catid = $key->catid;
$tree[$iCT]->numlinks = $key->numlinks;
$tree[$iCT]->slug = $key->slug;
$tree[$iCT]->hits = $key->hits;
$tree[$iCT]->username = $key->username;
$tree[$iCT]->ratingaverage = $key->ratingaverage;
$tree[$iCT]->ratingcount = $key->ratingcount;
$tree[$iCT]->accessuserid = $key->accessuserid;
$tree[$iCT]->uploaduserid = $key->uploaduserid;
$tree[$iCT]->deleteuserid = $key->deleteuserid;
$tree[$iCT]->userfolder = $key->userfolder;
$tree[$iCT]->latitude = $key->latitude;
$tree[$iCT]->longitude = $key->longitude;
$tree[$iCT]->zoom = $key->zoom;
$tree[$iCT]->geotitle = $key->geotitle;
$tree[$iCT]->avatar = $key->avatar;
$tree[$iCT]->avatarapproved = $key->avatarapproved;
$tree[$iCT]->avatarpublished = $key->avatarpublished;
$tree[$iCT]->link = '';
$tree[$iCT]->filename = '';// Will be added in View (after items will be reduced)
$tree[$iCT]->extid = $key->extid;// Picasa Album or Facebook Album
$tree[$iCT]->extfbcatid = $key->extfbcatid;
// info about one image (not using recursive function)
$tree[$iCT]->filename = $key->filename;
$tree[$iCT]->extm = $key->extm;
$tree[$iCT]->exts = $key->exts;
$tree[$iCT]->extw = $key->extw;
$tree[$iCT]->exth = $key->exth;
$tree[$iCT]->date = $key->date;
$tree[$iCT]->linkthumbnailpath = '';
$iCT++;
$tree = $this->_categoryTree($data, $tree, $key->id, $show_text . " &raquo; ", $currentId );
}
}
return($tree);
}
}
?>

View File

@ -0,0 +1,650 @@
<?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;
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die();
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;
jimport('joomla.application.component.model');
phocagalleryimport('phocagallery.ordering.ordering');
phocagalleryimport('phocagallery.file.filethumbnail');
class PhocagalleryModelCategory extends BaseDatabaseModel
{
var $_id = null;
var $_data = null;
var $_category = null;
var $_total = null;
var $_context = 'com_phocagallery.category';
private $_ordering = null;
function __construct() {
$app = Factory::getApplication();
parent::__construct();
$config = Factory::getConfig();
$paramsC = ComponentHelper::getParams('com_phocagallery') ;
$default_pagination = (int)$paramsC->get( 'default_pagination_category', '20' );
$image_ordering = $paramsC->get( 'image_ordering', 1 );
$context = $this->_context.'.';
// Get the pagination request variables
$this->setState('limit', $app->getUserStateFromRequest($context .'limit', 'limit', $default_pagination, 'int'));
$this->setState('limitstart', $app->input->get('limitstart', 0, 'int'));
// In case limit has been changed, adjust limitstart accordingly
$this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0));
// Get the filter request variables
$this->setState('filter.language',$app->getLanguageFilter());
$this->setState('imgordering', $app->getUserStateFromRequest($context .'imgordering', 'imgordering', $image_ordering, 'int'));
//$this->setState('filter_order', J Request::get Cmd('filter_order', 'ordering'));
//$this->setState('filter_order_dir', J Request::get Cmd('filter_order_Dir', 'ASC'));
$id = $app->input->get('id', 0, 'int');
$this->setId((int)$id);
}
function setId($id) {
$this->_id = $id;
$this->_category = null;
}
/*
* IMAGES
*/
function getData( $rightDisplayDelete = 0, $tagId = 0) {
if (empty($this->_data)) {
$query = $this->_buildQuery($rightDisplayDelete, $tagId);
$this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
}
return $this->_data;
}
function getTotal($rightDisplayDelete = 0, $tagId = 0) {
if (empty($this->_total)) {
$query = $this->_buildQuery($rightDisplayDelete, $tagId, 1);
$this->_total = $this->_getListCount($query);
}
return $this->_total;
}
function getPagination($rightDisplayDelete = 0, $tagId = 0) {
if (empty($this->_pagination)) {
jimport('joomla.html.pagination');
$this->_pagination = new PhocaGalleryPaginationCategory( $this->getTotal($rightDisplayDelete, $tagId), $this->getState('limitstart'), $this->getState('limit') );
}
return $this->_pagination;
}
function getOrdering() {
if(empty($this->_ordering)) {
$this->_ordering = PhocaGalleryOrdering::renderOrderingFront($this->getState('imgordering'), 1);
}
return $this->_ordering;
}
function _buildQuery($rightDisplayDelete = 0, $tagId = 0, $count = 0) {
$app = Factory::getApplication();
$user = Factory::getUser();
$params = $app->getParams();
//$image_ordering = $params->get( 'image_ordering', 1 );
$wheres = array();
$enable_overlib = $params->get( 'enable_overlib', 0 );
$imageOrdering = PhocaGalleryOrdering::getOrderingString($this->getState('imgordering'), 1);
// Filter by language
if ($this->getState('filter.language')) {
$wheres[] = ' a.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
}
// Link from comment system
$cimgid = $app->input->get( 'cimgid', 0, 'int');
if ($cimgid > 0) {
$wheres[] = ' a.id = '.(int)$cimgid;
}
$selectUser = '';
$leftUser = '';
if ($enable_overlib > 3) {
$selectUser = ', ua.id AS userid, ua.username AS username, ua.name AS usernameno';
$leftUser = ' LEFT JOIN #__users AS ua ON ua.id = a.userid';
//$whereUser = ' AND ua.id ='.(int)$user->id;
}
if ($rightDisplayDelete == 0 ) {
$published = ' AND a.published = 1';
$published .= ' AND a.approved = 1';
} else {
$published = '';
}
$leftTag = '';
if ((int)$tagId > 0) {
$leftTag = ' LEFT JOIN #__phocagallery_tags_ref AS t ON t.imgid = a.id';
}
if ((int)$tagId > 0) {
$wheres[] = ' t.tagid= '.(int)$tagId;
} else {
$wheres[] = ' a.catid= '.(int)$this->_id;
}
$leftCat = ' LEFT JOIN #__phocagallery_categories AS cc ON cc.id = a.catid';
if ($count == 1) {
$query = 'SELECT a.id'
//. $selectUser
.' FROM #__phocagallery AS a'
//.' LEFT JOIN #__phocagallery_img_votes_statistics AS r ON r.imgid = a.id'
. $leftCat
//. $leftUser
. $leftTag
. ' WHERE ' . implode( ' AND ', $wheres )
. $published
//. $imageOrdering['output'];
. ' ORDER BY a.id';
} else {
$query = 'SELECT a.*, cc.alias AS catalias, cc.accessuserid AS cataccessuserid, cc.access AS cataccess,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug'
. $selectUser
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_img_votes_statistics AS r ON r.imgid = a.id'
. $leftCat
. $leftUser
. $leftTag
. ' WHERE ' . implode( ' AND ', $wheres )
. $published
. $imageOrdering['output'];
}
return $query;
}
/*
* CATEGORY - get info about this category
*/
function getCategory() {
$app = Factory::getApplication();
if ($this->_id == 0) {
return '';
}
if ($this->_loadCategory()) {
$user = Factory::getUser();
if (!$this->_category->published) {
//$mainframe->redirect(JRoute::_('index.php', false), JText::_("COM_PHOCAGALLERY_CATEGORY_IS_UNPUBLISHED"));
throw new Exception(Text::_( "COM_PHOCAGALLERY_CATEGORY_IS_UNPUBLISHED" ), 404);
exit;
}
if (!$this->_category->approved) {
//$mainframe->redirect(JRoute::_('index.php', false), JText::_("COM_PHOCAGALLERY_CATEGORY_IS_UNAUTHORIZED"));// don't loop
throw new Exception(Text::_( "COM_PHOCAGALLERY_ERROR_CATEGORY_IS_UNAUTHORIZED" ), 404);
exit;
}
// USER RIGHT - ACCESS - - - - - -
$rightDisplay = 1;//default is set to 1 (all users can see the category)
if (!empty($this->_category)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->_category->accessuserid, $this->_category->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
}
if ($rightDisplay == 0) {
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$t['pl'] = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
$app->enqueueMessage(Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
$app->redirect(Route::_($t['pl'], false));
//exit;
}
// - - - - - - - - - - - - - - - -
}
return $this->_category;
}
function _loadCategory() {
if (empty($this->_category)){
//$query = 'SELECT c.*,' .
$query = 'SELECT c.id, c.title, c.alias, c.description, c.published, c.approved, c.parent_id, c.deleteuserid, c.accessuserid, c.uploaduserid, c.owner_id, c.access, c.metakey, c.metadesc, c.latitude, c.longitude, c.zoom, c.geotitle, c.userfolder, c.image_id,' .
' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug '.
' FROM #__phocagallery_categories AS c' .
' WHERE c.id = '. (int) $this->_id;
' AND c.approved = 1';
$this->_db->setQuery($query, 0, 1);
$this->_category = $this->_db->loadObject();
}
return true;
}
/*
* PARENT CATEGORIES
*/
function getParentCategory() {
$parentCategory = 0;
if (isset($this->_category->parent_id) && isset($this->_category->id)) {
$app = Factory::getApplication();
$params = $app->getParams();
$category_ordering = $params->get( 'category_ordering', 1 );
$categoryOrdering = PhocaGalleryOrdering::getOrderingString($category_ordering, 2);
//$query = 'SELECT cc.*' .
$query = 'SELECT cc.id, cc.title, cc.alias, cc.published, cc.approved, cc.parent_id, cc.deleteuserid, cc.accessuserid, cc.uploaduserid, cc.access' .
' FROM #__phocagallery_categories AS cc' .
' WHERE cc.id = '.(int) $this->_category->parent_id.
' AND cc.published = 1' .
' AND cc.approved = 1' .
' AND cc.id <> '.(int) $this->_category->id.
$categoryOrdering['output'];
$this->_db->setQuery($query, 0, 1);
$parentCategory = $this->_db->loadObject();
}
return $parentCategory ;
}
/*
* SUB CATEGORIES
*/
function getSubCategory() {
$app = Factory::getApplication();
$params = $app->getParams();
$category_ordering = $params->get( 'category_ordering', 1 );
$categoryOrdering = PhocaGalleryOrdering::getOrderingString($category_ordering, 2);
// Filter by language
$whereLang = '';
if ($this->getState('filter.language')) {
$whereLang = ' AND cc.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
}
//$query = 'SELECT c.*, COUNT(a.id) countimage' ... Cannot be used because get error if there is no image
//$query = 'SELECT cc.*, a.filename, a.extm, a.exts, a.extw, a.exth'
//$query = 'SELECT cc.id, cc.title, cc.alias, cc.published, cc.approved, cc.parent_id, cc.deleteuserid, cc.accessuserid, cc.uploaduserid, cc.access, cc.image_id';
//$query = 'SELECT DISTINCT cc.id, cc.title, cc.alias, cc.published, cc.approved, cc.parent_id, cc.deleteuserid, cc.accessuserid, cc.uploaduserid, cc.access, cc.image_id, a.filename, a.extm, a.exts, a.extw, a.exth, a.extid';
$query = 'SELECT DISTINCT cc.id, cc.title, cc.alias, cc.published, cc.approved, cc.parent_id, cc.deleteuserid, cc.accessuserid, cc.uploaduserid, cc.access, cc.image_id, min(a.filename) as filename, min(a.extm) as extm, min(a.exts) as exts, min(a.extw) as extw, min(a.exth) as exth, min(a.extid) as extid';
$query .= ' FROM #__phocagallery_categories AS cc'
.' LEFT JOIN #__phocagallery AS a ON cc.id = a.catid'
.' WHERE cc.parent_id = '.(int) $this->_id
.' AND cc.published = 1'
.' AND cc.approved = 1'
.' AND cc.id <> '.(int) $this->_id
// .' AND a.published = 1'
// .' AND countimage > 0'
// .' AND (SELECT COUNT(a.id) AS countimage'
// .' FROM #__phocagallery as a'
// .' WHERE a.catid = c.id'
// .' AND a.published = 1) > 0'
. $whereLang
//.' GROUP BY cc.id, cc.title, cc.alias, cc.published, cc.approved, cc.parent_id, cc.deleteuserid, cc.accessuserid, cc.uploaduserid, cc.access, cc.image_id, a.filename, a.extm, a.exts, a.extw, a.exth, a.extid'
.' GROUP BY cc.id, cc.title, cc.alias, cc.published, cc.approved, cc.parent_id, cc.deleteuserid, cc.accessuserid, cc.uploaduserid, cc.access, cc.image_id'
.$categoryOrdering['output'];
$this->_db->setQuery($query);
$subCategory = $this->_db->loadObjectList();
return $subCategory;
}
// Called from SubCategories
// Called from Category Controller
function getCountItem($catid = 0, $rightDisplayDelete = 0) {
if ($rightDisplayDelete == 0 ) {
$published = ' WHERE a.published = 1 AND a.approved = 1 AND a.catid = '.$catid;
} else {
$published = ' WHERE a.catid = '.$catid;
}
$query = 'SELECT COUNT(a.id) FROM #__phocagallery AS a'
. $published;
;
$this->_db->setQuery( $query );
/*if (!$this->_db->query()) {
$this->setError('Database Error 3');
return false;
}*/
return $this->_db->loadRow();
}
/*
* Called from Controller
*/
function getCategoryIdFromImageId($id) {
// id is id
$query = 'SELECT a.catid' .
' FROM #__phocagallery AS a' .
' WHERE a.id = '. (int) $id;
$this->_db->setQuery($query, 0, 1);
$categoryId = $this->_db->loadObject();
return $categoryId;
}
function getCategoryAlias($id) {
// id is catid
$query = 'SELECT c.alias' .
' FROM #__phocagallery_categories AS c' .
' WHERE c.id = '. (int) $id;
$this->_db->setQuery($query, 0, 1);
$categoryAlias = $this->_db->loadObject();
return $categoryAlias;
}
/*
* Actions
*/
function delete($id = 0) {
// Get all filenames we want to delete from database, we delete all thumbnails from server of this file
$queryd = 'SELECT filename as filename FROM #__phocagallery WHERE id ='.(int)$id;
$this->_db->setQuery($queryd);
$file_object = $this->_db->loadObjectList();
$query = 'DELETE FROM #__phocagallery'
. ' WHERE id ='.(int)$id;
$this->_db->setQuery( $query );
$this->_db->execute();
/*if(!$this->_db->query()) {
$this->setError('Database Error 2');
return false;
}*/
// Delete thumbnails - medium and large, small from server
// All id we want to delete - gel all filenames
foreach ($file_object as $key => $value) {
//The file can be stored in other category - don't delete it from server because other category use it
$querys = "SELECT id as id FROM #__phocagallery WHERE filename='".$value->filename."' ";
$this->_db->setQuery($queryd);
$same_file_object = $this->_db->loadObject();
//same file in other category doesn't exist - we can delete it
if (!$same_file_object){
//Delete all thumbnail files but not original
PhocaGalleryFileThumbnail::deleteFileThumbnail($value->filename, 1, 1, 1);
PhocaGalleryFile::deleteFile($value->filename);
}
}
return true;
}
function publish($id = 0, $publish = 1) {
$user = Factory::getUser();
$query = 'UPDATE #__phocagallery'
. ' SET published = '.(int) $publish
. ' WHERE id = '.(int)$id
. ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' ) )';
$this->_db->setQuery( $query );
$this->_db->execute();
/*if (!$this->_db->query()) {
$this->setError('Database Error 2');
return false;
}*/
return true;
}
function store($data, $return) {
//If this file doesn't exists don't save it
if (!PhocaGalleryFile::existsFileOriginal($data['filename'])) {
$this->setError('File not exists');
return false;
}
$data['imgorigsize'] = PhocaGalleryFile::getFileSize($data['filename'], 0);
$data['format'] = PhocaGalleryFile::getFileFormat($data['filename']);
//If there is no title and no alias, use filename as title and alias
if (!isset($data['title']) || (isset($data['title']) && $data['title'] == '')) {
$data['title'] = PhocaGalleryFile::getTitleFromFile($data['filename']);
}
if (!isset($data['alias']) || (isset($data['alias']) && $data['alias'] == '')) {
$data['alias'] = PhocaGalleryFile::getTitleFromFile($data['filename']);
}
//clean alias name (no bad characters)
//$data['alias'] = PhocaGalleryText::getAliasName($data['alias']);
if((!isset($data['longitude']) || (isset($data['longitude']) && $data['longitude'] == '')) ||
(!isset($data['latitude']) || (isset($data['latitude']) && $data['latitude'] ==''))) {
phocagalleryimport('phocagallery.geo.geo');
$coords = PhocaGalleryGeo::getGeoCoords($data['filename']);
if (!isset($data['longitude']) || (isset($data['longitude']) && $data['longitude'] =='')){
$data['longitude'] = $coords['longitude'];
}
if (!isset($data['latitude']) || (isset($data['latitude']) && $data['latitude'] =='')){
$data['latitude'] = $coords['latitude'];
}
if ((!isset($data['zoom']) || (isset($data['zoom']) && $data['zoom'] == '')) && $data['longitude'] != '' && $data['latitude'] != ''){
$data['zoom'] = PhocaGallerySettings::getAdvancedSettings('geozoom');
}
}
$row = $this->getTable('phocagallery', 'Table');
// Bind the form fields to the Phoca gallery table
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Create the timestamp for the date
$row->date = gmdate('Y-m-d H:i:s');
// if new item, order last in appropriate group
if (!$row->id) {
$where = 'catid = ' . (int) $row->catid ;
$row->ordering = $row->getNextOrder( $where );
}
// Make sure the Phoca gallery table is valid
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the Phoca gallery table to the database
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
//Create thumbnail small, medium, large
$returnFrontMessage = PhocaGalleryFileThumbnail::getOrCreateThumbnail($row->filename, $return, 1, 1, 1, 1);
if ($returnFrontMessage == 'Success') {
return true;
} else {
return false;
}
}
function rate($data) {
$row = $this->getTable('phocagalleryvotes', 'Table');
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->published = 1;
if (!$row->id) {
$where = 'catid = ' . (int) $row->catid ;
$row->ordering = $row->getNextOrder( $where );
}
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Update the Vote Statistics
phocagalleryimport('phocagallery.rate.ratecategory');
if (!PhocaGalleryRateCategory::updateVoteStatistics( $data['catid'])) {
return false;
}
return true;
}
function comment($data) {
$row = $this->getTable('phocagallerycomments', 'Table');
if (!$row->bind($data)) {
$this->setError($row->getError());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->published = 1;
if (!$row->id) {
$where = 'catid = ' . (int) $row->catid ;
$row->ordering = $row->getNextOrder( $where );
}
if (!$row->check()) {
$this->setError($row->getError());
return false;
}
if (!$row->store()) {
$this->setError($row->getError());
return false;
}
return true;
}
function hit($id) {
$app = Factory::getApplication();
$table = Table::getInstance('phocagalleryc', 'Table');
$table->hit($id);
return true;
}
function getCountImages($catId, $published = 1) {
$app = Factory::getApplication();
$query = 'SELECT COUNT(i.id) AS countimg'
.' FROM #__phocagallery AS i'
.' WHERE i.catid = '. (int) $catId
.' AND i.published ='.(int)$published
.' AND i.approved = 1';
$this->_db->setQuery($query, 0, 1);
$countPublished = $this->_db->loadObject();
return $countPublished;
}
function getHits($catId) {
$app = Factory::getApplication();
$query = 'SELECT cc.hits AS catviewed'
.' FROM #__phocagallery_categories AS cc'
.' WHERE cc.id = '. (int) $catId;
$this->_db->setQuery($query, 0, 1);
$categoryViewed = $this->_db->loadObject();
return $categoryViewed;
}
function getStatisticsImages($catId, $order, $order2 = 'ASC', $limit = 3) {
$query = 'SELECT i.*,'
.' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug'
.' FROM #__phocagallery AS i'
.' LEFT JOIN #__phocagallery_categories AS cc ON cc.id = i.catid'
.' WHERE i.catid = '.(int) $catId
.' AND i.published = 1'
.' AND i.approved = 1'
.' ORDER BY '.$order.' '.$order2;
$this->_db->setQuery($query, 0, $limit);
$statistics = $this->_db->loadObjectList();
$item = array();
$count = 0;
$total = count($statistics);
for($i = 0; $i < $total; $i++) {
$statisticsData[$count] = $statistics[$i] ;
$item[$i] =& $statisticsData[$count];
$item[$i]->slug = $item[$i]->id.':'.$item[$i]->alias;
$item[$i]->item_type = "image";
$extImg = PhocaGalleryImage::isExtImage($item[$i]->extid);
if ($extImg) {
$item[$i]->linkthumbnailpath = $item[$i]->extm;
} else {
$item[$i]->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($item[$i]->filename, 'medium');
}
$count++;
}
return $item;
}
}
?>

View File

@ -0,0 +1,101 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Factory;
jimport('joomla.application.component.model');
phocagalleryimport('phocagallery.access.access');
phocagalleryimport('phocagallery.ordering.ordering');
class PhocagalleryModelComment extends BaseDatabaseModel
{
function __construct() {
parent::__construct();
$app = Factory::getApplication();
$id = $app->input->get('id', 0, 'int');
$this->setId((int)$id);
}
function setId($id) {
$this->_id = $id;
$this->_data = null;
}
function &getData() {
if (!$this->_loadData()) {
$this->_initData();
}
return $this->_data;
}
function _loadData() {
if (empty($this->_data)) {
$app = Factory::getApplication();
$params = $app->getParams();
$image_ordering = $params->get( 'image_ordering', 1 );
$imageOrdering = PhocaGalleryOrdering::getOrderingString($image_ordering);
$query = 'SELECT a.*, c.accessuserid as cataccessuserid, c.access as cataccess,'
.' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug,'
.' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_categories AS c ON c.id = a.catid'
.' WHERE a.id = '.(int) $this->_id
.$imageOrdering['output'];
$this->_db->setQuery($query);
$this->_data = $this->_db->loadObject();
return (boolean) $this->_data;
}
return true;
}
function _initData() {
if (empty($this->_data)) {
$this->_data = '';
return (boolean) $this->_data;
}
return true;
}
function comment($data) {
$row = $this->getTable('phocagallerycommentimgs', 'Table');
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->published = 1;
if (!$row->id) {
$where = 'imgid = ' . (int) $row->imgid ;
$row->ordering = $row->getNextOrder( $where );
}
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return true;
}
}
?>

View File

@ -0,0 +1,50 @@
<?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\Model\BaseDatabaseModel;
jimport('joomla.application.component.model');
class PhocagalleryModelCommentImgA extends BaseDatabaseModel
{
function comment($data) {
$row = $this->getTable('phocagallerycommentimgs', 'Table');
if (!$row->bind($data)) {
$this->setError($row->getError());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->published = 1;
if (!$row->id) {
$where = 'imgid = ' . (int) $row->imgid ;
$row->ordering = $row->getNextOrder( $where );
}
if (!$row->check()) {
$this->setError($row->getError());
return false;
}
if (!$row->store()) {
$this->setError($row->getError());
return false;
}
return true;
}
}
?>

View File

@ -0,0 +1,57 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
jimport('joomla.application.component.model');
class PhocagalleryModelCooliris3DWall extends BaseDatabaseModel
{
function __construct() {
parent::__construct();
}
function getCategory($id) {
$app = Factory::getApplication();
if ($id > 0) {
$query = 'SELECT c.*,' .
' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug '.
' FROM #__phocagallery_categories AS c' .
' WHERE c.id = '. (int) $id;
$this->_db->setQuery($query, 0, 1);
$category = $this->_db->loadObject();
$user = Factory::getUser();
// USER RIGHT - ACCESS - - - - - -
$rightDisplay = 1;//default is set to 1 (all users can see the category)
if (!empty($category)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $category->accessuserid, $category->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
}
if ($rightDisplay == 0) {
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$t['pl'] = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
$app->enqueueMessage(Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
$app->redirect(Route::_($t['pl'], false));
exit;
}
// - - - - - - - - - - - - - - - -
return $category;
}
return false;
}
}
?>

View File

@ -0,0 +1,328 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Factory;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Component\ComponentHelper;
jimport('joomla.application.component.model');
phocagalleryimport('phocagallery.access.access');
phocagalleryimport('phocagallery.ordering.ordering');
class PhocaGalleryModelDetail extends BaseDatabaseModel
{
public $_category = null;
function __construct() {
parent::__construct();
$app = Factory::getApplication();
$id = $app->input->get('id', 0, 'int');
$this->setState('filter.language',$app->getLanguageFilter());
$this->setId((int)$id);
}
function setId($id) {
$this->_id = $id;
$this->_data = null;
}
function &getData() {
if (!$this->_loadData()) {
$this->_initData();
}
return $this->_data;
}
function _loadData() {
if (empty($this->_data)) {
$app = Factory::getApplication();
$params = $app->getParams();
//$image_ordering = $params->get( 'image_ordering', 1 );
//$imageOrdering = PhocaGalleryOrdering::getOrderingString($image_ordering);
$whereLang = '';
if ($this->getState('filter.language')) {
$whereLang = ' AND a.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
}
$selectUser = ' ua.id AS userid, ua.username AS username, ua.name AS usernameno,';
$leftUser = ' LEFT JOIN #__users AS ua ON ua.id = a.userid';
$query = 'SELECT a.*, c.accessuserid as cataccessuserid, c.access as cataccess, c.owner_id as owner_id, '
. $selectUser
.' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug,'
.' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_categories AS c ON c.id = a.catid'
. $leftUser
.' WHERE a.id = '.(int) $this->_id
. $whereLang
.' AND a.published > 0'
.' AND a.approved > 0';
//.' ORDER BY a.'.$imageOrdering;
$this->_db->setQuery($query);
$this->_data = $this->_db->loadObject();
return (boolean) $this->_data;
}
return true;
}
function _initData() {
if (empty($this->_data)) {
$this->_data = '';
return (boolean) $this->_data;
}
return true;
}
function hit($id) {
$table = Table::getInstance('phocagallery', 'Table');
$table->hit($id);
return true;
}
function rate($data) {
$row = $this->getTable('phocagalleryimgvotes', 'Table');
if (!$row->bind($data)) {
$this->setError($row->getError());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->published = 1;
if (!$row->id) {
$where = 'imgid = ' . (int) $row->imgid ;
$row->ordering = $row->getNextOrder( $where );
}
if (!$row->check()) {
$this->setError($row->getError());
return false;
}
if (!$row->store()) {
$this->setError($row->getError());
return false;
}
// Update the Vote Statistics
phocagalleryimport('phocagallery.rate.rateimage');
if (!PhocaGalleryRateImage::updateVoteStatistics( $data['imgid'])) {
return false;
}
return true;
}
public function getThumbnails($id, $catid, $order) {
$paramsC = ComponentHelper::getParams('com_phocagallery') ;
$multibox_thubms_count = $paramsC->get( 'multibox_thubms_count', 4 );
// 1) Display only next thumbnails of current image - use the $order variable - to know next order values
$thumbnails1 = array();
$this->_db->setQuery($this->getThumbnailsQuery($id, $catid, $order), 0, (int)$multibox_thubms_count);
$thumbnails1 = $this->_db->loadObjectList();
$cT = count($thumbnails1);
// 2) if there are no more next thumbnails, fill them with thumbnails from beginning
$thumbnails2 = array();
if ((int)$cT < (int)$multibox_thubms_count) {
$newCount = (int)$multibox_thubms_count - (int)$cT;
$this->_db->setQuery($this->getThumbnailsQuery($id, $catid, 0, 1, $thumbnails1), 0, (int)$newCount);
$thumbnails2 = $this->_db->loadObjectList();
}
$thumbnails = array_merge((array)$thumbnails1, (array)$thumbnails2);
return $thumbnails;
}
protected function getThumbnailsQuery($id, $catid, $order, $completion = 0, $currentThumbs = array()) {
$paramsC = ComponentHelper::getParams('com_phocagallery') ;
$image_ordering = $paramsC->get( 'image_ordering', 1 );
$wheres = array();
if ($this->getState('filter.language')) {
$wheres[] = ' a.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
}
$imageOrdering = PhocaGalleryOrdering::getOrderingString($image_ordering, 1);
$published = ' AND a.published = 1';
$published .= ' AND a.approved = 1';
$wheres[] = ' a.catid = '.(int) $catid;
// Known issue - thumbnails with only larger order taken
if ($completion == 1) {
// with completion displaying, it can happen, that the same thumbnail as active thumbnail can be selected
// because thumbnails are selected from beginning
$wheres[] = ' a.id <> '.(int) $id;//do not complete thumbnails with image which is displayed as active
if (!empty($currentThumbs)) {
foreach ($currentThumbs as $k => $v) {
$wheres[] = ' a.id <> '.(int) $v->id;
}
}
} else {
// with standard displaying, it cannot happen, that the active image will be displayed,
// as only images with larger order will be displayed
$wheres[] = ' a.ordering > '.(int) $order;
}
$query = 'SELECT a.id, a.extid, a.exts, a.filename, a.title, a.description, a.metadesc, cc.alias AS catalias, cc.accessuserid AS cataccessuserid, cc.access AS cataccess,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug,'
. ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_categories AS cc ON cc.id = a.catid'
. ' WHERE ' . implode( ' AND ', $wheres )
. $published
. $imageOrdering['output'];
return $query;
}
function comment($data) {
$row = $this->getTable('phocagallerycommentimgs', 'Table');
if (!$row->bind($data)) {
$this->setError($row->getError());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->published = 1;
if (!$row->id) {
$where = 'imgid = ' . (int) $row->imgid ;
$row->ordering = $row->getNextOrder( $where );
}
if (!$row->check()) {
$this->setError($row->getError());
return false;
}
if (!$row->store()) {
$this->setError($row->getError());
return false;
}
return true;
}
function getItemNext($ordering, $catid) {
if (empty($this->_itemnext)) {
$query = $this->_getItemQueryOrdering( $ordering, $catid, 2 );
$this->_itemnext = $this->_getList( $query, 0 , 1 );
if (empty($this->_itemnext)) {
return null;
}
}
return $this->_itemnext;
}
function getItemPrev($ordering, $catid) {
if (empty($this->_itemprev)) {
$query = $this->_getItemQueryOrdering( $ordering, $catid, 1 );
$this->_itemprev = $this->_getList( $query, 0 , 1 );
if (empty($this->_itemprev)) {
return null;
}
}
return $this->_itemprev;
}
private function _getItemQueryOrdering($ordering, $catid, $direction) {
$wheres[] = " c.catid= ".(int) $catid;
//$wheres[] = " c.catid= cc.id";
$wheres[] = " c.published = 1";
$wheres[] = " cc.published = 1";
if ($direction == 1) {
$wheres[] = " c.ordering < " . (int) $ordering;
$order = 'DESC';
} else {
$wheres[] = " c.ordering > " . (int) $ordering;
$order = 'ASC';
}
if ($this->getState('filter.language')) {
$wheres[] = ' c.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
$wheres[] = ' cc.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
}
$query = ' SELECT c.id, c.title, c.alias, c.catid,'
.' cc.id AS categoryid, cc.title AS categorytitle, cc.alias AS categoryalias'
.' FROM #__phocagallery AS c'
.' LEFT JOIN #__phocagallery_categories AS cc ON cc.id = c.catid'
.' WHERE ' . implode( ' AND ', $wheres )
.' ORDER BY c.ordering '.$order;
return $query;
}
function getCategory($imageId) {
if (empty($this->_category)) {
$query = $this->_getCategoryQuery( $imageId );
$this->_category= $this->_getList( $query, 0, 1 );
}
return $this->_category;
}
function _getCategoryQuery( $imageId ) {
$wheres = array();
$app = Factory::getApplication();
$params = $app->getParams();
$user = Factory::getUser();
$userLevels = implode (',', $user->getAuthorisedViewLevels());
$wheres[] = " c.id= ".(int)$imageId;
$wheres[] = " cc.access IN (".$userLevels.")";
$wheres[] = " cc.published = 1";
if ($this->getState('filter.language')) {
$wheres[] = ' c.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
$wheres[] = ' cc.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
}
$query = " SELECT cc.id, cc.title, cc.alias, cc.description, cc.access as cataccess, cc.accessuserid as cataccessuserid, cc.parent_id as parent_id"
. " FROM #__phocagallery_categories AS cc"
. " LEFT JOIN #__phocagallery AS c ON c.catid = cc.id"
. " WHERE " . implode( " AND ", $wheres )
. " ORDER BY cc.ordering";
return $query;
}
}
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,79 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Factory;
jimport('joomla.application.component.model');
class PhocaGalleryModelInfo extends BaseDatabaseModel
{
function __construct() {
parent::__construct();
$app = Factory::getApplication();
$id = $app->input->get('id', 0, 'int');
$this->setId((int)$id);
//$post = $app->input->get('get');
}
function setId($id){
$this->_id = $id;
$this->_data = null;
}
function &getData() {
// Load the Phoca gallery data
if (!$this->_loadData()) {
$this->_initData();
}
return $this->_data;
}
function _loadData() {
$app = Factory::getApplication();
$user = Factory::getUser();
// Lets load the content if it doesn't already exist
if (empty($this->_data)) {
// First try to get image data
$query = 'SELECT a.title, a.filename, a.description, a.exto, a.extid, a.metakey, a.metadesc,'
.' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug,'
.' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_categories AS c ON c.id = a.catid'
.' WHERE a.id = '. (int) $this->_id;
$this->_db->setQuery($query, 0, 1);
$this->_data = $this->_db->loadObject();
/*
if (isset($image->description) && $image->description != '') {
$this->_data['description'] = $image->description;
} else {
$this->_data['description'] = '';
}*/
return (boolean) $this->_data;
}
return true;
}
function _initData() {
if (empty($this->_data)) {
$this->_data = '';
return (boolean) $this->_data;
}
return true;
}
}
?>

View File

@ -0,0 +1,115 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Factory;
jimport('joomla.application.component.model');
class PhocaGalleryModelMap extends BaseDatabaseModel
{
function __construct() {
parent::__construct();
$app = Factory::getApplication();
$id = $app->input->get('id', 0, 'int');
$this->setId((int)$id);
$catid = $app->input->get('catid', 0, 'int');
$this->setCatid((int)$catid);
//$post = $app->input->get('get');
}
function setId($id){
$this->_id = $id;
$this->_data = null;
$this->_data_category = null;
}
function setCatid($catid) {
if ($catid == 0) { //SEF
$query = 'SELECT c.catid,'
.' FROM #__phocagallery AS c'
.' WHERE c.id = '. (int) $this->_id;
$this->_db->setQuery($query, 0, 1);
$catid = $this->_db->loadObject();
$this->_catid = $catid->catid;
} else {
$this->_catid = $catid;
}
$this->_data = null;
$this->_data_category = null;
}
function &getData() {
if (!$this->_loadData()) {
$this->_initData();
}
return $this->_data;
}
function _loadData() {
$app = Factory::getApplication();
if (empty($this->_data)) {
$query = 'SELECT a.title, a.filename, a.description, a.latitude, a.longitude, a.zoom, a.geotitle, a.metadesc, a.metakey,'
.' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug,'
.' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_categories AS c ON c.id = a.catid'
.' WHERE a.id = '. (int) $this->_id;
$this->_db->setQuery($query, 0, 1);
$this->_data = $this->_db->loadObject();
return (boolean) $this->_data;
}
return true;
}
function _initData() {
if (empty($this->_data)) {
$this->_data = '';
return (boolean) $this->_data;
}
return true;
}
/*
* Category
*/
function &getDataCategory() {
if (!$this->_loadDataCategory()) {
$this->_initDataCategory();
}
return $this->_data_category;
}
function _loadDataCategory() {
$query = 'SELECT c.title, c.description, c.latitude, c.longitude, c.zoom, c.geotitle,'
.' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug'
.' FROM #__phocagallery_categories AS c'
.' WHERE c.id = '. (int) $this->_catid;
$this->_db->setQuery($query, 0, 1);
$this->_data_category = $this->_db->loadObject();
return (boolean) $this->_data_category;
}
function _initDataCategory() {
if (empty($this->_data_category)) {
$this->_data_category = '';
return (boolean) $this->_data_category;
}
return true;
}
}
?>

View File

@ -0,0 +1,242 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Pagination\PaginationObject;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
jimport('joomla.application.component.model');
use Joomla\String\StringHelper;
// CUSTOM PAGINATON
class PhocaGalleryModelPhocaGalleryLinkImgPagination extends Pagination
{
protected function _buildDataObject()
{
$data = new stdClass;
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$uriS = $uri->toString();
// Build the additional URL parameters string.
$params = '';
if (!empty($this->additionalUrlParams))
{
foreach ($this->additionalUrlParams as $key => $value)
{
$params .= '&' . $key . '=' . $value;
}
}
$data->all = new PaginationObject(Text::_('JLIB_HTML_VIEW_ALL'), $this->prefix);
if (!$this->viewall)
{
$data->all->base = '0';
$data->all->link = $uriS . '' .$params . '&' . $this->prefix . 'limitstart=';
}
// Set the start and previous data objects.
$data->start = new PaginationObject(Text::_('JLIB_HTML_START'), $this->prefix);
$data->previous = new PaginationObject(Text::_('JPREV'), $this->prefix);
if ($this->pagesCurrent > 1)
{
$page = ($this->pagesCurrent - 2) * $this->limit;
// Set the empty for removal from route
// @to do remove code: $page = $page == 0 ? '' : $page;
$data->start->base = '0';
$data->start->link = $uriS . '' . $params . '&' . $this->prefix . 'limitstart=0';
$data->previous->base = $page;
$data->previous->link = $uriS . '' .$params . '&' . $this->prefix . 'limitstart=' . $page;
}
// Set the next and end data objects.
$data->next = new PaginationObject(Text::_('JNEXT'), $this->prefix);
$data->end = new PaginationObject(Text::_('JLIB_HTML_END'), $this->prefix);
if ($this->pagesCurrent < $this->pagesTotal)
{
$next = $this->pagesCurrent * $this->limit;
$end = ($this->pagesTotal - 1) * $this->limit;
$data->next->base = $next;
$data->next->link = $uriS . '' .$params . '&' . $this->prefix . 'limitstart=' . $next;
$data->end->base = $end;
$data->end->link = $uriS . '' .$params . '&' . $this->prefix . 'limitstart=' . $end;
}
$data->pages = array();
$stop = $this->pagesStop;
for ($i = $this->pagesStart; $i <= $stop; $i++)
{
$offset = ($i - 1) * $this->limit;
$data->pages[$i] = new PaginationObject($i, $this->prefix);
if ($i != $this->pagesCurrent || $this->viewall)
{
$data->pages[$i]->base = $offset;
$data->pages[$i]->link = $uriS . '' .$params . '&' . $this->prefix . 'limitstart=' . $offset;
}
else
{
$data->pages[$i]->active = true;
}
}
return $data;
}
}
class PhocaGalleryModelPhocaGalleryLinkImg extends BaseDatabaseModel
{
var $_data = null;
var $_total = null;
var $_pagination = null;
var $_context = 'com_phocagallery.phocagallerylinkimg';
function __construct() {
parent::__construct();
$app = Factory::getApplication();
// Get the pagination request variables
$limit = $app->getUserStateFromRequest( $this->_context.'.list.limit', 'limit', $app->get('list_limit'), 'int' );
$limitstart = $app->getUserStateFromRequest( $this->_context.'.limitstart', 'limitstart', 0, 'int' );
// In case limit has been changed, adjust limitstart accordingly
$limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);
$this->setState('limit', $limit);
$this->setState('limitstart', $limitstart);
}
function getData() {
if (empty($this->_data)) {
$query = $this->_buildQuery();
$this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
}
if (!empty($this->_data)) {
foreach ($this->_data as $key => $value) {
$fileOriginal = PhocaGalleryFile::getFileOriginal($value->filename);
//Let the user know that the file doesn't exists
if (!File::exists($fileOriginal)) {
$this->_data[$key]->filename = Text::_( 'COM_PHOCAGALLERY_IMG_FILE_NOT_EXISTS' );
$this->_data[$key]->fileoriginalexist = 0;
} else {
//Create thumbnails small, medium, large
$refresh_url = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
$fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($value->filename, $refresh_url, 1, 1, 1);
$this->_data[$key]->linkthumbnailpath = $fileThumb['thumb_name_s_no_rel'];
$this->_data[$key]->fileoriginalexist = 1;
}
}
}
return $this->_data;
}
function getTotal() {
if (empty($this->_total)) {
$query = $this->_buildQuery();
$this->_total = $this->_getListCount($query);
}
return $this->_total;
}
function getPagination() {
if (empty($this->_pagination)) {
jimport('joomla.html.pagination');
$this->_pagination = new PhocaGalleryModelPhocaGalleryLinkImgPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );
}
return $this->_pagination;
}
function _buildQuery() {
$where = $this->_buildContentWhere();
$orderby = $this->_buildContentOrderBy();
$query = ' SELECT a.*, cc.title AS category, u.name AS editor, v.average AS ratingavg'
. ' FROM #__phocagallery AS a '
. ' LEFT JOIN #__phocagallery_categories AS cc ON cc.id = a.catid '
. ' LEFT JOIN #__phocagallery_img_votes_statistics AS v ON v.imgid = a.id'
. ' LEFT JOIN #__users AS u ON u.id = a.checked_out '
. $where
. $orderby;
return $query;
}
function _buildContentOrderBy() {
$app = Factory::getApplication();
$filter_order = $app->getUserStateFromRequest( $this->_context.'.filter_order', 'filter_order', 'a.ordering', 'cmd' );
$filter_order_Dir = $app->getUserStateFromRequest( $this->_context.'.filter_order_Dir', 'filter_order_Dir', '', 'word' );
if ($filter_order == 'a.ordering'){
$orderby = ' ORDER BY category, a.ordering '.$filter_order_Dir;
} else {
$orderby = ' ORDER BY '.$filter_order.' '.$filter_order_Dir.' , category, a.ordering ';
}
return $orderby;
}
function _buildContentWhere() {
$app = Factory::getApplication();
$filter_published = $app->getUserStateFromRequest( $this->_context.'.filter_published', 'filter_published', '', 'word' );
$filter_catid = $app->getUserStateFromRequest( $this->_context.'.filter_catid', 'filter_catid', 0, 'int' );
$filter_order = $app->getUserStateFromRequest( $this->_context.'.filter_order', 'filter_order', 'a.ordering', 'cmd' );
$filter_order_Dir = $app->getUserStateFromRequest( $this->_context.'.filter_order_Dir', 'filter_order_Dir', '', 'word' );
$search = $app->getUserStateFromRequest( $this->_context.'.search', 'search', '', 'string' );
$search = StringHelper::strtolower( $search );
$where = array();
$where[] = 'a.published = 1';
$where[] = 'a.approved = 1';
$where[] = 'cc.published = 1';
$where[] = 'cc.approved = 1';
if ($filter_catid > 0) {
$where[] = 'a.catid = '.(int) $filter_catid;
}
if ($search) {
$where[] = 'LOWER(a.title) LIKE '.$this->_db->Quote('%'.$search.'%');
}
if ( $filter_published ) {
if ( $filter_published == 'P' ) {
$where[] = 'a.published = 1';
} else if ($filter_published == 'U' ) {
$where[] = 'a.published = 0';
}
}
$where = ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' );
return $where;
}
}
?>

View File

@ -0,0 +1,54 @@
<?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\Model\BaseDatabaseModel;
jimport('joomla.application.component.model');
class PhocaGalleryModelRatingImgA extends BaseDatabaseModel
{
function rate($data) {
$row = $this->getTable('phocagalleryimgvotes');
if (!$row->bind($data)) {
$this->setError($row->getError());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->published = 1;
if (!$row->id) {
$where = 'imgid = ' . (int) $row->imgid ;
$row->ordering = $row->getNextOrder( $where );
}
if (!$row->check()) {
$this->setError($row->getError());
return false;
}
if (!$row->store()) {
$this->setError($row->getError());
return false;
}
// Update the Vote Statistics
if (!PhocaGalleryRateImage::updateVoteStatistics( $data['imgid'])) {
return false;
}
return true;
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Factory;
if (! class_exists('PhocaGalleryLoader')) {
require_once( JPATH_ADMINISTRATOR.'/components/com_phocagallery/libraries/loader.php');
}
require_once JPATH_ADMINISTRATOR . '/components/com_phocagallery/libraries/autoloadPhoca.php';
// Require the base controller
require_once( JPATH_COMPONENT.'/controller.php' );
phocagalleryimport('phocagallery.category.category');
phocagalleryimport('phocagallery.utils.settings');
phocagalleryimport('phocagallery.path.path');
phocagalleryimport('phocagallery.path.route');
phocagalleryimport('phocagallery.pagination.paginationcategories');
phocagalleryimport('phocagallery.pagination.paginationcategory');
phocagalleryimport('phocagallery.library.library');
phocagalleryimport('phocagallery.text.text');
phocagalleryimport('phocagallery.access.access');
phocagalleryimport('phocagallery.file.file');
phocagalleryimport('phocagallery.image.image');
phocagalleryimport('phocagallery.image.imagefront');
phocagalleryimport('phocagallery.render.renderdetailwindow');
phocagalleryimport('phocagallery.render.renderinfo');
phocagalleryimport('phocagallery.render.renderfront');
phocagalleryimport('phocagallery.utils.utils');
phocagalleryimport('phocagallery.utils.extension');
phocagalleryimport('phocagallery.tag.tag');
phocagalleryimport('phocagallery.html.categoryhtml');
phocagalleryimport('phocagallery.html.grid');
//phocagalleryimport('phocagallery.utils.utils');
//PhocaGalleryRenderFront::correctRender();
// Require specific controller if requested
if($controller = Factory::getApplication()->input->get( 'controller')) {
$path = JPATH_COMPONENT.'/controllers/'.$controller.'.php';
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
}
// Create the controller
$app = Factory::getApplication();
$classname = 'PhocaGalleryController'.ucfirst((string)$controller);
$controller = new $classname( );
// Perform the Request task
$controller->execute(Factory::getApplication()->input->get('task'));
// Redirect if set by the controller
$controller->redirect();
?>

View File

@ -0,0 +1,292 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_phocagallery
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Component\Router\RouterView;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Component\Router\RouterViewConfiguration;
use Joomla\CMS\Component\Router\Rules\MenuRules;
use Joomla\CMS\Component\Router\Rules\StandardRules;
use Joomla\CMS\Component\Router\Rules\NomenuRules;
use Joomla\CMS\Factory;
use Joomla\Database\ParameterType;
if (! class_exists('PhocaGalleryLoader')) {
require_once( JPATH_ADMINISTRATOR.'/components/com_phocagallery/libraries/loader.php');
}
class PhocagalleryRouter extends RouterView
{
protected $noIDs = false;
public function __construct($app = null, $menu = null) {
$params = ComponentHelper::getParams('com_phocagallery');;
$this->noIDs = (bool)$params->get('remove_sef_ids');
$categories = new RouterViewConfiguration('categories');
$categories->setKey('id');
$this->registerView($categories);
$category = new RouterViewConfiguration('category');
$category->setKey('id')->setParent($categories, 'parent_id')->setNestable();
$this->registerView($category);
$detail = new RouterViewConfiguration('detail');
$detail->setKey('id')->setParent($category, 'catid');//->setNestable();
$this->registerView($detail);
$views = array('info', 'comment', 'user');
foreach ($views as $k => $v) {
$item = new RouterViewConfiguration($v);
$item->setName($v)->setParent($detail, 'id')->setParent($category, 'catid');
$this->registerView($item);
}
parent::__construct($app, $menu);
phocagalleryimport('phocagallery.path.routerrules');
phocagalleryimport('phocagallery.category.category');
$this->attachRule(new MenuRules($this));
$this->attachRule(new PhocaGalleryRouterrules($this));
$this->attachRule(new StandardRules($this));
$this->attachRule(new NomenuRules($this));
}
public function getCategorySegment($id, $query) {
// SPECIFIC CASE TAG - tag search output in category view
// 1. components/com_phocagallery/router.php getCategorySegment() - BUILD
// 2. administrator/components/com_phocagallery/libraries/phocadownload/path/routerrules.php build() - BUILD
// 3. administrator/components/com_phocagallery/libraries/phocadownload/path/routerrules.php parse() - PARSE
if ((int)$id == 0 && isset($query['tagid']) && (int)$query['tagid'] > 0) {
//$path[0] = '1:root';
$path[0] = '0:category';
if ($this->noIDs) {
foreach ($path as &$segment) {
list($id, $segment) = explode(':', $segment, 2);
}
}
return $path;
}
$category = PhocaGalleryCategory::getCategoryById($id);
if (isset($category->id)) {
$path = PhocaGalleryCategory::getPath(array(), (int)$category->id, $category->parent_id, $category->title, $category->alias);
//$path = array_reverse($path, true);
//$path = array_reverse($category->getPath(), true);
$path[0] = '1:root';// we don't use root but it is needed when building urls with joomla methods
if ($this->noIDs) {
foreach ($path as &$segment) {
list($id, $segment) = explode(':', $segment, 2);
}
}
return $path;
}
return array();
}
public function getCategoriesSegment($id, $query) {
return $this->getCategorySegment($id, $query);
}
public function getDetailSegment($id, $query) {
if (!strpos($id, ':')) {
$db = Factory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select($dbquery->qn('alias'))
->from($dbquery->qn('#__phocagallery'))
->where('id = ' . $dbquery->q($id));
$db->setQuery($dbquery);
$id .= ':' . $db->loadResult();
}
if ($this->noIDs) {
list($void, $segment) = explode(':', $id, 2);
return array($void => $segment);
}
return array((int) $id => $id);
}
public function getInfoSegment($id, $query) {
if (!strpos($id, ':')) {
$db = Factory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select($dbquery->qn('alias'))
->from($dbquery->qn('#__phocagallery'))
->where('id = ' . $dbquery->q($id));
$db->setQuery($dbquery);
$id .= ':' . $db->loadResult();
}
if ($this->noIDs) {
list($void, $segment) = explode(':', $id, 2);
return array($void => $segment);
}
return array((int) $id => $id);
}
/**
* Method to get the segment(s) for a form
*
* @param string $id ID of the article form to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array|string The segments of this item
*
* @since 3.7.3
*/
public function getFormSegment($id, $query) {
return $this->getArticleSegment($id, $query);
}
/**
* Method to get the id for a category
*
* @param string $segment Segment to retrieve the ID for
* @param array $query The request that is parsed right now
*
* @return mixed The id of this item or false
*/
public function getCategoryId($segment, $query) {
if (!isset($query['id']) && isset($query['view']) && $query['view'] == 'categories') {
$query['id'] = 0;
}
if ($this->noIDs) {
$db = Factory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select($db->quoteName('id'))
->from($db->quoteName('#__phocagallery_categories'))
->where(
[
$db->quoteName('alias') . ' = :alias',
$db->quoteName('parent_id') . ' = :parent_id',
]
)
->bind(':alias', $segment)
->bind(':parent_id', $query['id'], ParameterType::INTEGER);
$db->setQuery($dbquery);
return (int) $db->loadResult();
}
$category = false;
if (isset($query['id'])) {
if ((int)$query['id'] > 0) {
$category = PhocaGalleryCategory::getCategoryById($query['id']);
} else if ((int)$segment > 0) {
$category = PhocaGalleryCategory::getCategoryById((int)$segment);
if (isset($category->id) && (int)$category->id > 0 && $category->parent_id == 0) {
// We don't have root category with 0 so we need to start with segment one
return (int)$category->id;
}
}
if ($category) {
if (!empty($category->subcategories)){
foreach ($category->subcategories as $child) {
if ($this->noIDs) {
if ($child->alias == $segment) {
return $child->id;
}
} else {
// We need to check full alias because ID can be same for Category and Item
$fullAlias = (int)$child->id . '-'.$child->alias;
if ($fullAlias == $segment) {
return $child->id;
}
}
}
}
}
} else {
// --- under test
// We don't have query ID because of e.g. language
// Should not happen because of modifications in build function here: administrator/components/com_phocacart/libraries/phocacart/path/routerrules.php
/*if ((int)$segment > 0) {
$category = PhocaCartCategory::getCategoryById((int)$segment);
if (isset($category->id) && (int)$category->id > 0 && $category->parent_id == 0) {
// We don't have root category with 0 so we need to start with segment one
return (int)$category->id;
}
}*/
// under test
}
return false;
}
public function getCategoriesId($segment, $query) {
return $this->getCategoryId($segment, $query);
}
public function getDetailId($segment, $query) {
if ($this->noIDs)
{
$db = Factory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select($dbquery->qn('id'))
->from($dbquery->qn('#__phocagallery'))
->where('alias = ' . $dbquery->q($segment))
->where('catid = ' . $dbquery->q($query['id']));
$db->setQuery($dbquery);
return (int) $db->loadResult();
}
return (int) $segment;
}
public function parse(&$segments){
return parent::parse($segments);
}
public function build(&$query) {
return parent::build($query);
}
}
function PhocaGalleryBuildRoute(&$query) {
$app = Factory::getApplication();
$router = new PhocagalleryRouter($app, $app->getMenu());
return $router->build($query);
}
function PhocaGalleryParseRoute($segments) {
$app = Factory::getApplication();
$router = new PhocagalleryRouter($app, $app->getMenu());
return $router->parse($segments);
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="_COM_PHOCAGALLERY_CATEGORIES_GROUP">
<message><![CDATA[_COM_PHOCAGALLERY_CATEGORIES_GROUP_DESC]]></message>
</view>
</metadata>

View File

@ -0,0 +1,46 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\FileLayout;
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
$layoutSVG = new FileLayout('svg_definitions', null, array('component' => 'com_phocagallery'));
// SVG Definitions
$d = array();
echo $layoutSVG->render($d);
echo '<div id="phocagallery" class="pg-categories-view'.$this->params->get( 'pageclass_sfx' ).' pg-csv">';
if ( $this->params->get( 'show_page_heading' ) ) {
echo '<div class="page-header"><h1>'. $this->escape($this->params->get('page_heading')) . '</h1></div>';
}
if ($this->t['display_feed'] == 1 || $this->t['display_feed'] == 2 ) {
echo '<div class="pg-top-icons">';
echo '<a href="' . Route::_(PhocaGalleryRoute::getFeedRoute('categories')) . '" title="' . Text::_('COM_PHOCAGALLERY_RSS') . '"><svg class="ph-si ph-si-feed"><use xlink:href="#ph-si-feed"></use></svg></a>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if ($this->t['categories_description'] != '') {
echo '<div class="pg-categories-desc" >'.HTMLHelper::_('content.prepare', $this->t['categories_description']).'</div>';
}
echo $this->loadTemplate('categories');
echo $this->loadTemplate('pagination');
echo PhocaGalleryUtils::getExtInfo();
echo '</div>';

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCAGALLERY_CATEGORIES_LIST_LAYOUT">
<message>
<![CDATA[COM_PHOCAGALLERY_CATEGORIES_LIST_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCAGALLERY_CATEGORIES_LIST_LAYOUT</name>
<description>COM_PHOCAGALLERY_CATEGORIES_LIST_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic" addfieldpath="/administrator/components/com_phocagallery/models/fields" >
<field name="show_pagination_categories" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORIES_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORIES_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_pagination_category" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORY_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORY_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_pagination_limit_categories" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORIES_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORIES_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_pagination_limit_category" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORY_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORY_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_ordering_categories" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORIES_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORIES_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_ordering_images" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORY_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORY_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="@spacer" type="spacer" default="" label="" description="" />
<field name="display_menu_link_title" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_MENU_LINK_TITLE_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_MENU_LINK_TITLE_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="display_cat_name_title" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_PAGE_TITLE_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_PAGE_TITLE_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="display_cat_name_breadcrumbs" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_BREADCRUMBS_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_BREADCRUMBS_DESC">
<option value="0">COM_PHOCAGALLERY_MENU_ITEM_TITLE</option>
<option value="1">COM_PHOCAGALLERY_MENU_ITEM_TITLE_CAT_TITLE</option>
<option value="2">COM_PHOCAGALLERY_MENU_CAT_TITLE</option>
</field>
<field name="show_parent_categories" default="" size="14" type="text" label="COM_PHOCAGALLERY_FIELD_FILTER_PARENT_CATEGORY_ID_LABEL" description="COM_PHOCAGALLERY_FIELD_FILTER_PARENT_CATEGORY_ID_DESC" />
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1,71 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die('Restricted access');
echo '<div class="pg-categories-items-box">';
foreach ($this->categories as $k => $item) {
echo '<div class="pg-category-box">';
if (isset($item->rightdisplaykey) && $item->rightdisplaykey == 0) {
echo '<div class="pg-category-box-image pg-svg-box">';
echo '<svg alt="' . htmlspecialchars($item->title) . '" class="ph-si ph-si-lock-medium pg-image c-Image c-Image--shaded" style="width:' . $this->t['medium_image_width'] . 'px;height:' . $this->t['medium_image_height'] . 'px" itemprop="thumbnail"><use xlink:href="#ph-si-lock"></use></svg>';
echo '</div>';
} else {
if($this->t['image_categories_size'] == 2 || $this->t['image_categories_size'] == 3 || $item->linkthumbnailpath == '') {
// Folders instead of icons
echo '<div class="pg-category-box-image pg-svg-box">';
echo '<a href="' . Route::_($item->link) . '"><svg alt="' . htmlspecialchars($item->title) . '" class="ph-si ph-si-category pg-image c-Image c-Image--shaded" style="width:' . $this->t['imagewidth'] . 'px;height:' . $this->t['imageheight'] . 'px" itemprop="thumbnail"><use xlink:href="#ph-si-category"></use></svg></a>';
echo '</div>';
} else {
// Images
echo '<div class="pg-category-box-image">';
echo '<a href="' . Route::_($item->link) . '">' . HTMLHelper::_('image', $item->linkthumbnailpath, $item->title) . '</a>';
echo '</div>';
}
}
echo '<div class="pg-category-box-info">';
echo '<div class="pg-category-box-title">';
echo '<svg class="ph-si ph-si-category"><use xlink:href="#ph-si-category"></use></svg>';
echo '<a href="' . Route::_($item->link) . '">' . $item->title_self. '</a>';
echo $item->numlinks > 0 ? ' <span class="pg-category-box-count">(' . $item->numlinks . ')</span>' : '';
echo '</div>';
if ($this->t['display_cat_desc_box'] == 1 && $item->description != '') {
echo '<div class="pg-category-box-description">' . strip_tags($item->description) . '</div>';
} else if ($this->t['display_cat_desc_box'] == 2 && $item->description != '') {
echo '<div class="pg-category-box-description">' . (HTMLHelper::_('content.prepare', $item->description, 'com_phocagallery.category')) . '</div>';
}
$this->cv = $item;
echo $this->loadTemplate('rating');
echo '</div>';// pg-category-box-info
echo '</div>';// pg-category-box
}
echo '</div>';
?>

View File

@ -0,0 +1,110 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
phocagalleryimport('phocagallery.render.rendermap');
echo '<div id="phocagallery" class="pg-categories-view'.$this->params->get( 'pageclass_sfx' ).'">';
if ( $this->params->get( 'show_page_heading' ) ) {
echo '<h1>'. $this->escape($this->params->get('page_heading')) . '</h1>';
}
echo '<div id="pg-icons">';
echo PhocaGalleryRenderFront::renderFeedIcon('categories');
echo '</div>';
if ($this->tGeo['categorieslng'] == '' || $this->tGeo['categorieslat'] == '') {
echo '<p>' . Text::_('COM_PHOCAGALLERY_ERROR_MAP_NO_DATA') . '</p>';
} else {
//echo '<script src="http://www.google.com/js api" type="text/javascript"></script>';
$map = new PhocaGalleryRenderMap();
//echo $map->loadApi();
echo '<noscript>'.Text::_('COM_PHOCAGALLERY_ERROR_MAP_ENABLE_JAVASCRIPT').'</noscript>';
echo '<div style="font-size:1px;height:1px;margin:0px;padding:0px;">&nbsp;</div>';
echo '<div align="center" style="margin:0;padding:0;margin-top:10px;">';
$cmw = '';
if ((int)$this->tGeo['categoriesmapwidth'] > 0) {
$cmw = 'width:'.$this->tGeo['categoriesmapwidth'].'px;';
}
echo '<div id="phocaMap" style="margin:0;padding:0;'. $cmw. 'height:'.$this->tGeo['categoriesmapheight'].'px">';
echo '</div></div>';
?><script type='text/javascript'>//<![CDATA[
<?php
echo $map->createMap('phocaMap', 'mapPhocaMap', 'phocaLatLng', 'phocaOptions','tstPhocaMap', 'tstIntPhocaMap');
echo $map->cancelEventF();
echo $map->checkMapF();
echo $map->startMapF();
echo $map->setLatLng( $this->tGeo['categorieslat'], $this->tGeo['categorieslng'] );
echo $map->startOptions();
echo $map->setZoomOpt($this->tGeo['categorieszoom']).','."\n";
echo $map->setCenterOpt().','."\n";
echo $map->setTypeControlOpt().','."\n";
echo $map->setNavigationControlOpt().','."\n";
echo $map->setScaleControlOpt(1).','."\n";
echo $map->setScrollWheelOpt(1).','."\n";
echo $map->setDisableDoubleClickZoomOpt(0).','."\n";
echo $map->setMapTypeOpt()."\n";
echo $map->endOptions();
echo $map->setMap();
foreach ($this->categories as $category) {
if ((isset($category->longitude) && $category->longitude != '' && $category->longitude != 0)
&& (isset($category->latitude) && $category->latitude != '' && $category->latitude != 0)) {
if ($category->geotitle == '') {
$category->geotitle = $category->title;
}
$extCategory = PhocaGalleryImage::isExtImage($category->extid);
if ($extCategory) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($category->extw, $category->exth, $this->t['picasa_correct_width'], $this->t['picasa_correct_height']);
$imgLink = HTMLHelper::_( 'image', $category->linkthumbnailpath, str_replace('&raquo;', '-',$category->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height']));
} else {
$imgLink = HTMLHelper::_( 'image', $category->linkthumbnailpath, PhocaGalleryText::strTrimAll(addslashes($category->geotitle )));
}
$text = '<div style="text-align:left">'
.'<table border="0" cellspacing="5" cellpadding="5">'
.'<tr>'
.'<td align="left" colspan="2"><b><a href="'.$category->link.'">'. PhocaGalleryText::strTrimAll(addslashes($category->geotitle)).'</a></b></td>'
.'</tr>'
.'<tr>'
.'<td valign="top" align="left"><a href="'.$category->link.'">'. $imgLink . '</a></td>'
.'<td valign="top" align="left">'. PhocaGalleryText::strTrimAll(addslashes($category->description)).'</td>'
.'</tr></table></div>';
// Markers
$iconOutput = $map->setMarkerIcon(0);
echo $iconOutput['js'];
echo $map->setMarker($category->id, $category->geotitle, $category->description,$category->latitude, $category->longitude, $iconOutput['icon'], $text );
echo $map->setListener();
}
}
echo $map->endMapF();
echo $map->setInitializeF();
?>//]]></script><?php
echo $map->loadApi();
}
echo '<div>&nbsp;</div>';
echo PhocaGalleryUtils::getExtInfo();
echo '</div>';
?>

View File

@ -0,0 +1,137 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
phocagalleryimport('phocagallery.render.rendermap');
echo '<div id="phocagallery" class="pg-categories-view'.$this->params->get( 'pageclass_sfx' ).'">';
if ( $this->params->get( 'show_page_heading' ) ) {
echo '<h1>'. $this->escape($this->params->get('page_heading')) . '</h1>';
}
echo '<div id="pg-icons">';
echo PhocaGalleryRenderFront::renderFeedIcon('categories');
echo '</div>';
if ($this->tGeo['categorieslng'] == '' || $this->tGeo['categorieslat'] == '') {
echo '<p>' . Text::_('COM_PHOCAGALLERY_ERROR_MAP_NO_DATA') . '</p>';
} else {
$id = uniqid();
$map = new PhocaGalleryRenderMaposm($id);
$map->loadAPI();
$map->loadCoordinatesJS();
echo '<div style="font-size:1px;height:1px;margin:0px;padding:0px;">&nbsp;</div>';
echo '<div align="center" style="margin:0;padding:0;margin-top:10px;">';
$cmw = '';
if ((int)$this->tGeo['categoriesmapwidth'] > 0) {
$cmw = 'width:'.$this->tGeo['categoriesmapwidth'].'px;';
}
echo '<div id="phocaGalleryMap'.$id.'" style="margin:0;padding:0;'. $cmw. 'height:'.$this->tGeo['categoriesmapheight'].'px">';
echo '</div></div>';
$map->createMap($this->tGeo['categorieslat'], $this->tGeo['categorieslng'], $this->tGeo['categorieszoom']);
$map->setMapType();
// Markers
jimport('joomla.filter.output');
if (isset($this->categories) && !empty($this->categories)) {
foreach ($this->categories as $category) {
if ((isset($category->longitude) && $category->longitude != '' && $category->longitude != 0)
&& (isset($category->latitude) && $category->latitude != '' && $category->latitude != 0)) {
if ($category->geotitle == '') {
$category->geotitle = $category->title;
}
$extCategory = PhocaGalleryImage::isExtImage($category->extid);
if ($extCategory) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($category->extw, $category->exth, $this->t['picasa_correct_width'], $this->t['picasa_correct_height']);
$imgLink = HTMLHelper::_( 'image', $category->linkthumbnailpath, str_replace('&raquo;', '-',$category->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height']));
} else {
$imgLink = HTMLHelper::_( 'image', $category->linkthumbnailpath, PhocaGalleryText::strTrimAll(addslashes($category->geotitle )));
}
$minWidth = 110;
if (file_exists(JPATH_SITE . '/'. $category->linkthumbnailpath)) {
$size = getimagesize(JPATH_SITE . '/'. $category->linkthumbnailpath);
$minWidth = $size[0] + 10;
}
$text = '<div style="text-align:left; min-width: '.$minWidth.'px">'
.'<table border="0" cellspacing="5" cellpadding="5">'
.'<tr>'
.'<td align="left" colspan="2"><b><a href="'.$category->link.'">'. PhocaGalleryText::strTrimAll(addslashes($category->geotitle)).'</a></b></td>'
.'</tr>'
.'<tr>'
.'<td valign="top" align="left"><a href="'.$category->link.'">'. $imgLink . '</a></td>'
.'<td valign="top" align="left" class="pg-mapbox-description">'. PhocaGalleryText::strTrimAll(addslashes($category->description)).'</td>'
.'</tr></table></div>';
// Markers
//$iconOutput = $map->setMarkerIcon(0);
//echo $iconOutput['js'];
$map->setMarker($category->id, $category->geotitle, $category->description,$category->latitude, $category->longitude, $text );
}
}
}
$map->renderFullScreenControl();
//$map->renderCurrentPosition();
//$map->renderSearch('', 'topleft');
// Get Lat and Lng TO (first marker)
$lat = $lng = 0;
$mId = '';
$markerIconOptions = array();
if (isset($firstMarker->latitude)) {
$lat = $firstMarker->latitude;
}
if (isset($firstMarker->longitude)) {
$lng = $firstMarker->longitude;
}
if (isset($firstMarker->id)) {
$mId = $id . 'm'.$firstMarker->id;
}
if (isset($firstMarker->markericonoptions)) {
$markerIconOptions = $firstMarker->markericonoptions;
}
$map->renderRouting(0,0,$lat,$lng, $mId, $markerIconOptions);
$map->renderEasyPrint();
$map->renderMap();
}
echo '<div>&nbsp;</div>';
echo PhocaGalleryUtils::getExtInfo();
echo '</div>';
?>

View File

@ -0,0 +1,72 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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 "\n\n";
echo '<div id="phocagallery-categories-detail">'."\n";
for ($i = 0; $i < $this->t['countcategories']; $i++) {
echo '<div style="width:'.$this->t['categoriesboxwidth'].';" class="pg-cats-box-float2">'."\n";
/*echo '<fieldset>'
.' <legend>'
.' <a href="'.$this->categories[$i]->link.'" class="category'.$this->params->get( 'pageclass_sfx' ).'">'.$this->categories[$i]->title_self.'</a> ';
if ($this->categories[$i]->numlinks > 0) {
echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';
}
echo ' </legend>';*/
echo '<div class="pg-cat-img-detail '.$this->t['class_suffix'].'">'."\n"
.'<div class="pg-cat-img-detail-box">'."\n"
.' <table border="0" cellpadding="0" cellspacing="0">'."\n"
.' <tr>'
.' <td style="text-align:center;vertical-align:middle;"><a href="'.$this->categories[$i]->link.'">';
if (isset($this->categories[$i]->extpic) && $this->categories[$i]->extpic) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($this->categories[$i]->extw, $this->categories[$i]->exth, $this->t['picasa_correct_width'], $this->t['picasa_correct_height']);
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;', '-',$this->categories[$i]->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'style' => ''));
} else {
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;','-',$this->categories[$i]->title),array('style' => ''));
}
echo '</a></td>'
.' </tr>'."\n"
.' </table>'."\n"
.'</div>'."\n";
echo '<div style="margin-right:5px;margin-left:'.$this->t['imagewidth'].'px;">'."\n";
echo '<div class="pg-field-table2"><a href="'.$this->categories[$i]->link.'" class="category'.$this->params->get( 'pageclass_sfx' ).'">'.$this->categories[$i]->title_self.'</a> ';
if ($this->categories[$i]->numlinks > 0) {
echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';
}
echo '</div>';
if ($this->categories[$i]->description != '') {
echo '<div class="pg-field-desc2">'.$this->categories[$i]->description.'</div>'."\n";
}
echo '</div>'."\n"
//.'<div style="clear:both;"></div>'
.'</div>'."\n";
echo '</div>'."\n";
}
echo '<div style="clear:both"></div>'."\n";
echo '</div>'."\n";
echo "\n";
?>

View File

@ -0,0 +1,148 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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 "\n\n";
echo '<div id="phocagallery-categories-detail">'."\n";
for ($i = 0; $i < $this->t['countcategories']; $i++) {
// - - - - -
if ( (int)$this->t['categoriescolumns'] == 1 ) {
echo '<div>';
} else {
$float = 0;
foreach ($this->t['begin'] as $k => $v) {
if ($i == $v) {
$float = 1;
}
}
if ($float == 1) {
echo '<div style="'.$this->t['fixedwidthstyle2'].'" class="pg-cats-box-float">';
}
}
// - - - - -
echo '<div class="pg-field">'."\n"
.' <div class="pg-legend">'
.' <a href="'.$this->categories[$i]->link.'" >'.$this->categories[$i]->title_self.'</a> ';
if ($this->categories[$i]->numlinks > 0) {
echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';
}
echo ' </div>'."\n";
echo '<div class="pg-cat-img-detail '.$this->t['class_suffix'].'">'."\n"
.'<div class="pg-cat-img-detail-box">'."\n"
.' <table border="0" cellpadding="0" cellspacing="0">'."\n"
.' <tr>'."\n"
.' <td style="text-align:center;"><a href="'.$this->categories[$i]->link.'">';
if (isset($this->categories[$i]->extpic) && $this->categories[$i]->extpic) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($this->categories[$i]->extw, $this->categories[$i]->exth, $this->t['picasa_correct_width'], $this->t['picasa_correct_height']);
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;', '-',$this->categories[$i]->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'style' => ''));
} else {
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;','-',$this->categories[$i]->title),array('style' => ''));
}
echo '</a></td>'
.' </tr>'."\n"
.' </table>'."\n"
.'</div>'."\n";
echo '<div style="margin-right:5px;margin-left:'.$this->t['imagewidth'].'px;">'."\n";
if ($this->categories[$i]->description != '') {
echo '<div class="pg-field-desc" >'.$this->categories[$i]->description.'</div><p>&nbsp;</p>';
}
echo '<table class="pg-field-table" border="0" cellpadding="0" cellspacing="0" >'."\n";
if ( $this->categories[$i]->username != '') {
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_AUTHOR') .': </td>'
.'<td>'.$this->categories[$i]->username.'</td></tr>'."\n";
}
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_NR_IMG_CATEGORY') .': </td>'
.'<td>'.$this->categories[$i]->numlinks.'</td></tr>'."\n";
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_CATEGORY_VIEWED') .': </td>'
.'<td>'.$this->categories[$i]->hits.'x</td></tr>'."\n";
// Rating
if ($this->t['displayrating'] == 1) {
$votesCount = $votesAverage = $votesWidth = 0;
if (!empty($this->categories[$i]->ratingcount)) {
$votesCount = $this->categories[$i]->ratingcount;
}
if (!empty($this->categories[$i]->ratingaverage)) {
$votesAverage = $this->categories[$i]->ratingaverage;
if ($votesAverage > 0) {
$votesAverage = round(((float)$votesAverage / 0.5)) * 0.5;
$votesWidth = 22 * $votesAverage;
}
}
if ((int)$votesCount > 1) {
$votesText = 'COM_PHOCAGALLERY_VOTES';
} else {
$votesText = 'COM_PHOCAGALLERY_VOTE';
}
echo '<tr><td>' . JText::_('COM_PHOCAGALLERY_RATING'). ': </td>'
.'<td>' . $votesAverage .' / '.$votesCount . ' ' . JText::_($votesText). '</td></tr>'
.'<tr><td>&nbsp;</td>'
.'<td>'
.' <ul class="star-rating">'
.' <li class="current-rating" style="width:'.$votesWidth.'px"></li>'
.' <li><span class="star1"></span></li>';
for ($r = 2;$r < 6;$r++) {
echo '<li><span class="stars'.$r.'"></span></li>';
}
echo '</ul>'
.'</td>'
.'</tr>'."\n";
}
echo '</table>'."\n"
.'</div>'."\n"
//.'<div style="clear:both;"></div>'
.'</div>'."\n"
.'<div style="clear:both;"></div>'
.'</div>'."\n";//fieldset
// - - - - -
if ( (int)$this->t['categoriescolumns'] == 1 ) {
echo '</div>';
} else {
if ($i == $this->t['endfloat']) {
echo '</div><div style="clear:both"></div>'."\n";
} else {
$float = 0;
foreach ($this->t['end'] as $k => $v) {
if ($i == $v) {
$float = 1;
}
}
if ($float == 1) {
echo '</div>'."\n";
}
}
}
// - - - - -
}
echo '</div>'."\n";
echo "\n";
?>

View File

@ -0,0 +1,117 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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 "\n\n";
echo '<div id="phocagallery-categories-detail">'."\n";
for ($i = 0; $i < $this->t['countcategories']; $i++) {
echo '<div style="width:'.$this->t['categoriesboxwidth'].';" class="pg-cats-box-float">'."\n";
echo '<div class="pg-field">'."\n"
.' <div class="pg-legend">'
.' <a href="'.$this->categories[$i]->link.'">'.$this->categories[$i]->title_self.'</a> ';
if ($this->categories[$i]->numlinks > 0) {
echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';
}
echo ' </div>';
echo '<div class="pg-cat-img-detail '.$this->t['class_suffix'].'">'."\n"
.'<div class="pg-cat-img-detail-box">'."\n"
.' <table border="0" cellpadding="0" cellspacing="0">'."\n"
.' <tr>'
.' <td style="text-align:center;"><a href="'.$this->categories[$i]->link.'">';
if (isset($this->categories[$i]->extpic) && $this->categories[$i]->extpic) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($this->categories[$i]->extw, $this->categories[$i]->exth, $this->t['picasa_correct_width'], $this->t['picasa_correct_height']);
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;', '-',$this->categories[$i]->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'style' => ''));
} else {
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;','-',$this->categories[$i]->title),array('style' => ''));
}
echo '</a></td>'
.' </tr>'."\n"
.' </table>'."\n"
.'</div>'."\n";
echo '<div style="margin-right:5px;margin-left:'.$this->t['imagewidth'].'px;">';
if ($this->categories[$i]->description != '') {
echo '<div class="pg-field-desc">'.$this->categories[$i]->description.'</div><p>&nbsp;</p>'."\n";
}
echo '<table class="pg-field-table" border="0" cellpadding="0" cellspacing="0" >';
if ( $this->categories[$i]->username != '') {
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_AUTHOR') .': </td>'
.'<td>'.$this->categories[$i]->username.'</td></tr>'."\n";
}
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_NR_IMG_CATEGORY') .': </td>'
.'<td>'.$this->categories[$i]->numlinks.'</td></tr>'."\n";
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_CATEGORY_VIEWED') .': </td>'
.'<td>'.$this->categories[$i]->hits.'x</td></tr>'."\n";
// Rating
if ($this->t['displayrating'] == 1) {
$votesCount = $votesAverage = $votesWidth = 0;
if (!empty($this->categories[$i]->ratingcount)) {
$votesCount = $this->categories[$i]->ratingcount;
}
if (!empty($this->categories[$i]->ratingaverage)) {
$votesAverage = $this->categories[$i]->ratingaverage;
if ($votesAverage > 0) {
$votesAverage = round(((float)$votesAverage / 0.5)) * 0.5;
$votesWidth = 22 * $votesAverage;
}
}
if ((int)$votesCount > 1) {
$votesText = 'COM_PHOCAGALLERY_VOTES';
} else {
$votesText = 'COM_PHOCAGALLERY_VOTE';
}
echo '<tr><td>' . JText::_('COM_PHOCAGALLERY_RATING'). ': </td>'
.'<td>' . $votesAverage .' / '.$votesCount . ' ' . JText::_($votesText). '</td></tr>'
.'<tr><td>&nbsp;</td>'
.'<td>'
.' <ul class="star-rating">'
.' <li class="current-rating" style="width:'.$votesWidth.'px"></li>'
.' <li><span class="star1"></span></li>';
for ($r = 2;$r < 6;$r++) {
echo '<li><span class="stars'.$r.'"></span></li>';
}
echo '</ul>'
.'</td>'
.'</tr>'."\n";
}
echo '</table>'."\n"
.'</div>'."\n"
//.'<div style="clear:both;"></div>'
.'</div>'."\n"
.'<div style="clear:both;"></div>'
.'</div>'."\n";//fieldset
echo '</div>'."\n";
}
echo '<div style="clear:both"></div>'."\n";
echo '</div>'."\n";
echo "\n";
?>

View File

@ -0,0 +1,71 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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 "\n\n";
echo '<div id="phocagallery-categories-detail">'."\n";
for ($i = 0; $i < $this->t['countcategories']; $i++) {
// - - - - -
if ( (int)$this->t['categoriescolumns'] == 1 ) {
echo '<div>';
} else {
$float = 0;
foreach ($this->t['begin'] as $k => $v) {
if ($i == $v) {
$float = 1;
}
}
if ($float == 1) {
echo '<div style="'.$this->t['fixedwidthstyle2'].'" class="pg-cats-box-float">';
}
}
// - - - - -
echo '<div class="pg-field">'."\n"
.' <div class="pg-legend">'
.' <a href="'.$this->categories[$i]->link.'" >'.$this->categories[$i]->title_self.'</a> ';
if ($this->categories[$i]->numlinks > 0) {
echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';
}
echo ' </div>'."\n";
echo '<div style="clear:both;"></div>'
.'</div>'."\n";//fieldset
// - - - - -
if ( (int)$this->t['categoriescolumns'] == 1 ) {
echo '</div>';
} else {
if ($i == $this->t['endfloat']) {
echo '</div><div style="clear:both"></div>'."\n";
} else {
$float = 0;
foreach ($this->t['end'] as $k => $v) {
if ($i == $v) {
$float = 1;
}
}
if ($float == 1) {
echo '</div>'."\n";
}
}
}
// - - - - -
}
echo '</div>'."\n";
echo "\n";
?>

View File

@ -0,0 +1,51 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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 "\n\n";
echo '<div id="phocagallery-categories-detail">'."\n";
echo '<div class="row">';
for ($i = 0; $i < $this->t['countcategories']; $i++) {
//echo '<div style="width:'.$this->t['categoriesboxwidth'].';" class="pg-cats-box-float">'."\n";
echo '<div class="span4 col-xs-6 col-sm-4 col-md-4">';
echo '<div class="pg-cats-box '.$this->t['class_suffix'].'">'."\n"
.'<div class="pg-cats-box-img"><a href="'.$this->categories[$i]->link.'">';
if (isset($this->categories[$i]->extpic) && $this->categories[$i]->extpic) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($this->categories[$i]->extw, $this->categories[$i]->exth, $this->t['picasa_correct_width'], $this->t['picasa_correct_height']);
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;', '-',$this->categories[$i]->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'class' => 'pg-cats-image', 'style' => ''));
} else {
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;', '-',$this->categories[$i]->title), array('class' => 'pg-cats-image', 'style' => ''));
}
echo '</a>'
.'</div>'."\n"
.'<div class="pg-cats-name '.$this->t['class_suffix'].'"><a href="'.$this->categories[$i]->link.'">'.$this->categories[$i]->title_self.'</a> ';
if ($this->categories[$i]->numlinks > 0) {
echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';
}
echo '</div><div style="clear:both"></div>'."\n"
//.'<div style="clear:both;"></div>'
.'</div></div>'."\n";
}
echo '</div>';
//echo '<div style="clear:both"></div>'."\n";
echo '</div>'."\n";
echo "\n";
?>

View File

@ -0,0 +1,66 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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 "\n\n";
for ($i = 0; $i < $this->t['countcategories']; $i++) {
if ( (int)$this->t['categoriescolumns'] == 1 ) {
echo '<table border="0">'."\n";
} else {
$float = 0;
foreach ($this->t['begin'] as $k => $v) {
if ($i == $v) {
$float = 1;
}
}
if ($float == 1) {
echo '<div style="'.$this->t['fixedwidthstyle1'].'" class="pg-cats-box-float"><table>'."\n";
}
}
echo '<tr>'."\n";
echo '<td align="center" valign="middle" style="'.$this->t['imagebg'].';text-align:center;"><div class="pg-imgbg"><a href="'.$this->categories[$i]->link.'">';
if (isset($this->categories[$i]->extpic) && $this->categories[$i]->extpic) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($this->categories[$i]->extw, $this->categories[$i]->exth, $this->t['picasa_correct_width'], $this->t['picasa_correct_height']);
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;', '-',$this->categories[$i]->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'style' => ''));
} else {
echo Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->categories[$i]->linkthumbnailpath, str_replace('&raquo;','-',$this->categories[$i]->title),array('style' => ''));
}
echo '</a></div></td>';
echo '<td><a href="'.$this->categories[$i]->link.'">'.$this->categories[$i]->title.'</a>&nbsp;';
if ($this->categories[$i]->numlinks > 0) {echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';}
echo '</td>';
echo '</tr>'."\n";
if ( (int)$this->t['categoriescolumns'] == 1 ) {
echo '</table>'."\n";
} else {
if ($i == $this->t['endfloat']) {
echo '</table></div><div style="clear:both"></div>'."\n";
} else {
$float = 0;
foreach ($this->t['end'] as $k => $v)
{
if ($i == $v) {
$float = 1;
}
}
if ($float == 1) {
echo '</table></div>'."\n";
}
}
}
}
echo "\n";
?>

View File

@ -0,0 +1,41 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
if ($this->params->get('show_ordering_categories') || $this->params->get('show_pagination_limit_categories') || $this->params->get('show_pagination_categories')) {
echo '<form action="'.htmlspecialchars($this->t['action']).'" method="post" name="adminForm">'. "\n";
if (count($this->categories)) {
echo '<div class="pagination pagination-centered">';
if ($this->params->get('show_ordering_categories')) {
echo Text::_('COM_PHOCAGALLERY_ORDER_FRONT') .'&nbsp;'.$this->t['ordering'];
}
if ($this->params->get('show_pagination_limit_categories')) {
echo Text::_('COM_PHOCAGALLERY_DISPLAY_NUM') .'&nbsp;'.$this->t['pagination']->getLimitBox();
}
if ($this->params->get('show_pagination_categories')) {
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="categories" />';
echo HTMLHelper::_( 'form.token' );
echo '</form>';
echo '<div class="ph-cb"></div>';
} else {
echo '<div class="ph-cb"></div>';
}
?>

View File

@ -0,0 +1,47 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
// Rating
if ($this->t['display_rating'] == 1) {
$votesCount = $votesAverage = $votesWidth = 0;
if (!empty($this->cv->ratingcount)) {
$votesCount = $this->cv->ratingcount;
}
if (!empty($this->cv->ratingaverage)) {
$votesAverage = $this->cv->ratingaverage;
if ($votesAverage > 0) {
$votesAverage = round(((float)$votesAverage / 0.5)) * 0.5;
$votesWidth = 16 * $votesAverage;
}
}
if ((int)$votesCount > 1) {
$votesText = 'COM_PHOCAGALLERY_VOTES';
} else {
$votesText = 'COM_PHOCAGALLERY_VOTE';
}
echo '<div class="pg-categories-box-rating">'
/*.'<div>' . JText::_('COM_PHOCAGALLERY_RATING'). ': '
. $votesAverage .' / '.$votesCount . ' ' . JText::_($votesText). '</div>'*/
.' <div><ul class="star-rating-small">'
.' <li class="current-rating" style="width:'.$votesWidth.'px"></li>'
.' <li><span class="star1"></span></li>';
for ($r = 2;$r < 6;$r++) {
echo '<li><span class="stars'.$r.'"></span></li>';
}
echo '</ul></div></div>'."\n";
}
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,158 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Document\Feed\FeedItem;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Uri\Uri;
jimport( 'joomla.application.component.view');
phocagalleryimport( 'phocagallery.ordering.ordering');
phocagalleryimport( 'phocagallery.picasa.picasa');
phocagalleryimport( 'phocagallery.facebook.fbsystem');
class PhocaGalleryViewCategories extends HtmlView
{
function display($tpl = null) {
$app = Factory::getApplication();
$user = Factory::getUser();
$userLevels = implode (',', $user->getAuthorisedViewLevels());
$db = Factory::getDBO();
$menu = $app->getMenu();
$document = Factory::getDocument();
$params = $app->getParams();
// Specific category
$id = $app->input->get('id', 0, 'int');
// Params
$categories = $params->get( 'feed_cat_ids', '' );
$ordering = $params->get( 'feed_img_ordering', 6 );
$imgCount = $params->get( 'feed_img_count', 5 );
$feedTitle = $params->get( 'feed_title', Text::_('COM_PHOCAGALLERY_GALLERY') );
$t['picasa_correct_width_m'] = (int)$params->get( 'medium_image_width', 256 );
$t['picasa_correct_height_m'] = (int)$params->get( 'medium_image_height', 192 );
$document->setTitle($this->escape( html_entity_decode($feedTitle)));
if($id > 0) {
$wheres[] = ' c.id ='.(int)$id;
} else {
if (!empty($categories) && count($categories) > 1) {
\Joomla\Utilities\ArrayHelper::toInteger($categories);
$categoriesString = implode(',', $categories);
$wheres[] = ' c.id IN ( '.$categoriesString.' ) ';
} else if ((int)$categories > 0) {
$wheres[] = ' c.id IN ( '.$categories.' ) ';
}
}
$imageOrdering = PhocaGalleryOrdering::getOrderingString($ordering, 6);
$wheres[] = ' a.published = 1';
$wheres[] = ' a.approved = 1';
$wheres[] = ' c.published = 1';
$wheres[] = ' c.approved = 1';
$wheres[] = ' c.access IN ('.$userLevels.')';
$u = " (c.accessuserid LIKE '%0%' OR c.accessuserid LIKE '%-1%' OR c.accessuserid LIKE '%,".(int)$user->id."' OR c.accessuserid LIKE '".(int)$user->id.",%' OR c.accessuserid LIKE '%,".(int)$user->id.",%' OR c.accessuserid =".(int)$user->id.") ";
$e = 'c.accessuserid IS NULL';
$wheres[] = ' CASE WHEN c.accessuserid IS NOT NULL THEN '.$u.' ELSE '.$e.' END';
$query = 'SELECT a.*, c.alias as catalias, c.title as categorytitle'
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_categories AS c ON a.catid = c.id'
. ' WHERE ' . implode( ' AND ', $wheres )
.$imageOrdering['output'];
$db->setQuery( $query , 0, $imgCount );
$images = $db->loadObjectList( );
foreach ($images as $keyI => $value) {
$item = new FeedItem();
$title = $this->escape( $value->title );
$title = html_entity_decode( $title );
$item->title = $title;
$link = PhocaGalleryRoute::getCategoryRoute($value->catid, $value->catalias);
$item->link = Route::_($link);
// imgDate
$imgDate = '';
$imgDate = HTMLHelper::Date($value->date, "Y-m-d h:m:s");
if ($imgDate != '') {
$item->date = $imgDate;
}
$item->description = '';
if ($value->description != '') {
$item->description .= '<div>'.$value->description.'</div>';
}
$extImage = false;
if (isset($value->extid)) {
$extImage = PhocaGalleryImage::isExtImage($value->extid);
}
// Trying to fix but in Joomla! method $this->_relToAbs - it cannot work with JRoute links :-(
$itemL = str_replace(Uri::base(true), '', $item->link);
if (substr($itemL, 0, 1) == '/') {
$itemL = substr_replace($itemL, '', 0, 1);
}
$itemL = Uri::base().$itemL;
// Should really not happen
$itemLTmp = str_replace('http://', '', $itemL);
$pos = stripos($itemLTmp, '//');
if ($pos !== false) {
$itemLTmp = str_replace('//', '/', $itemLTmp);
$itemL = 'http://'.$itemLTmp;
}
// - - - - - - - - - - -
if ($extImage) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($value->extw, $value->exth, $t['picasa_correct_width_m'], $t['picasa_correct_height_m']);
$imgLink = $value->extm;
//$i = '<div><a href="'.JRoute::_($link).'"><img src="'.$imgLink .'" border="0" width="'.$correctImageRes['width'].'" height="'.$correctImageRes['height'].'" /></a></div>';
$i = '<div><a href="'.$itemL.'"><img src="'.$imgLink .'" border="0" /></a></div>';
} else {
$imgLink = PhocaGalleryImageFront::displayCategoryImageOrNoImage($value->filename, 'medium');
$i = '<div><a href="'.$itemL.'"><img src="'. /*JUri::base(true) .*/ $imgLink.'" border="0" /></a></div>';
}
$item->description .= $i;
$item->category = $value->categorytitle;
/*if ($value->author != '') {
$item->author = $value->author;
}*/
$document->addItem( $item );
}
}
}
?>

View File

@ -0,0 +1,522 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 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\Filesystem\File;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.file' );
phocagalleryimport('phocagallery.access.access');
phocagalleryimport('phocagallery.path.path');
phocagalleryimport('phocagallery.file.file');
phocagalleryimport('phocagallery.render.renderinfo');
phocagalleryimport('phocagallery.picasa.picasa');
phocagalleryimport('phocagallery.image.imagefront');
phocagalleryimport('phocagallery.ordering.ordering');
phocagalleryimport('phocagallery.render.rendermaposm');
class PhocaGalleryViewCategories extends HtmlView
{
public $t;
protected $params;
public $cv;
public function display($tpl = null) {
$app = Factory::getApplication();
$user = Factory::getUser();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$path = PhocaGalleryPath::getPath();
$this->params = $app->getParams();
$this->tGeo = array();
$this->t = array();
$this->itemId = $app->input->get('Itemid', 0, 'int');
$document = Factory::getDocument();
$library = PhocaGalleryLibrary::getLibrary();
$this->t['action'] = $uri->toString();
// CSS
PhocaGalleryRenderFront::renderAllCSS();
// Params
$this->t['display_name'] = 1;//$this->params->get( 'display_name', 1);
$this->t['image_categories_size'] = $this->params->get( 'image_categories_size', 1);
$display_categories_geotagging = $this->params->get( 'display_categories_geotagging', 0 );
$display_access_category = $this->params->get( 'display_access_category', 1 );
$display_empty_categories = $this->params->get( 'display_empty_categories', 0 );
$hideCatArray = explode( ',', trim( $this->params->get( 'hide_categories', '' ) ) );
$showCatArray = explode( ',', trim( $this->params->get( 'show_categories', '' ) ) );
$showParentCatArray = explode( ',', trim( $this->params->get( 'show_parent_categories', '' ) ) );
$this->t['categoriesimageordering'] = $this->params->get( 'categories_image_ordering', 10 );
$this->t['categoriesdisplayavatar'] = $this->params->get( 'categories_display_avatar');
$this->t['categories_description'] = $this->params->get( 'categories_description', '' );
$this->t['phocagallery_width'] = $this->params->get( 'phocagallery_width', '');
$this->t['phocagallery_center'] = $this->params->get( 'phocagallery_center', 0);
$this->t['display_rating'] = $this->params->get( 'display_rating', 0 );
$this->t['categories_box_space'] = $this->params->get( 'categories_box_space', '');
$this->t['display_cat_desc_box'] = $this->params->get( 'display_cat_desc_box', 0);
//$this->t['char_cat_length_name'] = $this->params->get( 'char_cat_length_name', 9);
//$this->t['categories_mosaic_images'] = $this->params->get( 'categories_mosaic_images', 0);
//$this->t['diff_thumb_height'] = $this->params->get( 'diff_thumb_height', 0 );
$this->t['responsive'] = $this->params->get( 'responsive', 0 );
$this->t['bootstrap_icons'] = $this->params->get( 'bootstrap_icons', 0 );
$this->t['equal_heights'] = $this->params->get( 'equal_heights', 0 );
$this->t['masonry_center'] = $this->params->get( 'masonry_center', 0 );
$this->t['map_type'] = $this->params->get( 'map_type', 2 );
$this->t['display_feed'] = $this->params->get('display_feed', 1);
$this->t['medium_image_width'] = $this->params->get( 'medium_image_width', 256 );
$this->t['medium_image_height'] = $this->params->get( 'medium_image_height', 192 );
// L E G A C Y ===
/*$this->t['equalpercentagewidth'] = $this->params->get( 'equal_percentage_width', 1);
$this->t['categoriesboxwidth'] = $this->params->get( 'categories_box_width','33%');
$this->t['categoriescolumns'] = $this->params->get( 'categories_columns', 1 );
$this->t['displayrating'] = $this->params->get( 'display_rating', 0 );
$this->t['display_image_categories'] = $this->params->get( 'display_image_categories', 1 );
if ($this->t['display_image_categories'] == 1) {
} else {
// If legacy no different height, no mosaic
$this->t['diff_thumb_height'] = 0;
$this->t['categories_mosaic_images'] = 0;
}*/
// END L E G A C Y ===
switch($this->t['image_categories_size']) {
// medium
case 1:
case 3:
$this->t['picasa_correct_width'] = (int)$this->params->get( 'medium_image_width', 256 );
$this->t['picasa_correct_height'] = (int)$this->params->get( 'medium_image_height', 192 );
$this->t['imagewidth'] = (int)$this->params->get( 'medium_image_width', 256 );
$this->t['imageheight'] = (int)$this->params->get( 'medium_image_height', 192 );
$this->t['class_suffix'] = 'medium';
/*if ($this->t['categories_mosaic_images'] == 1) {
$this->t['imagewidth'] = (int)$this->params->get( 'medium_image_width', 256 ) * 3;
$this->t['imageheight'] = (int)$this->params->get( 'medium_image_height', 192 ) * 2;
}*/
break;
// small
case 0:
case 2:
default:
$this->t['picasa_correct_width'] = (int)$this->params->get( 'small_image_width', 128 );
$this->t['picasa_correct_height'] = (int)$this->params->get( 'small_image_height', 96 );
$this->t['imagewidth'] = (int)$this->params->get( 'small_image_width', 128 );
$this->t['imageheight'] = (int)$this->params->get( 'small_image_height', 96 );
$this->t['class_suffix'] = 'small';
/*if ($this->t['categories_mosaic_images'] == 1) {
$this->t['imagewidth'] = (int)$this->params->get( 'small_image_width', 128 ) * 3;
$this->t['imageheight'] = (int)$this->params->get( 'small_image_height', 96 ) * 2;
}*/
break;
}
$this->t['boxsize'] = PhocaGalleryImage::setBoxSize($this->t, 1);
// Image next to Category in Categories View is ordered by Random as default
$categoriesImageOrdering = PhocaGalleryOrdering::getOrderingString($this->t['categoriesimageordering']);
// MODEL
$model = $this->getModel();
$this->t['ordering'] = $model->getOrdering();
$this->categories = $this->get('data');
// Add link and unset the categories which user cannot see (if it is enabled in params)
// If it will be unset while access view, we must sort the keys from category array - ACCESS
$unSet = 0;
foreach ($this->categories as $key => $item) {
// Unset empty categories if it is set
if ($display_empty_categories == 0) {
if($this->categories[$key]->numlinks < 1) {
unset($this->categories[$key]);
$unSet = 1;
continue;
}
}
// Set only selected category ID
if (!empty($showCatArray[0]) && is_array($showCatArray)) {
$unSetHCA = 0;
foreach ($showCatArray as $valueHCA) {
if((int)trim($valueHCA) == $this->categories[$key]->id) {
$unSetHCA = 0;
$unSet = 0;
break;
} else {
$unSetHCA = 1;
$unSet = 1;
}
}
if ($unSetHCA == 1) {
unset($this->categories[$key]);
continue;
}
}
// Unset hidden category
if (!empty($hideCatArray) && is_array($hideCatArray)) {
$unSetHCA = 0;
foreach ($hideCatArray as $valueHCA) {
if((int)trim($valueHCA) == $this->categories[$key]->id) {
unset($this->categories[$key]);
$unSet = 1;
$unSetHCA = 1;
break;
}
}
if ($unSetHCA == 1) {
continue;
}
}
// Unset not set parent categories - only categories which have specific parent id will be displayed
if (!empty($showParentCatArray[0]) && is_array($showParentCatArray)) {
$unSetPHCA = 0;
foreach ($showParentCatArray as $valuePHCA) {
if((int)trim($valuePHCA) == $this->categories[$key]->parent_id) {
$unSetPHCA = 0;
//$unSet = 0;
break;
} else {
$unSetPHCA = 1;
$unSet = 1;
}
}
if ($unSetPHCA == 1) {
unset($this->categories[$key]);
continue;
}
}
// Link
$this->categories[$key]->link = PhocaGalleryRoute::getCategoryRoute($item->id, $item->alias);
// USER RIGHT - ACCESS - - - - -
// First Check - check if we can display category
$rightDisplay = 1;
if (!empty($this->categories[$key])) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->categories[$key]->accessuserid, $this->categories[$key]->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), $display_access_category);
}
// Second Check - if we can display hidden category, set Key icon for them
// if we don't have access right to see them
// Display Key Icon (in case we want to display unaccessable categories in list view)
$rightDisplayKey = 1;
if ($display_access_category == 1) {
// we simulate that we want not to display unaccessable categories
// so if we get rightDisplayKey = 0 then the key will be displayed
if (!empty($this->categories[$key])) {
$rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $this->categories[$key]->accessuserid, $this->categories[$key]->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0); // 0 - simulation
}
}
// Is Ext Image Album?
$extCategory = PhocaGalleryImage::isExtImage($this->categories[$key]->extid, $this->categories[$key]->extfbcatid);
// DISPLAY AVATAR, IMAGE(ordered), IMAGE(not ordered, not recursive) OR FOLDER ICON
$displayAvatar = 0;
if($this->t['categoriesdisplayavatar'] == 1 && isset($this->categories[$key]->avatar) && $this->categories[$key]->avatar !='' && $this->categories[$key]->avatarapproved == 1 && $this->categories[$key]->avatarpublished == 1) {
$sizeString = PhocaGalleryImageFront::getSizeString($this->t['image_categories_size']);
$pathAvatarAbs = $path->avatar_abs .'thumbs/phoca_thumb_'.$sizeString.'_'. $this->categories[$key]->avatar;
$pathAvatarRel = $path->avatar_rel . 'thumbs/phoca_thumb_'.$sizeString.'_'. $this->categories[$key]->avatar;
if (File::exists($pathAvatarAbs)){
$this->categories[$key]->linkthumbnailpath = $pathAvatarRel;
$this->categories[$key]->rightdisplaykey = $rightDisplayKey;
$displayAvatar = 1;
}
}
if ($displayAvatar == 0) {
if ($extCategory) {
$this->categories[$key]->rightdisplaykey = $rightDisplayKey;
if ($this->t['categoriesimageordering'] != 10) {
$imagePic = PhocaGalleryImageFront::getRandomImageRecursive($this->categories[$key]->id, $categoriesImageOrdering, 1);
if ($rightDisplayKey == 0) {
$imagePic = new StdClass();
$imagePic->exts = '';
$imagePic->extm = '';
$imagePic->extw = '';
$imagePic->exth = '';
}
$fileThumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($imagePic->exts,$imagePic->extm, $imagePic->extw,$imagePic->exth, $this->t['image_categories_size'], $rightDisplayKey);
if ($rightDisplayKey == 0) {
$this->categories[$key]->rightdisplaykey = 0;// Lock folder will be displayed
$this->categories[$key]->linkthumbnailpath = '';
} else if (!$fileThumbnail) {
$this->categories[$key]->linkthumbnailpath = '';// Standard folder will be displayed
} else {
$this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel;
$this->categories[$key]->extw = $fileThumbnail->extw;
$this->categories[$key]->exth = $fileThumbnail->exth;
$this->categories[$key]->extpic = $fileThumbnail->extpic;
}
} else {
$fileThumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($this->categories[$key]->exts,$this->categories[$key]->extm, $this->categories[$key]->extw, $this->categories[$key]->exth, $this->t['image_categories_size'], $rightDisplayKey);
if ($rightDisplayKey == 0) {
$this->categories[$key]->rightdisplaykey = 0;// Lock folder will be displayed
$this->categories[$key]->linkthumbnailpath = '';
} else if (!$fileThumbnail) {
$this->categories[$key]->linkthumbnailpath = '';// Standard folder will be displayed
} else {
$this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel;
$this->categories[$key]->extw = $fileThumbnail->extw;
$this->categories[$key]->exth = $fileThumbnail->exth;
$this->categories[$key]->extpic = $fileThumbnail->extpic;
}
}
} else {
$this->categories[$key]->rightdisplaykey = $rightDisplayKey;
if (isset($item->image_id) && $item->image_id > 0) {
// User has selected image in category edit
$selectedImg = PhocaGalleryImageFront::setFileNameByImageId((int)$item->image_id);
if (isset($selectedImg->filename) && ($selectedImg->filename != '' && $selectedImg->filename != '-')) {
$fileThumbnail = PhocaGalleryImageFront::displayCategoriesImageOrFolder($selectedImg->filename, $this->t['image_categories_size'], $rightDisplayKey);
if ($rightDisplayKey == 0) {
$this->categories[$key]->rightdisplaykey = 0;// Lock folder will be displayed
$this->categories[$key]->linkthumbnailpath = '';
} else if (!$fileThumbnail) {
$this->categories[$key]->linkthumbnailpath = '';// Standard folder will be displayed
} else {
$this->categories[$key]->filename = $selectedImg->filename;
$this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel;
}
} else if (isset($selectedImg->exts) && isset($selectedImg->extm) && $selectedImg->exts != '' && $selectedImg->extm != '') {
$fileThumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($selectedImg->exts, $selectedImg->extm, $selectedImg->extw, $selectedImg->exth, $this->t['image_categories_size'], $rightDisplayKey);
if ($rightDisplayKey == 0) {
$this->categories[$key]->rightdisplaykey = 0;// Lock folder will be displayed
$this->categories[$key]->linkthumbnailpath = '';
} else if (!$fileThumbnail) {
$this->categories[$key]->linkthumbnailpath = '';// Standard folder will be displayed
} else {
$this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel;
$this->categories[$key]->extw = $fileThumbnail->extw;
$this->categories[$key]->exth = $fileThumbnail->exth;
$this->categories[$key]->extpic = $fileThumbnail->extpic;
}
}
} else {
// Standard Internal Image
if ($this->t['categoriesimageordering'] != 10) {
$this->categories[$key]->filename = PhocaGalleryImageFront::getRandomImageRecursive($this->categories[$key]->id, $categoriesImageOrdering);
}
$fileThumbnail = PhocaGalleryImageFront::displayCategoriesImageOrFolder($this->categories[$key]->filename, $this->t['image_categories_size'], $rightDisplayKey);
if ($rightDisplayKey == 0) {
$this->categories[$key]->rightdisplaykey = 0;// Lock folder will be displayed
$this->categories[$key]->linkthumbnailpath = '';
} else if (!$fileThumbnail) {
$this->categories[$key]->linkthumbnailpath = '';// Standard folder will be displayed
} else {
$this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel;
}
}
}
}
if ($rightDisplay == 0) {
unset($this->categories[$key]);
$unSet = 1;
}
// - - - - - - - - - - - - - - -
}
// ACCESS - - - - - -
// In case we unset some category from the list, we must sort the array new
if ($unSet == 1) {
$this->categories = array_values($this->categories);
}
// - - - - - - - - - - - - - - - -
// Do Pagination - we can do it after reducing all unneeded $this->categories, not before
$totalCount = count($this->categories);
$model->setTotal($totalCount);
$this->t['pagination'] = $this->get('pagination');
$this->categories = array_slice($this->categories,(int)$this->t['pagination']->limitstart, (int)$this->t['pagination']->limit);
// - - - - - - - - - - - - - - - -
// L E G A C Y ===
/* $this->t['countcategories'] = count($this->categories);
$this->t['begin'] = array();
$this->t['end'] = array();
$this->t['begin'][0] = 0;// first
// Prevent from division by zero error message
if ((int)$this->t['categoriescolumns'] == 0) {
$this->t['categoriescolumns'] = 1;
}
$this->t['begin'][1] = ceil ($this->t['countcategories'] / (int)$this->t['categoriescolumns']);
$this->t['end'][0] = $this->t['begin'][1] -1;
for ( $j = 2; $j < (int)$this->t['categoriescolumns']; $j++ ) {
$this->t['begin'][$j] = ceil(($this->t['countcategories'] / (int)$this->t['categoriescolumns']) * $j);
$this->t['end'][$j-1] = $this->t['begin'][$j] - 1;
}
$this->t['end'][$j-1] = $this->t['countcategories'] - 1;// last
$this->t['endfloat'] = $this->t['countcategories'] - 1;
if($this->t['equalpercentagewidth'] == 1) {
$fixedWidth = 100 / (int)$this->t['categoriescolumns'];
$this->t['fixedwidthstyle1'] = 'width:'.$fixedWidth.'%;';
$this->t['fixedwidthstyle2'] = 'width:'.$fixedWidth.'%;';
} else {
$this->t['fixedwidthstyle1'] = '';//'margin: 10px;';
$this->t['fixedwidthstyle2'] = '';//'margin: 0px;';
}*/
// END L E G A C Y ===
$this->_prepareDocument();
if ($display_categories_geotagging == 1) {
// Params
$this->tGeo['categorieslng'] = $this->params->get( 'categories_lng', '' );
$this->tGeo['categorieslat'] = $this->params->get( 'categories_lat', '' );
$this->tGeo['categorieszoom'] = $this->params->get( 'categories_zoom', 2 );
$this->tGeo['googlemapsapikey'] = $this->params->get( 'google_maps_api_key', '' );
$this->tGeo['categoriesmapwidth'] = $this->params->get( 'categories_map_width', '' );
$this->tGeo['categoriesmapheight'] = $this->params->get( 'categorires_map_height', 500 );
// If no lng and lat will be added, Phoca Gallery will try to find it in categories
if ($this->tGeo['categorieslat'] == '' || $this->tGeo['categorieslng'] == '') {
phocagalleryimport('phocagallery.geo.geo');
$latLng = PhocaGalleryGeo::findLatLngFromCategory($this->categories);
$this->tGeo['categorieslng'] = $latLng['lng'];
$this->tGeo['categorieslat'] = $latLng['lat'];
}
$this->tmplGeo = $this->tGeo;
if ($this->t['map_type'] == 2) {
parent::display('map_osm');
} else {
parent::display('map');
}
} else {
parent::display($tpl);
}
}
protected function _prepareDocument() {
$app = Factory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
$title = null;
$this->t['gallerymetakey'] = $this->params->get( 'gallery_metakey', '' );
$this->t['gallerymetadesc'] = $this->params->get( 'gallery_metadesc', '' );
$menu = $menus->getActive();
/*if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', Text::_('JGLOBAL_ARTICLES'));
}*/
if ($menu && $this->params->get('display_menu_link_title', 1) == 1) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
}
$title = $this->params->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['gallerymetadesc'] != '') {
$this->document->setDescription($this->t['gallerymetadesc']);
} else if ($this->params->get('menu-meta_description', '')) {
$this->document->setDescription($this->params->get('menu-meta_description', ''));
}
if ($this->t['gallerymetakey'] != '') {
$this->document->setMetadata('keywords', $this->t['gallerymetakey']);
} else if ($this->params->get('menu-meta_keywords', '')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords', ''));
}
if ($app->get('MetaTitle') == '1' && $this->params->get('menupage_title', '')) {
$this->document->setMetaData('title', $this->params->get('page_title', ''));
}
// Features added by Bernard Gilly - alphaplug.com
// load external plugins
//$dispatcher = JDispatcher::getInstance();
PluginHelper::importPlugin('phocagallery');
$results = $app->triggerEvent('onViewCategories', array() );
}
}
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="_COM_PHOCAGALLERY_CATEGORY_GROUP">
<message>
<![CDATA[_COM_PHOCAGALLERY_CATEGORY_GROUP_DESC]]>
</message>
</view>
</metadata>

View File

@ -0,0 +1,298 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\FileLayout;
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Component\ComponentHelper;
phocagalleryimport('phocagallery.render.rendertabs');
$layoutSVG = new FileLayout('svg_definitions', null, array('component' => 'com_phocagallery'));
$layoutC = new FileLayout('comments', null, array('component' => 'com_phocagallery'));
// SVG Definitions
$d = array();
echo $layoutSVG->render($d);
echo '<div id="phocagallery" class="pg-category-view'.$this->params->get( 'pageclass_sfx' ).' pg-cv">';
// Heading
$heading = '';
if ($this->params->get( 'page_heading' ) != '') {
$heading .= $this->params->get( 'page_heading' );
}
// Category Name Title
if ( $this->t['display_cat_name_title'] == 1) {
if (isset($this->category->title) && $this->category->title != '') {
if ($heading != '') {
$heading .= ' - ';
}
$heading .= $this->category->title;
}
}
// Pagetitle
if ($this->t['show_page_heading'] != 0) {
if ( $heading != '') {
echo '<div class="page-header"><h1>'. $this->escape($heading) . '</h1></div>';
}
}
// Feed
if ($this->t['display_feed'] == 1 || $this->t['display_feed'] == 3) {
if (isset($this->category->id) && (int)$this->category->id > 0 && isset($this->category->alias)) {
echo '<div class="pg-top-icons">';
echo '<a href="' . Route::_(PhocaGalleryRoute::getFeedRoute('category'), $this->category->id, $this->category->alias) . '" title="' . Text::_('COM_PHOCAGALLERY_RSS') . '"><svg class="ph-si ph-si-feed"><use xlink:href="#ph-si-feed"></use></svg></a>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
}
// Category Description
if (isset($this->category->description) && $this->category->description != '' ) {
echo '<div class="pg-category-desc">'. HTMLHelper::_('content.prepare', $this->category->description) .'</div>'. "\n";
}
$this->checkRights = 1;
if ((int)$this->tagId > 0) {
// Search by tags
$this->checkRights = 1;
// Categories View in Category View
if ($this->t['display_categories_cv']) {
echo $this->loadTemplate('categories');
}
echo $this->loadTemplate('images');
echo $this->loadTemplate('pagination');
} else {
// Standard category displaying
$this->checkRights = 0;
// Categories View in Category View
if ($this->t['display_back_button_cv'] == 1 || $this->t['display_categories_cv'] == 1) {
echo $this->loadTemplate('categories');
}
// Rendering images
echo $this->loadTemplate('images');
echo $this->loadTemplate('pagination');
if ($this->t['displaytabs'] > 0) {
$tabItems = array();
$tabItemsI = 0;
$tabs = new PhocaGalleryRenderTabs();
echo $tabs->startTabs();
if ((int)$this->t['display_rating'] == 1) {
$tabItems[$tabItemsI] = array('id' => 'pgvotes', 'title' => Text::_('COM_PHOCAGALLERY_RATING'), 'image' => 'vote', 'icon' => 'star');
$tabItemsI++;
}
if ((int)$this->t['display_comment'] == 1) {
//if ($this->t['externalcommentsystem'] == 2) {
// $tabItems[$tabItemsI] = array('id' => 'pgcomments', 'title' => JText::_('COM_PHOCAGALLERY_COMMENTS'), 'image' => 'comment-fb-small', 'icon' => 'comment-fb');
//} else {
$tabItems[$tabItemsI] = array('id' => 'pgcomments', 'title' => Text::_('COM_PHOCAGALLERY_COMMENTS'), 'image' => 'comment', 'icon' => 'comment');
//}
$tabItemsI++;
}
if ((int)$this->t['displaycategorystatistics'] == 1) {
$tabItems[$tabItemsI] = array('id' => 'pgstatistics', 'title' => Text::_('COM_PHOCAGALLERY_STATISTICS'), 'image' => 'statistics', 'icon' => 'stats');
$tabItemsI++;
}
if ((int)$this->t['displaycategorygeotagging'] == 1) {
if ($this->map['longitude'] == '' || $this->map['latitude'] == '') {
//echo '<p>' . JText::_('COM_PHOCAGALLERY_ERROR_MAP_NO_DATA') . '</p>';
} else {
$tabItems[$tabItemsI] = array('id' => 'pggeotagging', 'title' => Text::_('COM_PHOCAGALLERY_GEOTAGGING'), 'image' => 'geo', 'icon' => 'earth');
$tabItemsI++;
}
}
if ((int)$this->t['displaycreatecat'] == 1) {
$tabItems[$tabItemsI] = array('id' => 'pgnewcategory', 'title' => Text::_('COM_PHOCAGALLERY_CATEGORY'), 'image' => 'subcategories', 'icon' => 'category');
$tabItemsI++;
}
if ((int)$this->t['displayupload'] == 1) {
$tabItems[$tabItemsI] = array('id' => 'pgupload', 'title' => Text::_('COM_PHOCAGALLERY_UPLOAD'), 'image' => 'upload', 'icon' => 'upload');
$tabItemsI++;
}
if ((int)$this->t['ytbupload'] == 1 && $this->t['displayupload'] == 1 ) {
$tabItems[$tabItemsI] = array('id' => 'pgytbupload', 'title' => Text::_('COM_PHOCAGALLERY_YTB_UPLOAD'), 'image' => 'upload-ytb', 'icon' => 'ytb');
$tabItemsI++;
}
if((int)$this->t['enablemultiple'] == 1 && (int)$this->t['displayupload'] == 1) {
$tabItems[$tabItemsI] = array('id' => 'pgmultipleupload', 'title' => Text::_('COM_PHOCAGALLERY_MULTIPLE_UPLOAD'), 'image' => 'upload-multiple', 'icon' => 'upload-multiple');
$tabItemsI++;
}
/*if($this->t['enablejava'] == 1 && (int)$this->t['displayupload'] == 1) {
$tabItems[$tabItemsI] = array('id' => 'pgjavaupload', 'title' => Text::_('COM_PHOCAGALLERY_JAVA_UPLOAD'), 'image' => 'upload-java', 'icon' => 'upload-java');
$tabItemsI++;
}*/
$tabs->setActiveTab(isset($tabItems[$this->t['tab']]['id']) ? $tabItems[$this->t['tab']]['id'] : 0);
echo $tabs->renderTabsHeader($tabItems);
//echo '<div id="phocagallery-pane">';
//echo JHtml::_('tabs.start', 'config-tabs-com_phocagallery-category', array('useCookie'=>1, 'startOffset'=> $this->t['tab']));
if ((int)$this->t['display_rating'] == 1) {
echo $tabs->startTab('pgvotes');
echo $this->loadTemplate('rating');
echo $tabs->endTab();
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('vote', 'media/com_phocagallery/images/icon-vote.png', ''). '&nbsp;'. JText::_('COM_PHOCAGALLERY_RATING'), 'pgvotes' );
}
if ((int)$this->t['display_comment'] == 1) {
//$commentImg = ($this->t['externalcommentsystem'] == 2) ? 'icon-comment-fb' : 'icon-comment';
//echo JHtml::_('tabs.panel', JHtml::_( 'image', 'media/com_phocagallery/images/'.$commentImg.'.png','') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_COMMENTS'), 'pgcomments' );
echo $tabs->startTab('pgcomments');
/*if ($this->t['externalcommentsystem'] == 2) {
echo HTMLHelper::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('comment-fb', 'media/com_phocagallery/images/icon-comment-fb-small.png', ''). '&nbsp;'.Text::_('COM_PHOCAGALLERY_COMMENTS'), 'pgcomments' );
} else {
echo HTMLHelper::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('comment', 'media/com_phocagallery/images/icon-comment.png', ''). '&nbsp;'.Text::_('COM_PHOCAGALLERY_COMMENTS'), 'pgcomments' );
}*/
/*if ($this->t['externalcommentsystem'] == 1) {
if (ComponentHelper::isEnabled('com_jcomments', true)) {
include_once(JPATH_BASE.'/components/com_jcomments/jcomments.php');
echo JComments::showComments($this->category->id, 'com_phocagallery', Text::_('COM_PHOCAGALLERY_CATEGORY') .' '. $this->category->title);
}
} else if($this->t['externalcommentsystem'] == 2) {
echo $this->loadTemplate('comments-fb');
} else {
echo $this->loadTemplate('comments');
}*/
$d = array();
$d['t'] = $this->t;
$d['form']['task'] = 'comment';
$d['form']['view'] = 'category';
$d['form']['controller'] = 'category';
$d['form']['tab'] = $this->t['currenttab']['comment'];
$d['form']['id'] = '';
$d['form']['catid'] = $this->category->slug;
$d['form']['itemid'] = $this->itemId;
echo $layoutC->render($d);
echo $tabs->endTab();
}
if ((int)$this->t['displaycategorystatistics'] == 1) {
//echo JHtml::_('tabs.panel', JHtml::_( 'image', 'media/com_phocagallery/images/icon-statistics.png', '') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_STATISTICS'), 'pgstatistics' );
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('statistics', 'media/com_phocagallery/images/icon-statistics.png', '') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_STATISTICS'), 'pgstatistics' );
echo $tabs->startTab('pgstatistics');
echo $this->loadTemplate('statistics');
echo $tabs->endTab();
}
if ((int)$this->t['displaycategorygeotagging'] == 1) {
if ($this->map['longitude'] == '' || $this->map['latitude'] == '') {
//echo '<p>' . JText::_('COM_PHOCAGALLERY_ERROR_MAP_NO_DATA') . '</p>';
} else {
//echo JHtml::_('tabs.panel', JHtml::_( 'image', 'media/com_phocagallery/images/icon-geo.png','') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_GEOTAGGING'), 'pggeotagging' );
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('geo', 'media/com_phocagallery/images/icon-geo.png', '') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_GEOTAGGING'), 'pggeotagging' );
echo $tabs->startTab('pggeotagging');
if ($this->t['map_type'] == 2){
echo $this->loadTemplate('geotagging_osm');
} else {
echo $this->loadTemplate('geotagging');
}
echo $tabs->endTab();
}
}
if ((int)$this->t['displaycreatecat'] == 1) {
echo $tabs->startTab('pgnewcategory');
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('subcategory', 'media/com_phocagallery/images/icon-subcategories.png', '') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_CATEGORY'), 'pgnewcategory' );
echo $this->loadTemplate('newcategory');
echo $tabs->endTab();
}
if ((int)$this->t['displayupload'] == 1) {
echo $tabs->startTab('pgupload');
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('upload', 'media/com_phocagallery/images/icon-upload.png', '') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_UPLOAD'), 'pgupload' );
echo $this->loadTemplate('upload');
echo $tabs->endTab();
}
if ((int)$this->t['ytbupload'] == 1 && $this->t['displayupload'] == 1 ) {
echo $tabs->startTab('pgytbupload');
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('upload-ytb', 'media/com_phocagallery/images/icon-upload-ytb.png', '') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_YTB_UPLOAD'), 'pgytbupload' );
echo $this->loadTemplate('ytbupload');
echo $tabs->endTab();
}
if((int)$this->t['enablemultiple'] == 1 && (int)$this->t['displayupload'] == 1) {
echo $tabs->startTab('pgmultipleupload');
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('upload-multiple', 'media/com_phocagallery/images/icon-upload-multiple.png', '') . '&nbsp;'.JText::_('COM_PHOCAGALLERY_MULTIPLE_UPLOAD'), 'pgmultipleupload' );
echo $this->loadTemplate('multipleupload');
echo $tabs->endTab();
}
/*if($this->t['enablejava'] == 1 && (int)$this->t['displayupload'] == 1) {
echo $tabs->startTab('pgjavaupload');
//echo JHtml::_('tabs.panel', PhocaGalleryRenderFront::renderIcon('upload-java', 'media/com_phocagallery/images/icon-upload-java.png', ''). '&nbsp;'.JText::_('COM_PHOCAGALLERY_JAVA_UPLOAD'), 'pgjavaupload' );
echo $this->loadTemplate('javaupload');
echo $tabs->endTab();
}*/
echo $tabs->endTabs();
//echo JHtml::_('tabs.end');
//echo '</div>'. "\n";// end phocagallery-pane
}
}
if ($this->t['detail_window'] == 6) {
?><script type="text/javascript">
var gjaks = new SZN.LightBox(dataJakJs, optgjaks);
</script><?php
}
if ($this->t['detail_window'] == 14) {
echo PhocaGalleryRenderDetailWindow::loadPhotoswipeBottom();
}
echo PhocaGalleryUtils::getExtInfo();
echo '</div>';
?>

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCAGALLERY_CATEGORY_LIST_LAYOUT">
<message>
<![CDATA[COM_PHOCAGALLERY_CATEGORY_LIST_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCAGALLERY_CATEGORY_LIST_LAYOUT</name>
<description>COM_PHOCAGALLERY_CATEGORY_LIST_LAYOUT_DESC</description>
<fields name="request">
<fieldset name="request" addfieldpath="/administrator/components/com_phocagallery/models/fields">
<field name="id" type="phocagallerycategory" section="com_phocagallery" default="0" label="COM_PHOCAGALLERY_FIELD_SELECT_CATEGORY_LABEL" description="COM_PHOCAGALLERY_FIELD_SELECT_CATEGORY_DESC" required="true" />
</fieldset>
</fields>
<fields name="params">
<fieldset name="basic" addfieldpath="/administrator/components/com_phocagallery/models/fields" >
<field name="show_pagination_categories" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORIES_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORIES_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_pagination_category" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORY_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_PAGINATION_CATEGORY_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_pagination_limit_categories" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORIES_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORIES_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_pagination_limit_category" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORY_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_SELECT_CATEGORY_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_ordering_categories" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORIES_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORIES_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="show_ordering_images" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORY_VIEW_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_ORDERING_CATEGORY_VIEW_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="@spacer" type="spacer" default="" label="" description="" />
<field name="display_menu_link_title" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_MENU_LINK_TITLE_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_MENU_LINK_TITLE_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="display_cat_name_title" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_PAGE_TITLE_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_PAGE_TITLE_DESC">
<option value="0">COM_PHOCAGALLERY_HIDE</option>
<option value="1">COM_PHOCAGALLERY_DISPLAY</option>
</field>
<field name="display_cat_name_breadcrumbs" type="list" default="0" label="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_BREADCRUMBS_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_CAT_NAME_IN_BREADCRUMBS_DESC">
<option value="0">COM_PHOCAGALLERY_MENU_ITEM_TITLE</option>
<option value="1">COM_PHOCAGALLERY_MENU_ITEM_TITLE_CAT_TITLE</option>
<option value="2">COM_PHOCAGALLERY_MENU_CAT_TITLE</option>
</field>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1,33 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die('Restricted access');
echo '<div id="phocagallery-categories-detail" class="pg-category-categories-top-box">'."\n";
foreach ($this->itemscv as $k => $item) {
echo '<div class="pg-category-categories-top-box-title">';
if ($item->type == 3) {
echo '<svg class="ph-si ph-si-category-top-back"><use xlink:href="#ph-si-back"></use></svg>';
} else {
echo '<svg class="ph-si ph-si-category-top-category"><use xlink:href="#ph-si-category"></use></svg>';
}
echo '<a href="' . Route::_($item->link) . '">' . $item->title. '</a>';
echo $item->numlinks > 0 ? ' <span class="pg-category-box-count">(' . $item->numlinks . ')</span>' : '';
echo '</div>';
}
echo '</div>'."\n";
?>

View File

@ -0,0 +1,53 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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="phocagallery-comments"><?php
echo '<div style="font-size:1px;height:1px;margin:0px;padding:0px;">&nbsp;</div>';//because of IE bug
$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_PHOCAGALLERY_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>
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,112 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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="phocagallery-comments">'. "\n";
echo '<div class="ph-tabs-iefix">&nbsp;</div>';//because of IE bug
if (!empty($this->commentitem)){
$userImage = Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->t['icon_path']. 'icon-user.png','');
$smileys = PhocaGalleryComment::getSmileys();
foreach ($this->commentitem as $itemValue) {
$date = Joomla\CMS\HTML\HTMLHelper::_('date', $itemValue->date, JText::_('DATE_FORMAT_LC2') );
$comment = $itemValue->comment;
$comment = PhocaGalleryComment::bbCodeReplace($comment);
foreach ($smileys as $smileyKey => $smileyValue) {
$comment = str_replace($smileyKey, Joomla\CMS\HTML\HTMLHelper::_( 'image', $this->t['icon_path']. ''.$smileyValue .'.png',''), $comment);
}
echo '<blockquote>'
.'<h4>'.$userImage.'&nbsp;'.$itemValue->name.'</h4>'
.'<p><strong>'.PhocaGalleryText::wordDelete($itemValue->title, 50, '...').'</strong></p>'
.'<p style="overflow:auto;width:'.$this->t['commentwidth'].'px;">'.$comment.'</p>'
.'<p style="text-align:right"><small>'.$date.'</small></p>'
.'</blockquote>';
}
}
echo '<h4>'.JText::_('COM_PHOCAGALLERY_ADD_COMMENT').'</h4>';
if ($this->t['already_commented']) {
echo '<p>'.JText::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED').'</p>';
} else if ($this->t['not_registered']) {
echo '<p>'.JText::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_SUBMIT_COMMENT').'</p>';
} else {
?>
<form action="<?php echo htmlspecialchars($this->t['action']);?>" name="phocagallerycommentsform" id="phocagallery-comments-form" method="post" >
<table>
<tr>
<td><?php echo JText::_('COM_PHOCAGALLERY_NAME');?>:</td>
<td><?php echo $this->t['name']; ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_PHOCAGALLERY_TITLE');?>:</td>
<td><input type="text" name="phocagallerycommentstitle" id="phocagallery-comments-title" value="" maxlength="255" class="comment-input" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<a href="#" onclick="pasteTag('b', true); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('bold', $this->t['icon_path'].'icon-b.png', JText::_('COM_PHOCAGALLERY_BOLD')); ?></a>&nbsp;
<a href="#" onclick="pasteTag('i', true); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('italic', $this->t['icon_path'].'icon-i.png', JText::_('COM_PHOCAGALLERY_ITALIC')); ?></a>&nbsp;
<a href="#" onclick="pasteTag('u', true); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('underline', $this->t['icon_path'].'icon-u.png', JText::_('COM_PHOCAGALLERY_UNDERLINE')); ?></a>&nbsp;&nbsp;
<a href="#" onclick="pasteSmiley(':)'); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('smile', $this->t['icon_path'].'icon-s-smile.png', JText::_('COM_PHOCAGALLERY_SMILE')); ?></a>&nbsp;
<a href="#" onclick="pasteSmiley(':lol:'); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('lol', $this->t['icon_path'].'icon-s-lol.png', JText::_('COM_PHOCAGALLERY_LOL')); ?></a>&nbsp;
<a href="#" onclick="pasteSmiley(':('); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('sad', $this->t['icon_path'].'icon-s-sad.png', JText::_('COM_PHOCAGALLERY_SAD')); ?></a>&nbsp;
<a href="#" onclick="pasteSmiley(':?'); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('confused', $this->t['icon_path'].'icon-s-confused.png', JText::_('COM_PHOCAGALLERY_CONFUSED')); ?></a>&nbsp;
<a href="#" onclick="pasteSmiley(':wink:'); return false;"><?php echo PhocaGalleryRenderFront::renderIcon('wink', $this->t['icon_path'].'icon-s-wink.png', JText::_('COM_PHOCAGALLERY_WINK')); ?></a>&nbsp;
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<textarea name="phocagallerycommentseditor" id="phocagallery-comments-editor" cols="30" rows="10" class= "comment-input" onkeyup="countChars();" ></textarea>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><?php echo JText::_('COM_PHOCAGALLERY_CHARACTERS_WRITTEN');?> <input name="phocagallerycommentscountin" value="0" readonly="readonly" class="comment-input2" /> <?php echo JText::_('COM_PHOCAGALLERY_AND_LEFT_FOR_COMMENT');?> <input name="phocagallerycommentscountleft" value="<?php echo $this->t['maxcommentchar'];?>" readonly="readonly" class="comment-input2" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right">
<input class="btn" type="submit" id="phocagallerycommentssubmit" onclick="return(checkCommentsForm());" value="<?php echo JText::_('COM_PHOCAGALLERY_SUBMIT_COMMENT'); ?>"/>
</td>
</tr>
</table>
<input type="hidden" name="task" value="comment"/>
<input type="hidden" name="view" value="category"/>
<input type="hidden" name="controller" value="category"/>
<input type="hidden" name="tab" value="<?php echo $this->t['currenttab']['comment'];?>" />
<input type="hidden" name="catid" value="<?php echo $this->category->slug ?>"/>
<input type="hidden" name="Itemid" value="<?php echo $this->itemId ?>"/>
<?php echo Joomla\CMS\HTML\HTMLHelper::_( 'form.token' ); ?>
</form>
<?php
}
echo '</div>'. "\n";
?>

View File

@ -0,0 +1,59 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
phocagalleryimport('phocagallery.render.rendermap');
$map = new PhocaGalleryRenderMap();
echo '<noscript>'.Text::_('COM_PHOCAGALLERY_ERROR_MAP_ENABLE_JAVASCRIPT').'</noscript>';
echo '<div style="font-size:1px;height:1px;margin:0px;padding:0px;">&nbsp;</div>';
echo '<div align="center" style="margin:0;padding:0;margin-top:10px;">';
$cmw = '';
if ((int)$this->t['categorymapwidth'] > 0) {
$cmw = 'width:'.$this->t['categorymapwidth'].'px;';
}
echo '<div id="phocaMap" style="margin:0;padding:0;'. $cmw. 'height:'.$this->t['categorymapheight'].'px">';
echo '</div></div>';
//echo $map->loadApi();
?><script type='text/javascript'>//<![CDATA[
<?php
echo $map->createMap('phocaMap', 'mapPhocaMap', 'phocaLatLng', 'phocaOptions','tstPhocaMap', 'tstIntPhocaMap');
echo $map->cancelEventF();
echo $map->checkMapF();
echo $map->startMapF();
echo $map->setLatLng( $this->map['latitude'], $this->map['longitude'] );
echo $map->startOptions();
echo $map->setZoomOpt($this->map['zoom']).','."\n";
echo $map->setCenterOpt().','."\n";
echo $map->setTypeControlOpt().','."\n";
echo $map->setNavigationControlOpt().','."\n";
echo $map->setScaleControlOpt(1).','."\n";
echo $map->setScrollWheelOpt(1).','."\n";
echo $map->setDisableDoubleClickZoomOpt(0).','."\n";
echo $map->setMapTypeOpt()."\n";
echo $map->endOptions();
echo $map->setMap();
// Markers
$iconOutput = $map->setMarkerIcon(0);
echo $iconOutput['js'];
echo $map->setMarker(1,$this->map['geotitle'],$this->map['description'],$this->map['latitude'], $this->map['longitude'], $iconOutput['icon'] );
echo $map->setListener();
echo $map->endMapF();
echo $map->setInitializeF();
?>//]]></script>
<?php echo $map->loadApi(); ?>

View File

@ -0,0 +1,41 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
phocagalleryimport('phocagallery.render.rendermaposm');
$id = uniqid();
$map = new PhocaGalleryRenderMaposm($id);
echo '<noscript>'.Text::_('COM_PHOCAGALLERY_ERROR_MAP_ENABLE_JAVASCRIPT').'</noscript>';
echo '<div style="font-size:1px;height:1px;margin:0px;padding:0px;">&nbsp;</div>';
echo '<div align="center" style="margin:0;padding:0;margin-top:10px;">';
$cmw = '';
if ((int)$this->t['categorymapwidth'] > 0) {
$cmw = 'width:'.$this->t['categorymapwidth'].'px;';
}
echo '<div id="phocaGalleryMap'.$id.'" style="margin:0;padding:0;'. $cmw. 'height:'.$this->t['categorymapheight'].'px">';
echo '</div></div>';
$map->loadAPI();
$map->loadCoordinatesJS();
$map->createMap($this->map['latitude'], $this->map['longitude'], $this->map['zoom']);
$map->setMapType();
$map->setMarker(1, $this->map['geotitle'],$this->map['description'],$this->map['latitude'], $this->map['longitude']);
$map->renderFullScreenControl();
//$map->renderCurrentPosition();
//$map->renderSearch('', 'topleft');
$map->renderMap();

View File

@ -0,0 +1,519 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Session\Session;
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Uri\Uri;
phocagalleryimport( 'phocagallery.youtube.youtube');
$app = Factory::getApplication();
$layoutBI = new FileLayout('box_image', null, array('component' => 'com_phocagallery'));
//$layoutBIM = new FileLayout('box_image_masonry', null, array('component' => 'com_phocagallery'));
$layoutBC = new FileLayout('box_category', null, array('component' => 'com_phocagallery'));
$layoutBB = new FileLayout('box_back', null, array('component' => 'com_phocagallery'));
$layoutCM = new FileLayout('category_modal', null, array('component' => 'com_phocagallery'));
// - - - - - - - - - -
// Images
// - - - - - - - - - -
if (!empty($this->items)) {
$classBox = ' pg-category-items-box';
$classItem = 'pg-item-box';
if ($this->t['display_masonry'] == 1) {
$classBox = ' pg-masonry';
$classItem = 'pg-item-box pg-masonry-item';
}
echo '<div id="pg-msnr-container" class="pg-photoswipe pg-msnr-container'.$classBox.'" itemscope itemtype="http://schema.org/ImageGallery">' . "\n";
foreach($this->items as $k => $item) {
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($item->cataccessuserid)) {
$item->cataccessuserid = 0;
}
if (isset($item->catid) && isset($item->cataccessuserid) && isset($item->cataccess)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $item->cataccessuserid, $item->cataccess, $this->t['user']->getAuthorisedViewLevels(), $this->t['user']->get('id', 0), 0);
}
} else {
$rightDisplay = 1;
}
// Display back button to categories list
if ($item->item_type == 'categorieslist'){
$rightDisplay = 1;
}
if ($rightDisplay == 1) {
$this->items[$k]->rightdisplay = 1;
echo '<div class="'.$classItem.'">'. "\n";// BOX START
if ($this->t['detail_window'] == 14 && $item->type == 2) {
echo '<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">'. "\n";
}
// Image Box (image, category, folder)
$d = array();
$d['item'] = $item;
$d['t'] = $this->t;
if ($item->type == 2 ) {
echo $layoutBI->render($d);
} else if ($item->type == 1) {
echo $layoutBC->render($d);
} else {
echo $layoutBB->render($d);
}
if ($this->t['detail_window'] == 14 && $item->type == 2){
if (isset($item->photoswipecaption)) {
echo '<figcaption itemprop="caption description">' . $item->photoswipecaption . '</figcaption>'. "\n";
}
echo '</figure>';
}
// HOT, NEW
if ($item->type == 2) {
//echo PhocaGalleryRenderFront::getOverImageIcons($item->date, $item->hits);
if ($this->t['display_new'] != 0 || $this->t['display_hot'] != 0) {
echo '<div class="pg-category-box-label-box">';
if ($this->t['display_new'] != 0) {
$dateAdded = strtotime($item->date, time());
$dateToday = time();
$dateExists = $dateToday - $dateAdded;
$dateNew = (int)$this->t['display_new'] * 24 * 60 * 60;
if ($dateExists < $dateNew) {
echo '<div class="pg-category-box-label-new">' . Text::_('COM_PHOCACART_LABEL_TXT_NEW') . '</div>';
}
}
if ($this->t['display_hot'] != 0) {
if ((int)$this->t['display_hot'] <= $item->hits) {
echo '<div class="pg-category-box-label-hot">' . Text::_('COM_PHOCACART_LABEL_TXT_HOT') . '</div>';
}
}
echo '</div>';
}
}
echo '<div class="pg-item-box-info">';
// Category name
if ($item->type == 1) {
if ($item->display_name == 1 || $item->display_name == 2) {
echo '<div class="pg-item-box-title category">' . "\n";
echo '<svg class="ph-si ph-si-category"><use xlink:href="#ph-si-category"></use></svg>' . "\n";
echo '<a href="' . Route::_($item->link) . '">' . $item->title . '</a>';
echo '</div>' . "\n";
}
}
// Image Name
if ($item->type == 2) {
if ($item->display_name == 1 || $item->display_name == 2) {
echo '<div class="pg-item-box-title image pg-display-name-'.$item->display_name.'">' . "\n";
if ($item->display_name == 1) {
echo '<svg class="ph-si ph-si-image"><use xlink:href="#ph-si-image"></use></svg>' . "\n";
echo ' <a class="' . $item->class2 . '" title="' . htmlentities($item->oimgtitledetail, ENT_QUOTES, 'UTF-8') . '"'
. ' data-img-title="' . $item->title . '" href="' . Route::_($item->link2) . '"';
if ($item->onclick2 != '') {
echo 'onclick="' . $item->onclick2 . '"';
}
echo ' >';
echo '' . $item->title . '';
echo '</a>';
}
if ($item->display_name == 2) {
echo '&nbsp;';
}
echo '</div>' . "\n";
}
}
// Rate Image
if ($item->item_type == 'image') {
if ($this->t['display_rating_img'] == 2) {
echo '<div class="pg-category-box-rating">';
echo PhocaGalleryRateImage::renderRateImg($item->id, $this->t['display_rating_img'], 1);
echo '</div>';
} else if ($this->t['display_rating_img'] == 1) {
echo '<div class="pg-category-box-rating">';
echo '<a class="' . $item->class3 . '" title="' . Text::_('COM_PHOCAGALLERY_RATE_IMAGE') . '" data-img-title="' . $item->title . ' - ' . Text::_('COM_PHOCAGALLERY_RATE_IMAGE') . '"'
. ' href="' . Route::_('index.php?option=com_phocagallery&view=detail&catid=' . $item->catslug . '&id=' . $item->slug . $this->t['tmplcom'] . '&Itemid=' . $this->itemId) . '"';
//echo PhocaGalleryRenderFront::renderAAttributeOther($this->t['detail_window'], $item->buttonother->optionsrating, $this->t['highslideonclick'], $this->t['highslideonclick2']);
echo 'onclick="' . $item->onclick4 . '"';
echo ' >';
echo '<div><ul class="star-rating-small">'
. '<li class="current-rating" style="width:' . $item->voteswidthimg . 'px"></li>'
. '<li><span class="star1"></span></li>';
for ($iV = 2; $iV < 6; $iV++) {
echo '<li><span class="stars' . $iV . '"></span></li>';
}
echo '</ul></div>' . "\n";
echo '</a></div>' . "\n";
}
}
if ($item->display_icon_detail == 1 ||
$item->display_icon_download > 0 ||
$item->display_icon_pc ||
$item->trash == 1 ||
$item->publish_unpublish == 1 ||
$item->display_icon_geo == 1 ||
$item->display_icon_commentimg == 1 ||
$item->camera_info == 1 ||
$item->display_icon_extlink1 == 1 ||
$item->display_icon_extlink2 == 1 ||
$item->camera_info == 1) {
echo '<div class="pg-item-box-icons-box">';
// ICON DETAIL
if ($item->display_icon_detail == 1) {
echo ' <a class="' . $item->class2 . '" title="' . htmlentities($item->oimgtitledetail, ENT_QUOTES, 'UTF-8') . '"'
. ' data-img-title="' . $item->title . '" href="' . $item->link2 . '"';
if ($item->onclick2 != '') {
echo 'onclick="' . $item->onclick2 . '"';
}
echo ' >';
echo '<svg class="ph-si ph-si-view"><title>' . $item->oimgaltdetail . '</title><use xlink:href="#ph-si-view"></use></svg>';
echo '</a>';
}
// ICON DOWNLOAD
if ($item->display_icon_download > 0) {
// Direct Download but not if there is a youtube
if ($item->display_icon_download == 2 && $item->videocode == '') {
echo ' <a title="' . Text::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD') . '"'
. ' href="' . Route::_('index.php?option=com_phocagallery&view=detail&catid=' . $item->catslug . '&id=' . $item->slug . $this->t['tmplcom'] . '&phocadownload=' . $item->display_icon_download . '&Itemid=' . $this->itemId) . '"';
} else {
echo ' <a class="' . $item->class3 . '" title="' . Text::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD') . '" data-img-title="' . $item->title . '"'
. ' href="' . Route::_('index.php?option=com_phocagallery&view=detail&catid=' . $item->catslug . '&id=' . $item->slug . $this->t['tmplcom'] . '&phocadownload=' . (int)$item->display_icon_download . '&Itemid=' . $this->itemId) . '"';
if ($item->onclick3 != '') {
echo 'onclick="' . $item->onclick3 . '"';
}
}
echo ' >';
echo '<svg class="ph-si ph-si-download"><use xlink:href="#ph-si-download"></use></svg>';
echo '</a>';
}
// ICON GEO
if ($item->display_icon_geo == 1) {
echo ' <a class="' . $item->class3 . '" title="' . Text::_('COM_PHOCAGALLERY_GEOTAGGING') . '" data-img-title="' . $item->title . '"'
. ' href="' . Route::_('index.php?option=com_phocagallery&view=map&catid=' . $item->catslug . '&id=' . $item->slug . $this->t['tmplcom'] . '&Itemid=' . $this->itemId) . '"';
if ($item->onclick3 != '') {
echo 'onclick="' . $item->onclick3 . '"';
}
echo ' >';
//echo PhocaGalleryRenderFront::renderIcon('geo', $this->t['icon_path'].'icon-geo.png', JText::_('COM_PHOCAGALLERY_GEOTAGGING'));
echo '<svg class="ph-si ph-si-earth"><use xlink:href="#ph-si-earth"></use></svg>';
//echo HTMLHelper::_('image', $this->t['icon_path'].'icon-geo.png', JText::_('COM_PHOCAGALLERY_GEOTAGGING'));
echo '</a>';
}
// ICON EXIF
if ($item->camera_info == 1) {
echo ' <a class="' . $item->class3 . '" title="' . Text::_('COM_PHOCAGALLERY_CAMERA_INFO') . '" data-img-title="' . $item->title . '"'
. ' href="' . Route::_('index.php?option=com_phocagallery&view=info&catid=' . $item->catslug . '&id=' . $item->slug . $this->t['tmplcom'] . '&Itemid=' . $this->itemId) . '"';
if ($item->onclick3 != '') {
echo 'onclick="' . $item->onclick3 . '"';
}
echo ' >';
//echo HTMLHelper::_('image', $this->t['icon_path'].'icon-info.png', JText::_('COM_PHOCAGALLERY_CAMERA_INFO'));
//echo PhocaGalleryRenderFront::renderIcon('camera', $this->t['icon_path'].'icon-info.png', JText::_('COM_PHOCAGALLERY_CAMERA_INFO'));
echo '<svg class="ph-si ph-si-camera"><use xlink:href="#ph-si-camera"></use></svg>';
echo '</a>';
}
// ICON COMMENT
if ($item->display_icon_commentimg == 1) {
if ($this->t['detail_window'] == 7 || $this->t['display_comment_nopup'] == 1) {
$tClass = '';
} else {
$tClass = 'class="' . $item->class3 . '"';
}
//echo ' <a '.$tClass.' title="'.JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE').'"'
// .' href="'. JRoute::_('index.php?option=com_phocagallery&view=comment&catid='.$item->catslug.'&id='.$item->slug.$this->t['tmplcomcomments'].'&Itemid='. $this->itemId ).'"';
echo ' <a ' . $tClass . ' title="' . Text::_('COM_PHOCAGALLERY_COMMENT_IMAGE') . '" data-img-title="' . $item->title . '"'
. ' href="' . Route::_('index.php?option=com_phocagallery&view=detail&catid=' . $item->catslug . '&id=' . $item->slug . $this->t['tmplcomcomments'] . '&Itemid=' . $this->itemId) . '"';
if ($this->t['display_comment_nopup'] == 1) {
echo '';
} else {
if ($item->onclick3 != '') {
echo 'onclick="' . $item->onclick3 . '"';
}
}
echo ' >';
// If you go from RSS or administration (e.g. jcomments) to category view, you will see already commented image (animated icon)
$cimgid = $app->input->get('cimgid', 0, 'int');
if ($cimgid > 0) {
//echo HTMLHelper::_('image', $this->t['icon_path'].'icon-comment-a.gif', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
//echo PhocaGalleryRenderFront::renderIcon('comment-a', $this->t['icon_path'].'icon-comment-a.gif', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'), 'ph-icon-animated');
echo '<svg class="pg-icon ph-icon-active pg-icon-comment-image"><use xlink:href="#ph-si-comment"></use></svg>';
} else {
//$commentImg = ($this->t['externalcommentsystem'] == 2) ? 'icon-comment-fb-small' : 'icon-comment';
//echo HTMLHelper::_('image', $this->t['icon_path'].$commentImg.'.png', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
//if ($this->t['externalcommentsystem'] == 2) {
// echo PhocaGalleryRenderFront::renderIcon('comment-fb', $this->t['icon_path'].'icon-comment-fb-small.png', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'), 'ph-icon-fb');
//} else {
//echo PhocaGalleryRenderFront::renderIcon('comment', $this->t['icon_path'].'icon-comment.png', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
echo '<svg class="ph-si ph-si-comment-image"><use xlink:href="#ph-si-comment"></use></svg>';
//}
}
echo '</a>';
}
// ICON EXTERNAL LINK 1
if ($item->display_icon_extlink1 == 1) {
$pos10 = strpos($item->extlink1[0], 'http://');
$pos20 = strpos($item->extlink1[0], 'https://');
$extLink1 = 'http://' . $item->extlink1[0];
if ($pos10 === 0) {
$extLink1 = $item->extlink1[0];
} else if ($pos20 === 0) {
$extLink1 = $item->extlink1[0];
}
echo ' <a title="' . $item->extlink1[1] . '"'
. ' href="' . $extLink1 . '" target="' . $item->extlink1[2] . '" ' . $item->extlink1[5] . '>'
. $item->extlink1[4] . '</a>';
}
// ICON EXTERNAL LINK 2
if ($item->display_icon_extlink2 == 1) {
$pos11 = strpos($item->extlink2[0], 'http://');
$pos21 = strpos($item->extlink2[0], 'https://');
$extLink2 = 'http://' . $item->extlink2[0];
if ($pos11 === 0) {
$extLink2 = $item->extlink2[0];
} else if ($pos21 === 0) {
$extLink2 = $item->extlink2[0];
}
echo ' <a title="' . $item->extlink2[1] . '"'
. ' href="' . $extLink2 . '" target="' . $item->extlink2[2] . '" ' . $item->extlink2[5] . '>'
. $item->extlink2[4] . '</a>';
}
// ICON Phoca Cart Product
if ($item->display_icon_pc == 1) {
echo ' <a title="' . Text::_('COM_PHOCAGALLERY_ESHOP') . '" href="' . Route::_($item->pclink) . '">';
//echo HTMLHelper::_('image', $this->t['icon_path'].'icon-cart.png', JText::_('COM_PHOCAGALLERY_ESHOP'));
//echo PhocaGalleryRenderFront::renderIcon('cart', $this->t['icon_path'].'icon-cart.png', JText::_('COM_PHOCAGALLERY_ESHOP'));
echo '<svg class="ph-si ph-si-cart"><title>' . Text::_('COM_PHOCAGALLERY_ESHOP') . '</title><use xlink:href="#ph-si-cart"></use></svg>';
echo '</a>';
}
// ICON Trash for private categories
if ($item->trash == 1) {
$url = PhocaGalleryRoute::getCategoryRoute($item->catid, $item->catalias);
$url .= '&removeid=' . (int)$item->id . '&controller=category&task=remove&' . Session::getFormToken() . '=1';
echo ' <a onclick="return confirm(\'' . Text::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS') . '\')" title="' . Text::_('COM_PHOCAGALLERY_DELETE') . '" href="' . Route::_($url) . $this->t['limitstarturl'] . '">';
//echo HTMLHelper::_('image', $this->t['icon_path'].'icon-trash.png', JText::_('COM_PHOCAGALLERY_DELETE'));
//echo PhocaGalleryRenderFront::renderIcon('trash', $this->t['icon_path'].'icon-trash.png', JText::_('COM_PHOCAGALLERY_DELETE'));
echo '<svg class="ph-si ph-si-trash"><title>' . Text::_('COM_PHOCAGALLERY_DELETE') . '</title><use xlink:href="#ph-si-trash"></use></svg>';
echo '</a>';
}
// ICON Publish Unpublish for private categories
if ($item->publish_unpublish == 1) {
if ($item->published == 1) {
$url = PhocaGalleryRoute::getCategoryRoute($item->catid, $item->catalias);
$url .= '&publishid=' . (int)$item->id . '&controller=category&task=unpublish&' . Session::getFormToken() . '=1';
echo ' <a title="' . Text::_('COM_PHOCAGALLERY_UNPUBLISH') . '" href="' . Route::_($url) . $this->t['limitstarturl'] . '">';
//echo HTMLHelper::_('image', $this->t['icon_path'].'icon-publish.png', JText::_('COM_PHOCAGALLERY_UNPUBLISH'));
//echo PhocaGalleryRenderFront::renderIcon('publish', $this->t['icon_path'].'icon-publish.png', JText::_('COM_PHOCAGALLERY_UNPUBLISH'));
echo '<svg class="ph-si ph-si-enabled"><title>' . Text::_('COM_PHOCAGALLERY_UNPUBLISH') . '</title><use xlink:href="#ph-si-enabled"></use></svg>';
echo '</a>';
}
if ($item->published == 0) {
$url = PhocaGalleryRoute::getCategoryRoute($item->catid, $item->catalias);
$url .= '&publishid=' . (int)$item->id . '&controller=category&task=publish&' . Session::getFormToken() . '=1';
echo ' <a title="' . Text::_('COM_PHOCAGALLERY_PUBLISH') . '" href="' . Route::_($url) . $this->t['limitstarturl'] . '">';
//echo HTMLHelper::_('image', $this->t['icon_path'].'icon-unpublish.png', JText::_('COM_PHOCAGALLERY_PUBLISH'));
//echo PhocaGalleryRenderFront::renderIcon('unpublish', $this->t['icon_path'].'icon-unpublish.png', JText::_('COM_PHOCAGALLERY_PUBLISH'));
echo '<svg class="ph-si ph-si-disabled"><title>' . Text::_('COM_PHOCAGALLERY_PUBLISH') . '</title><use xlink:href="#ph-si-disabled"></use></svg>';
echo '</a>';
}
}
// ICON Approve
if ($item->approved_not_approved == 1) {
// Display the information about Approving too:
if ($item->approved == 1) {
echo ' <span title="' . Text::_('COM_PHOCAGALLERY_IMAGE_APPROVED') . '">'
//.PhocaGalleryRenderFront::renderIcon('publish', $this->t['icon_path'].'icon-publish.png', JText::_('COM_PHOCAGALLERY_APPROVED'))
. '<svg class="ph-si ph-si-enabled"><title>' . Text::_('COM_PHOCAGALLERY_APPROVED') . '</title><use xlink:href="#ph-si-enabled"></use></svg>'
. '</span>';
}
if ($item->approved == 0) {
echo ' <span title="' . Text::_('COM_PHOCAGALLERY_IMAGE_NOT_APPROVED') . '">'
//.PhocaGalleryRenderFront::renderIcon('unpublish', $this->t['icon_path'].'icon-unpublish.png', JText::_('COM_PHOCAGALLERY_NOT_APPROVED'))
. '<svg class="ph-si ph-si-disabled"><title>' . Text::_('COM_PHOCAGALLERY_NOT_APPROVED') . '</title><use xlink:href="#ph-si-disabled"></use></svg>'
. '</span>';
}
}
echo '</div>';
/*echo '<div class="pg-icon-detail">';
/* if ($item->type == 2 && ($this->t['display_comment_img'] == 2 || $this->t['display_comment_img'] == 3)) {
echo '<div class="pg-cv-comment-img-box">';
if (isset($item->comment_items)) {
foreach($item->comment_items as $cok => $cov) {
echo '<div class="pg-cv-comment-img-box-item">';
echo '<div class="pg-cv-comment-img-box-avatar">';
$img = '<div style="width: 20px; height: 20px;">&nbsp;</div>';
if (isset($cov->avatar) && $cov->avatar != '') {
$pathAvatarAbs = $this->t['path']->avatar_abs .'thumbs/phoca_thumb_s_'. $cov->avatar;
$pathAvatarRel = $this->t['path']->avatar_rel . 'thumbs/phoca_thumb_s_'. $cov->avatar;
if (File::exists($pathAvatarAbs)){
$avSize = getimagesize($pathAvatarAbs);
$avRatio = $avSize[0]/$avSize[1];
$avHeight = 20;
$avWidth = 20 * $avRatio;
$img = '<img src="'.Uri::base().'/'.$pathAvatarRel.'" width="'.(int)$avWidth.'" height="'.(int)$avHeight.'" alt="" />';
}
}
echo $img;
echo '</div>';
echo '<div class="pg-cv-comment-img-box-comment">'.$cov->name.': '.$cov->comment.'</div>';
echo '<div style="clear:both"></div>';
echo '</div>';
}
}
echo '<div id="pg-cv-comment-img-box-result'.$item->id.'"></div>';//AJAX
//echo '<div id="pg-cv-comment-img-box-newcomment'.$item->id.'"></div>';//AJAX
// href="javascript:void(0);"
echo '<div class="pg-tb-m5"><button class="btn btn-mini" onclick="javascript:document.getElementById(\'pg-cv-add-comment-img'.$item->id.'\').style.display = \'block\';var wall = new Masonry( document.getElementById(\'pg-msnr-container\'), {});">'.Text::_('COM_PHOCAGALLERY_COMMENT').'</button></div>';
echo '<div id="pg-cv-add-comment-img'.$item->id.'" class="pg-cv-add-comment-img">';
if (isset($item->allready_commented)) {
if ($item->allready_commented == 1) {
echo '<p>'.Text::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED').'</p>';
} else if ($this->t['not_registered']) {
echo '<p>'.Text::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_SUBMIT_COMMENT').'</p>';
} else {
///echo '<form id="pgcvcommentimg'.$item->id.'" method="post" >';
echo '<textarea name="pg-cv-comments-editor-img'.(int)$item->id.'" id="pg-cv-comments-editor-img'.(int)$item->id.'" rows="2" class= "comment-input" ></textarea>';
echo '<button onclick="pgCommentImage('.(int)$item->id.', '.$this->t['diff_thumb_height'].', \'pg-msnr-container\');document.getElementById(\'pg-cv-add-comment-img'.$item->id.'\').style.display = \'none\';var wall = new Masonry( document.getElementById(\'pg-msnr-container\'), {});" class="btn btn-small" type="submit" id="phocagallerycommentssubmitimg">'. Text::_('COM_PHOCAGALLERY_SUBMIT_COMMENT').'</button>';
?>
<input type="hidden" name="catid" value="<?php echo $item->catid ?>"/>
<input type="hidden" name="imgid" value="<?php echo $item->id ?>"/>
<input type="hidden" name="Itemid" value="<?php echo $this->itemId ?>"/> <?php
echo HTMLHelper::_( 'form.token' );
///echo '</form>';
}
}
echo '</div>';
echo '</div>';*/
}
// Tags
if ($item->type == 2 && isset($item->otags) && $item->otags != '') {
echo '<div class="ph-cb"></div>';
echo '<div class="pg-item-box-tags">' . $item->otags . '</div>' . "\n";
}
echo '<div class="ph-cb"></div>';
// Description in Box
if ($this->t['display_img_desc_box'] == 1 && $item->description != '') {
echo '<div class="pg-item-box-descripton">' . strip_tags($item->description) . '</div>' . "\n";
} else if ($this->t['display_img_desc_box'] == 2 && $item->description != '') {
echo '<div class="pg-item-box-descripton">' . (HTMLHelper::_('content.prepare', $item->description, 'com_phocagallery.image')) . '</div>' . "\n";
}
echo '</div>';// ph-item-box-info
echo '</div>'; // BOX END
}
}
echo '</div>'; // End category box items
// Modal
$d = array();
$d['t'] = $this->t;
echo $layoutCM->render($d);
} else {
//echo JText::_('COM_PHOCAGALLERY_THERE_IS_NO_IMAGE');
}

View File

@ -0,0 +1,23 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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="phocagallery-javaupload">';
echo '<div class="ph-tabs-iefix">&nbsp;</div>';//because of IE bug
echo '<form action="'. JURI::base().'index.php?option=com_phocagallery" >';
//if ($this->t['ftp']) {echo PhocaGalleryFileUpload::renderFTPaccess();}
echo '<h4>';
echo JText::_( 'Upload File' ).' [ '. JText::_( 'COM_PHOCAGALLERY_MAX_SIZE' ).':&nbsp;'.$this->t['uploadmaxsizeread'].','
.' '.JText::_('COM_PHOCAGALLERY_MAX_RESOLUTION').':&nbsp;'. $this->t['uploadmaxreswidth'].' x '.$this->t['uploadmaxresheight'].' px ]';
echo ' </h4>';
echo $this->t['ju_output'];
echo '</form>';
echo '</div>';

View File

@ -0,0 +1,26 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Uri\Uri;
use Joomla\CMS\Language\Text;
echo '<div id="phocagallery-multipleupload">';
echo $this->t['mu_response_msg'] ;
echo '<form action="'. Uri::base().'index.php?option=com_phocagallery" >';
//if ($this->t['ftp']) {echo PhocaGalleryFileUpload::renderFTPaccess();}
echo '<h4>';
echo Text::_( 'COM_PHOCAGALLERY_UPLOAD_FILE' ).' [ '. Text::_( 'COM_PHOCAGALLERY_MAX_SIZE' ).':&nbsp;'.$this->t['uploadmaxsizeread'].','
.' '.Text::_('COM_PHOCAGALLERY_MAX_RESOLUTION').':&nbsp;'. $this->t['uploadmaxreswidth'].' x '.$this->t['uploadmaxresheight'].' px ]';
echo ' </h4>';
echo $this->t['mu_output'];
echo '</form>';
echo '</div>';
?>

View File

@ -0,0 +1,54 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die('Restricted access');
echo '<div id="phocagallery-category-creating">';
echo '<h4>' . Text::_('COM_PHOCAGALLERY_CREATE') . '</h4>';
echo '<form action="' . htmlspecialchars($this->t['action']) . '" name="phocagallerycreatesubcatform" id="phocagallery-create-subcat-form" method="post" >';
?>
<table>
<tr>
<td><strong><?php echo Text::_('COM_PHOCAGALLERY_SUBCATEGORY'); ?>:</strong></td>
<td><input type="text" id="subcategoryname" name="subcategoryname" maxlength="255" class="form-control comment-input" value=""/></td>
</tr>
<tr>
<td><strong><?php echo Text::_('COM_PHOCAGALLERY_DESCRIPTION'); ?>:</strong></td>
<td><textarea id="phocagallery-create-subcat-description" name="phocagallerycreatesubcatdescription" onkeyup="countCharsCreateSubCat();" cols="30" rows="10" class="form-control comment-input"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><?php echo Text::_('COM_PHOCAGALLERY_CHARACTERS_WRITTEN'); ?>
<input name="phocagallerycreatesubcatcountin" value="0" readonly="readonly" class="form-control comment-input2"/>
<?php echo Text::_('COM_PHOCAGALLERY_AND_LEFT_FOR_DESCRIPTION'); ?>
<input name="phocagallerycreatesubcatcountleft" value="<?php echo $this->t['max_create_cat_char']; ?>" readonly="readonly" class="form-control comment-input2"/></td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"><input type="submit" onclick="return(checkCreateSubCatForm());" id="phocagallerycreatesubcatsubmit" class="btn btn-primary" value="<?php echo Text::_('COM_PHOCAGALLERY_CREATE_SUBCATEGORY'); ?>"/></td>
</tr>
</table>
<?php echo HTMLHelper::_('form.token'); ?>
<input type="hidden" name="task" value="createsubcategory"/>
<input type="hidden" name="controller" value="category"/><input type="hidden" name="view" value="category"/>
<input type="hidden" name="tab" value="<?php echo $this->t['currenttab']['createsubcategory']; ?>"/>
<input type="hidden" name="Itemid" value="<?php echo $this->itemId ?>"/>
<input type="hidden" name="catid" value="<?php echo $this->category->slug ?>"/>
<input type="hidden" name="parentcategoryid" value="<?php echo $this->category->slug ?>"/></form>
<?php echo '</div>'; ?>

View File

@ -0,0 +1,41 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
if ($this->params->get('show_ordering_images') || $this->params->get('show_pagination_limit_category') || $this->params->get('show_pagination_category')) {
echo '<form action="'.htmlspecialchars($this->t['action']).'" method="post" name="adminForm">'. "\n";
if (count($this->items)) {
echo '<div class="pagination pagination-centered">';
if ($this->params->get('show_ordering_images')) {
echo Text::_('COM_PHOCAGALLERY_ORDER_FRONT') .'&nbsp;'.$this->t['ordering'];
}
if ($this->params->get('show_pagination_limit_category')) {
echo Text::_('COM_PHOCAGALLERY_DISPLAY_NUM') .'&nbsp;'.$this->t['pagination']->getLimitBox();
}
if ($this->params->get('show_pagination_category')) {
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 pg-cv-paginaton">&nbsp;</div>';
} else {
echo '<div class="ph-cb pg-csv-paginaton">&nbsp;</div>';
}
?>

View File

@ -0,0 +1,60 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
// SEF problem
$isThereQMR = false;
$isThereQMR = preg_match("/\?/i", $this->t['action']);
if ($isThereQMR) {$amp = '&amp;';} else {$amp = '?';}
echo '<div id="phocagallery-votes">'. "\n";
echo '<h4>'. Text::_('COM_PHOCAGALLERY_RATE_THIS_CATEGORY'). '</h4>'. "\n";
echo '<p><strong>' . Text::_('COM_PHOCAGALLERY_RATING'). '</strong>: ' . $this->t['votesaverage'] .' / '.$this->t['votescount'] . ' ' . Text::_($this->t['votestext']). '</p>'. "\n";
if ($this->t['alreay_rated']) {
echo '<ul class="star-rating">'
.'<li class="current-rating" style="width:'.$this->t['voteswidth'].'px"></li>'
.'<li><span class="star1"></span></li>';
for ($i = 2;$i < 6;$i++) {
echo '<li><span class="stars'.$i.'"></span></li>';
}
echo '</ul>'
.'<p>'.Text::_('COM_PHOCAGALLERY_RATING_ALREADY_RATED').'</p>'. "\n";
} else if ($this->t['not_registered']) {
echo '<ul class="star-rating">'
.'<li class="current-rating" style="width:'.$this->t['voteswidth'].'px"></li>'
.'<li><span class="star1"></span></li>';
for ($i = 2;$i < 6;$i++) {
echo '<li><span class="stars'.$i.'"></span></li>';
}
echo '</ul>'
.'<p>'.Text::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_RATE_CATEGORY').'</p>'. "\n";
} else {
echo '<ul class="star-rating">'
.'<li class="current-rating" style="width:'.$this->t['voteswidth'].'px"></li>'
.'<li><a href="'.htmlspecialchars($this->t['action']).$amp.'controller=category&task=rate&rating=1&tab='.$this->t['currenttab']['rating'].$this->t['limitstarturl'].'" title="'. Text::sprintf('COM_PHOCAGALLERY_STAR_OUT_OF', 1, 5). '" class="star1">1</a></li>';
for ($i = 2;$i < 6;$i++) {
echo '<li><a href="'.htmlspecialchars($this->t['action']).$amp.'controller=category&task=rate&rating='.$i.'&tab='.$this->t['currenttab']['rating'].$this->t['limitstarturl'].'" title="'. Text::sprintf('COM_PHOCAGALLERY_STARS_OUT_OF', $i, 5) .'" class="stars'.$i.'">'.$i.'</a></li>';
}
echo '</ul>';
}
echo '</div>'. "\n";
?>

View File

@ -0,0 +1,228 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\FileLayout;
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
$layoutBI = new FileLayout('box_image', null, array('component' => 'com_phocagallery'));
if ($this->t['detail_window'] == 14) {
echo '<div id="phocagallery-statistics" class="pg-photoswipe" itemscope itemtype="http://schema.org/ImageGallery">';
//echo '<div id="phocagallery-statistics">';
} else {
echo '<div id="phocagallery-statistics">';
}
if ($this->t['displaymaincatstat']) {
echo '<h4>'.Text::_('COM_PHOCAGALLERY_CATEGORY').'</h4>'
.'<table>'
.'<tr><td>'.Text::_('COM_PHOCAGALLERY_NR_PUBLISHED_IMG_CAT') .': </td>'
.'<td>'.$this->t['numberimgpub'].'</td></tr>'
.'<tr><td>'.Text::_('COM_PHOCAGALLERY_NR_UNPUBLISHED_IMG_CAT') .': </td>'
.'<td>'.$this->t['numberimgunpub'].'</td></tr>'
.'<tr><td>'.Text::_('COM_PHOCAGALLERY_CATEGORY_VIEWED') .': </td>'
.'<td>'.$this->t['categoryviewed'].' x</td></tr>'
.'</table>';
}
// MOST VIEWED
if ($this->t['displaymostviewedcatstat']) {
echo '<h4>'.Text::_('COM_PHOCAGALLERY_MOST_VIEWED_IMG_CAT').'</h4>';
echo '<div id="pg-msnr-container" class="pg-photoswipe pg-msnr-container pg-category-items-box" itemscope itemtype="http://schema.org/ImageGallery">' . "\n";
if (!empty($this->t['mostviewedimg'])) {
foreach($this->t['mostviewedimg'] as $key => $item) {
echo '<div class="pg-item-box">'. "\n";// BOX START
if ($this->t['detail_window'] == 14 && $item->type == 2) {
echo '<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">'. "\n";
}
// Image Box (image, category, folder)
$d = array();
$d['item'] = $item;
$d['t'] = $this->t;
echo $layoutBI->render($d);
if ($this->t['detail_window'] == 14 && $item->type == 2){
if (isset($item->photoswipecaption)) {
echo '<figcaption itemprop="caption description">' . $item->photoswipecaption . '</figcaption>'. "\n";
}
echo '</figure>';
}
// Image Name
echo '<div class="pg-item-box-title image">'. "\n";
echo '<svg class="ph-si ph-si-image"><use xlink:href="#ph-si-image"></use></svg>'. "\n";
echo $item->title;
echo '<div class="pg-item-box-stats-value">'.$item->hits.' <small>x</small></div>';
echo '</div>'. "\n";
echo '</div>';
}
}
echo '</div>';
} // END MOST VIEWED
// LAST ADDED
if ($this->t['displaylastaddedcatstat']) {
echo '<h4>'.Text::_('COM_PHOCAGALLERY_LAST_ADDED_IMG_CAT').'</h4>';
echo '<div id="pg-msnr-container" class="pg-photoswipe pg-msnr-container pg-category-items-box" itemscope itemtype="http://schema.org/ImageGallery">' . "\n";
if (!empty($this->t['lastaddedimg'])) {
foreach($this->t['lastaddedimg'] as $key => $item) {
echo '<div class="pg-item-box">'. "\n";// BOX START
if ($this->t['detail_window'] == 14 && $item->type == 2) {
echo '<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">'. "\n";
}
// Image Box (image, category, folder)
$d = array();
$d['item'] = $item;
$d['t'] = $this->t;
echo $layoutBI->render($d);
if ($this->t['detail_window'] == 14 && $item->type == 2){
if (isset($item->photoswipecaption)) {
echo '<figcaption itemprop="caption description">' . $item->photoswipecaption . '</figcaption>'. "\n";
}
echo '</figure>';
}
// Image Name
echo '<div class="pg-item-box-title image">'. "\n";
echo '<svg class="ph-si ph-si-image"><use xlink:href="#ph-si-image"></use></svg>'. "\n";
echo $item->title;
echo '<div class="pg-item-box-stats-value">'.HTMLHelper::Date($item->date, "d. m. Y").' <small>x</small></div>';
echo '</div>'. "\n";
echo '</div>';
}
}
echo '</div>';
} // END LAST ADDED
/*
// LAST ADDED
if ($this->t['displaylastaddedcatstat']) {
echo '<h4>'.Text::_('COM_PHOCAGALLERY_LAST_ADDED_IMG_CAT').'</h4>';
if (!empty($this->t['lastaddedimg'])) {
foreach($this->t['lastaddedimg'] as $key => $value) {
$extImage = PhocaGalleryImage::isExtImage($value->extid);
if ($extImage) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($value->extw, $value->exth, $this->t['picasa_correct_width_m'], $this->t['picasa_correct_height_m']);
}
?><div class="pg-cv-box pg-cv-box-stat">
<div class="pg-cv-box-img pg-box1">
<div class="pg-box2">
<div class="pg-box3"><?php
if ($this->t['detail_window'] == 14) {
echo '<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">';
}
?><a class="<?php echo $value->button->methodname; ?>"<?php
echo ' href="'. $value->link.'"';
//Correction (to not be in conflict - statistics vs. standard images)
// e.g. shadowbox shadowbox[PhocaGallery] --> shadowbox[PhocaGallery3]
$options4 = str_replace('[PhocaGallery]', '[PhocaGallery4]', $value->button->options);
echo PhocaGalleryRenderFront::renderAAttributeStat($this->t['detail_window'], $options4, '', $this->t['highslideonclick'], $this->t['highslideonclick2'], '', $this->category->alias, 'la');
if (isset($value->datasize)) {
echo ' '. $value->datasize;
}
echo ' >';
if ($extImage) {
echo HTMLHelper::_( 'image', $value->linkthumbnailpath, $value->altvalue, array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'class' => 'pg-image', 'itemprop' => "thumbnail"));
} else {
echo HTMLHelper::_( 'image', $value->linkthumbnailpath, $value->altvalue, array('class' => 'pg-image', 'itemprop' => "thumbnail") );
}
?></a><?php
if ($this->t['detail_window'] == 14) {
if ($this->t['photoswipe_display_caption'] == 1) {
echo '<figcaption itemprop="caption description">'. $value->title.'</figcaption>';
}
echo '</figure>';
}
?></div>
</div>
</div><?php
// subfolder
if ($value->type == 1) {
if ($value->display_name == 1 || $value->display_name == 2) {
echo '<div class="pg-name">'.$value->title.'</div>';
}
}
// image
if ($value->type == 2) {
if ($value->display_name == 1) {
echo '<div class="pg-name">'.$value->title.'</div>';
}
if ($value->display_name == 2) {
echo '<div class="pg-name">&nbsp;</div>';
}
}
echo '<div class="detail" style="margin-top:2px;text-align:left">';
//echo JHtml::_('image', 'media/com_phocagallery/images/icon-date.png', JText::_('COM_PHOCAGALLERY_IMAGE_DETAIL'));
echo PhocaGalleryRenderFront::renderIcon('calendar', 'media/com_phocagallery/images/icon-date.png', Text::_('COM_PHOCAGALLERY_IMAGE_DETAIL'));
echo '&nbsp;&nbsp; '.HTMLHelper::Date($value->date, "d. m. Y");
echo '</div>';
echo '<div class="ph-cb"></div>';
echo '</div>';
}
echo '<div class="ph-cb"></div>';
}
}// END MOST VIEWED
*/
echo '</div>'. "\n";
?>

View File

@ -0,0 +1,30 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
// NO htmlspecialchars - it is used in view.html.php
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
echo '<div id="phocagallery-upload">';
echo '<form onsubmit="return OnUploadSubmitCategoryPG(\'loading-label\');" action="'. $this->t['su_url'] .'" id="phocaGalleryUploadFormU" method="post" enctype="multipart/form-data">';
//if ($this->t['ftp']) { echo PhocaGalleryFileUpload::renderFTPaccess();}
echo '<h4>';
echo Text::_( 'COM_PHOCAGALLERY_UPLOAD_FILE' ).' [ '. Text::_( 'COM_PHOCAGALLERY_MAX_SIZE' ).':&nbsp;'.$this->t['uploadmaxsizeread'].','
.' '.Text::_('COM_PHOCAGALLERY_MAX_RESOLUTION').':&nbsp;'. $this->t['uploadmaxreswidth'].' x '.$this->t['uploadmaxresheight'].' px ]';
echo ' </h4>';
echo $this->t['su_output'];
$this->t['upload_form_id'] = 'phocaGalleryUploadFormU';
echo $this->loadTemplate('uploadform');
echo HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';

View File

@ -0,0 +1,52 @@
<?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\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
?><table>
<tr>
<td><?php echo Text::_('COM_PHOCAGALLERY_FILENAME');?>:</td>
<td>
<input type="file" id="file-upload" name="Filedata" class="form-control" /><?php
/*<input type="submit" id="file-upload-submit" value="<?php echo JText::_('COM_PHOCAGALLERY_START_UPLOAD'); ?>"/>*/
?><button class="btn btn-primary" id="file-upload-submit"><i class="icon-upload icon-white"></i><?php echo Text::_('COM_PHOCAGALLERY_START_UPLOAD'); ?></button>
<span id="upload-clear"></span>
</td>
</tr>
<tr>
<td><?php echo Text::_( 'COM_PHOCAGALLERY_IMAGE_TITLE' ); ?>:</td>
<td>
<input type="text" id="phocagallery-upload-title" name="phocagalleryuploadtitle" value="" maxlength="255" class="form-control comment-input" /></td>
</tr>
<tr>
<td><?php echo Text::_( 'COM_PHOCAGALLERY_DESCRIPTION' ); ?>:</td>
<td><textarea id="phocagallery-upload-description" name="phocagalleryuploaddescription" onkeyup="countCharsUpload('<?php echo $this->t['upload_form_id']; ?>');" cols="30" rows="10" class="form-control comment-input"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><?php echo Text::_('COM_PHOCAGALLERY_CHARACTERS_WRITTEN');?> <input name="phocagalleryuploadcountin" value="0" readonly="readonly" class="form-control comment-input2" /> <?php echo Text::_('COM_PHOCAGALLERY_AND_LEFT_FOR_DESCRIPTION');?> <input name="phocagalleryuploadcountleft" value="<?php echo $this->t['max_upload_char'];?>" readonly="readonly" class="form-control comment-input2" />
</td>
</tr>
</table>
<?php
if ($this->t['upload_form_id'] == 'phocaGalleryUploadFormU') {
/*echo '<div id="loading-label" style="text-align:center">'
. HTMLHelper::_('image', 'media/com_phocagallery/images/icon-switch.gif', '')
. ' '.JText::_('COM_PHOCAGALLERY_LOADING').'</div>';*/
echo '<div id="loading-label" class="ph-loading-text ph-loading-hidden"><div class="ph-lds-ellipsis"><div></div><div></div><div></div><div></div></div><div>'. Text::_('COM_PHOCAGALLERY_LOADING') . '</div></div>';
}
?>

View File

@ -0,0 +1,43 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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;
echo '<div id="phocagallery-ytbupload">';
echo '<div class="ph-tabs-iefix">&nbsp;</div>';//because of IE bug
echo '<form onsubmit="return OnUploadSubmitCategoryPG(\'loading-label-ytb\');" action="'. $this->t['syu_url'] .'" id="phocaGalleryUploadFormYU" method="post">';
//if ($this->t['ftp']) { echo PhocaGalleryFileUpload::renderFTPaccess();}
echo '<h4>'.Text::_('COM_PHOCAGALLERY_YTB_UPLOAD').'</h4>';
echo $this->t['syu_output'];
$this->t['upload_form_id'] = 'phocaGalleryUploadFormYU';
?>
<table>
<tr>
<td><?php echo Text::_( 'COM_PHOCAGALLERY_YTB_LINK' ); ?>:</td>
<td><input type="text" id="phocagallery-ytbupload-link" name="phocagalleryytbuploadlink" value="" class="form-control" maxlength="255" size="48" /></td>
</tr>
<tr style="text-align: right">
<td></td>
<td><input type="submit" class="btn btn-primary" id="file-upload-submit" value="<?php echo Text::_('COM_PHOCAGALLERY_START_UPLOAD'); ?>"/></td>
</tr>
</table><?php
if ($this->t['upload_form_id'] == 'phocaGalleryUploadFormYU') {
/* echo '<div id="loading-label-ytb" style="text-align:center">'
. HTMLHelper::_('image', 'media/com_phocagallery/images/icon-switch.gif', '')
. ' '.Text::_('COM_PHOCAGALLERY_LOADING').'</div>';
*/
echo '<div id="loading-label-ytb" class="ph-loading-text ph-loading-hidden"><div class="ph-lds-ellipsis"><div></div><div></div><div></div><div></div></div><div>'. Text::_('COM_PHOCAGALLERY_LOADING') . '</div></div>';
}
echo HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,158 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Document\Feed\FeedItem;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Uri\Uri;
jimport( 'joomla.application.component.view');
phocagalleryimport( 'phocagallery.ordering.ordering');
phocagalleryimport( 'phocagallery.picasa.picasa');
phocagalleryimport( 'phocagallery.facebook.fbsystem');
class PhocaGalleryViewCategory extends HtmlView
{
function display($tpl = null) {
$app = Factory::getApplication();
$user = Factory::getUser();
$userLevels = implode (',', $user->getAuthorisedViewLevels());
$db = Factory::getDBO();
$menu = $app->getMenu();
$document = Factory::getDocument();
$params = $app->getParams();
// Specific category
$id = $app->input->get('id', 0, 'int');
// Params
$categories = $params->get( 'feed_cat_ids', '' );
$ordering = $params->get( 'feed_img_ordering', 6 );
$imgCount = $params->get( 'feed_img_count', 5 );
$feedTitle = $params->get( 'feed_title', Text::_('COM_PHOCAGALLERY_GALLERY') );
$t['picasa_correct_width_m'] = (int)$params->get( 'medium_image_width', 256 );
$t['picasa_correct_height_m'] = (int)$params->get( 'medium_image_height', 192 );
$document->setTitle($this->escape( html_entity_decode($feedTitle)));
if($id > 0) {
$wheres[] = ' c.id ='.(int)$id;
} else {
if (count($categories) > 1) {
\Joomla\Utilities\ArrayHelper::toInteger($categories);
$categoriesString = implode(',', $categories);
$wheres[] = ' c.id IN ( '.$categoriesString.' ) ';
} else if ((int)$categories > 0) {
$wheres[] = ' c.id IN ( '.$categories.' ) ';
}
}
$imageOrdering = PhocaGalleryOrdering::getOrderingString($ordering, 6);
$wheres[] = ' a.published = 1';
$wheres[] = ' a.approved = 1';
$wheres[] = ' c.published = 1';
$wheres[] = ' c.approved = 1';
$wheres[] = ' c.access IN ('.$userLevels.')';
$u = " (c.accessuserid LIKE '%0%' OR c.accessuserid LIKE '%-1%' OR c.accessuserid LIKE '%,".(int)$user->id."' OR c.accessuserid LIKE '".(int)$user->id.",%' OR c.accessuserid LIKE '%,".(int)$user->id.",%' OR c.accessuserid =".(int)$user->id.") ";
$e = 'c.accessuserid IS NULL';
$wheres[] = ' CASE WHEN c.accessuserid IS NOT NULL THEN '.$u.' ELSE '.$e.' END';
$query = 'SELECT a.*, c.alias as catalias, c.title as categorytitle'
.' FROM #__phocagallery AS a'
.' LEFT JOIN #__phocagallery_categories AS c ON a.catid = c.id'
. ' WHERE ' . implode( ' AND ', $wheres )
.$imageOrdering['output'];
$db->setQuery( $query , 0, $imgCount );
$images = $db->loadObjectList( );
foreach ($images as $keyI => $value) {
$item = new FeedItem();
$title = $this->escape( $value->title );
$title = html_entity_decode( $title );
$item->title = $title;
$link = PhocaGalleryRoute::getCategoryRoute($value->catid, $value->catalias);
$item->link = Route::_($link);
// imgDate
$imgDate = '';
$imgDate = HTMLHelper::Date($value->date, "Y-m-d h:m:s");
if ($imgDate != '') {
$item->date = $imgDate;
}
$item->description = '';
if ($value->description != '') {
$item->description .= '<div>'.$value->description.'</div>';
}
$extImage = false;
if (isset($value->extid)) {
$extImage = PhocaGalleryImage::isExtImage($value->extid);
}
// Trying to fix but in Joomla! method $this->_relToAbs - it cannot work with JRoute links :-(
$itemL = str_replace(Uri::base(true), '', $item->link);
if (substr($itemL, 0, 1) == '/') {
$itemL = substr_replace($itemL, '', 0, 1);
}
$itemL = Uri::base().$itemL;
// Should really not happen
$itemLTmp = str_replace('http://', '', $itemL);
$pos = stripos($itemLTmp, '//');
if ($pos !== false) {
$itemLTmp = str_replace('//', '/', $itemLTmp);
$itemL = 'http://'.$itemLTmp;
}
// - - - - - - - - - - -
if ($extImage) {
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($value->extw, $value->exth, $t['picasa_correct_width_m'], $t['picasa_correct_height_m']);
$imgLink = $value->extm;
//$i = '<div><a href="'.JRoute::_($link).'"><img src="'.$imgLink .'" border="0" width="'.$correctImageRes['width'].'" height="'.$correctImageRes['height'].'" /></a></div>';
$i = '<div><a href="'.$itemL.'"><img src="'.$imgLink .'" border="0" /></a></div>';
} else {
$imgLink = PhocaGalleryImageFront::displayCategoryImageOrNoImage($value->filename, 'medium');
$i = '<div><a href="'.$itemL.'"><img src="'. /*JUri::base(true) .*/ $imgLink.'" border="0" /></a></div>';
}
$item->description .= $i;
$item->category = $value->categorytitle;
/*if ($value->author != '') {
$item->author = $value->author;
}*/
$document->addItem( $item );
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view hidden="true" />
</metadata>

View File

@ -0,0 +1,187 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Component\ComponentHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
if ($this->t['backbutton'] != '' && $this->t['enable_multibox_iframe'] != 1) {
echo $this->t['backbutton'];
}
echo '<div id="phocagallery-comments">';
if (($this->t['detailwindow'] == 7 || $this->t['display_comment_nopup'] == 1) && $this->t['enable_multibox_iframe'] != 1) {
echo '<div id="image-box" style="text-align:center">'.$this->item->linkimage.'</div>';
}
if ($this->t['externalcommentsystem'] == 1) {
if (ComponentHelper::isEnabled('com_jcomments', true)) {
include_once(JPATH_BASE.'/components/com_jcomments/jcomments.php');
echo JComments::showComments($this->item->id, 'com_phocagallery_images', Text::_('COM_PHOCAGALLERY_IMAGE') .' '. $this->item->title);
}
} else if($this->t['externalcommentsystem'] == 2) {
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$getParamsArray = explode(',', 'start,limitstart,template,fb_comment_id,tmpl');
if (!empty($getParamsArray) ) {
foreach($getParamsArray as $key => $value) {
$uri->delVar($value);
}
}
echo '<div style="margin:10px">';
if ($this->t['fb_comment_app_id'] == '') {
echo Text::_('COM_PHOCAGALLERY_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>
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
echo '</div>';
}
} else {
if (!empty($this->t['commentitem'])){
//$userImage = JHtml::_( 'image', 'media/com_phocagallery/images/icon-user.png', '');
$userImage = PhocaGalleryRenderFront::renderIcon('user', 'media/com_phocagallery/images/icon-user.png', '');
$smileys = PhocaGalleryComment::getSmileys();
foreach ($this->t['commentitem'] as $itemValue) {
$date = HTMLHelper::_('date', $itemValue->date, Text::_('DATE_FORMAT_LC2') );
$comment = $itemValue->comment;
$comment = PhocaGalleryComment::bbCodeReplace($comment);
foreach ($smileys as $smileyKey => $smileyValue) {
$comment = str_replace($smileyKey, HTMLHelper::_( 'image', 'media/com_phocagallery/images/'.$smileyValue .'.png',''), $comment);
}
echo '<blockquote><h4>'.$userImage.'&nbsp;'.$itemValue->name.'</h4>'
.'<p><strong>'.PhocaGalleryText::wordDelete($itemValue->title, 50, '...').'</strong></p>'
.'<p style="overflow:auto;width:'.$this->t['commentwidth'].'px;">'.$comment.'</p>'
.'<p style="text-align:right"><small>'.$date.'</small></p></blockquote>';
}
}
echo '<h4>'.Text::_('COM_PHOCAGALLERY_ADD_COMMENT').'</h4>';
if ($this->t['already_commented']) {
echo '<p>'.Text::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED').'</p>';
} else if ($this->t['not_registered']) {
echo '<p>'.Text::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_SUBMIT_COMMENT').'</p>';
} else {
echo '<form action="'.htmlspecialchars($this->t['action']).'" name="phocagallerycommentsform" id="phocagallery-comments-form" method="post" >'
.'<table>'
.'<tr>'
.'<td>'.Text::_('COM_PHOCAGALLERY_NAME').':</td>'
.'<td>'.$this->t['name'].'</td>'
.'</tr>';
echo '<tr>'
.'<td>'.Text::_('COM_PHOCAGALLERY_TITLE').':</td>'
.'<td><input type="text" name="phocagallerycommentstitle" id="phocagallery-comments-title" value="" maxlength="255" class="comment-input" /></td>'
.'</tr>';
echo '<tr>'
.'<td>&nbsp;</td>'
.'<td>'
.'<a href="#" onclick="pgPasteTag(\'b\', true); return false;">'
. PhocaGalleryRenderFront::renderIcon('bold', $this->t['icon_path'].'icon-b.png', Text::_('COM_PHOCAGALLERY_BOLD'))
.'</a>&nbsp;'
.'<a href="#" onclick="pgPasteTag(\'i\', true); return false;">'
. PhocaGalleryRenderFront::renderIcon('italic', $this->t['icon_path'].'icon-i.png', Text::_('COM_PHOCAGALLERY_ITALIC'))
.'</a>&nbsp;'
.'<a href="#" onclick="pgPasteTag(\'u\', true); return false;">'
. PhocaGalleryRenderFront::renderIcon('underline', $this->t['icon_path'].'icon-u.png', Text::_('COM_PHOCAGALLERY_UNDERLINE'))
.'</a>&nbsp;&nbsp;'
.'<a href="#" onclick="pgPasteSmiley(\':)\'); return false;">'
. PhocaGalleryRenderFront::renderIcon('smile', $this->t['icon_path'].'icon-s-smile.png', Text::_('COM_PHOCAGALLERY_SMILE'))
.'</a>&nbsp;'
.'<a href="#" onclick="pgPasteSmiley(\':lol:\'); return false;">'
. PhocaGalleryRenderFront::renderIcon('lol', $this->t['icon_path'].'icon-s-lol.png', Text::_('COM_PHOCAGALLERY_LOL'))
.'</a>&nbsp;'
.'<a href="#" onclick="pgPasteSmiley(\':(\'); return false;">'
. PhocaGalleryRenderFront::renderIcon('sad', $this->t['icon_path'].'icon-s-sad.png', Text::_('COM_PHOCAGALLERY_SAD'))
.'</a>&nbsp;'
.'<a href="#" onclick="pgPasteSmiley(\':?\'); return false;">'
. PhocaGalleryRenderFront::renderIcon('confused', $this->t['icon_path'].'icon-s-confused.png', Text::_('COM_PHOCAGALLERY_CONFUSED'))
.'</a>&nbsp;'
.'<a href="#" onclick="pgPasteSmiley(\':wink:\'); return false;">'
. PhocaGalleryRenderFront::renderIcon('wink', $this->t['icon_path'].'icon-s-wink.png', Text::_('COM_PHOCAGALLERY_WINK'))
.'</a>&nbsp;'
.'</td>'
.'</tr>';
echo '<tr>'
.'<td>&nbsp;</td>'
.'<td>'
.'<textarea name="phocagallerycommentseditor" id="phocagallery-comments-editor" cols="30" rows="10" class= "comment-input" onkeyup="countChars();" ></textarea>'
.'</td>'
.'</tr>';
echo '<tr>'
.'<td>&nbsp;</td>'
.'<td>'
. Text::_('COM_PHOCAGALLERY_CHARACTERS_WRITTEN').' <input name="phocagallerycommentscountin" value="0" readonly="readonly" class="comment-input2" /> '
. Text::_('COM_PHOCAGALLERY_AND_LEFT_FOR_COMMENT').' <input name="phocagallerycommentscountleft" value="'. $this->t['maxcommentchar'].'" readonly="readonly" class="comment-input2" />'
.'</td>'
.'</tr>';
echo '<tr>'
.'<td>&nbsp;</td>'
.'<td align="right">'
.'<input type="submit" class="btn" id="phocagallerycommentssubmit" onclick="return(checkCommentsForm());" value="'. Text::_('COM_PHOCAGALLERY_SUBMIT_COMMENT').'"/>'
.'</td>'
.'</tr>';
echo '</table>';
echo '<input type="hidden" name="task" value="comment" />';
echo '<input type="hidden" name="view" value="comment" />';
echo '<input type="hidden" name="controller" value="comment" />';
echo '<input type="hidden" name="id" value="'. $this->t['id'].'" />';
echo '<input type="hidden" name="catid" value="'. $this->t['catid'].'" />';
echo '<input type="hidden" name="Itemid" value="'. $this->itemId .'" />';
echo HTMLHelper::_( 'form.token' );
echo '</form>';
}
}
echo '</div>';
if ($this->t['detailwindow'] == 7 || $this->t['display_comment_nopup'] == 1) {
echo PhocaGalleryUtils::getExtInfo();
}
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,300 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Factory;
defined('_JEXEC') or die();
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
jimport( 'joomla.application.component.view');
phocagalleryimport('phocagallery.comment.comment');
phocagalleryimport('phocagallery.comment.commentimage');
phocagalleryimport( 'phocagallery.picasa.picasa');
phocagalleryimport( 'phocagallery.facebook.fbsystem');
class PhocaGalleryViewComment extends HtmlView
{
public $t;
protected $params;
function display($tpl = null) {
$app = Factory::getApplication();
$document = Factory::getDocument();
$this->params = $app->getParams();
$user = Factory::getUser();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->itemId = $app->input->get('Itemid', 0, 'int');
$this->t['icon_path'] = 'media/com_phocagallery/images/';
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
// PLUGIN WINDOW - we get information from plugin
$get = array();
$get['comment'] = $app->input->get( 'comment', '', 'string' );
$this->t['id'] = $app->input->get('id', 0, 'int');
$this->t['catid'] = $app->input->get('catid', '', 'string');
$this->t['maxcommentchar'] = $this->params->get( 'max_comment_char', 1000 );
$this->t['displaycommentimg'] = $this->params->get( 'display_comment_img', 0 );
$this->t['detailwindowbackgroundcolor']= $this->params->get( 'detail_window_background_color', '#ffffff' );
$this->t['commentwidth'] = $this->params->get( 'comment_width', 500 );
$this->t['enable_multibox'] = $this->params->get( 'enable_multibox', 0);
$this->t['multibox_comments_width'] = $this->params->get( 'multibox_comments_width', 300 );
$this->t['externalcommentsystem'] = $this->params->get( 'external_comment_system', 0 );
$this->t['gallerymetakey'] = $this->params->get( 'gallery_metakey', '' );
$this->t['gallerymetadesc'] = $this->params->get( 'gallery_metadesc', '' );
$this->t['altvalue'] = $this->params->get( 'alt_value', 1 );
$this->t['largewidth'] = $this->params->get( 'large_image_width', 640 );
$this->t['largeheight'] = $this->params->get( 'large_image_height', 480 );
$this->t['picasa_correct_width_l'] = (int)$this->params->get( 'large_image_width', 640 );
$this->t['picasa_correct_height_l'] = (int)$this->params->get( 'large_image_height', 480 );
$paramsFb = [];//PhocaGalleryFbSystem::getCommentsParams($this->params->get( 'fb_comment_user_id', ''));// Facebook
$this->t['fb_comment_app_id'] = isset($paramsFb['fb_comment_app_id']) ? $paramsFb['fb_comment_app_id'] : '';
$this->t['fb_comment_width'] = isset($paramsFb['fb_comment_width']) ? $paramsFb['fb_comment_width'] : 550;
$this->t['fb_comment_lang'] = isset($paramsFb['fb_comment_lang']) ? $paramsFb['fb_comment_lang'] : 'en_US';
$this->t['fb_comment_count'] = isset($paramsFb['fb_comment_count']) ? $paramsFb['fb_comment_count'] : '';
$this->t['display_comment_nopup'] = $this->params->get( 'display_comment_nopup', 0);
$this->t['enablecustomcss'] = $this->params->get( 'enable_custom_css', 0);
$this->t['customcss'] = $this->params->get( 'custom_css', '');
// Multibox
if ($this->t['enable_multibox'] == 1) {
$this->t['commentwidth'] = (int)$this->t['multibox_comments_width'] - 70;//padding - margin
}
$get['commentsi'] = $app->input->get( 'commentsi', '', 'int' );
$this->t['enable_multibox_iframe'] = 0;
if ($get['commentsi'] == 1) {
// Seems we are in iframe
$this->t['enable_multibox_iframe'] = 1;
}
// CSS
PhocaGalleryRenderFront::renderAllCSS();
if ($this->t['gallerymetakey'] != '') {
$document->setMetaData('keywords', $this->t['gallerymetakey']);
}
if ($this->t['gallerymetadesc'] != '') {
$document->setMetaData('description', $this->t['gallerymetadesc']);
}
// PARAMS - Open window parameters - modal popup box or standard popup window
$detail_window = $this->params->get( 'detail_window', 0 );
// Plugin information
if (isset($get['comment']) && $get['comment'] != '') {
$detail_window = $get['comment'];
}
// Only registered (VOTES + COMMENTS)
$this->t['not_registered'] = true;
$this->t['name'] = '';
if ($access) {
$this->t['not_registered'] = false;
$this->t['name'] = $user->name;
}
//$document->addScript(JUri::base(true).'/media/com_phocagallery/js/comments.js');
//$document->addCustomTag(PhocaGalleryRenderFront::renderCommentJS((int)$this->t['maxcommentchar']));
$this->t['already_commented'] = PhocaGalleryCommentImage::checkUserComment( (int)$this->t['id'], (int)$user->id );
$this->t['commentitem'] = PhocaGalleryCommentImage::displayComment( (int)$this->t['id'] );
// PARAMS - Display Description in Detail window - set the font color
$this->t['detailwindowbackgroundcolor'] = $this->params->get( 'detail_window_background_color', '#ffffff' );
$this->t['detailwindow'] = $this->params->get( 'detail_window', 0 );
$description_lightbox_font_color = $this->params->get( 'description_lightbox_font_color', '#ffffff' );
$description_lightbox_bg_color = $this->params->get( 'description_lightbox_bg_color', '#000000' );
$description_lightbox_font_size = $this->params->get( 'description_lightbox_font_size', 12 );
// NO SCROLLBAR IN DETAIL WINDOW
$document->addCustomTag( "<style type=\"text/css\"> \n"
." html,body, .contentpane{background:".$this->t['detailwindowbackgroundcolor'].";text-align:left;} \n"
." center, table {background:".$this->t['detailwindowbackgroundcolor'].";} \n"
." #sbox-window {background-color:#fff;padding:5px} \n"
." </style> \n");
$model = $this->getModel();
$this->item = $model->getData();
$this->t['imgtitle'] = $this->item->title;
// Back button
$this->t['backbutton'] = '';
if ($this->t['detailwindow'] == 7 || $this->t['display_comment_nopup']) {
// Display Image
// Access check - don't display the image if you have no access to this image (if user add own url)
// USER RIGHT - ACCESS - - - - - - - - - -
$rightDisplay = 0;
if (!empty($this->item)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->item->cataccessuserid, $this->item->cataccess, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
}
if ($rightDisplay == 0) {
$this->t['pl'] = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
$app->enqueueMessage(Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'), 'error');
$app->redirect(Route::_($this->t['pl'], false));
exit;
}
// - - - - - - - - - - - - - - - - - - - -
phocagalleryimport('phocagallery.image.image');
$this->t['backbutton'] = '<div><a href="'.Route::_('index.php?option=com_phocagallery&view=category&id='. $this->t['catid'].'&Itemid='. $this->itemId).'"'
.' title="'.Text::_( 'COM_PHOCAGALLERY_BACK_TO_CATEGORY' ).'">'
. PhocaGalleryRenderFront::renderIcon('icon-up-images', 'media/com_phocagallery/images/icon-up-images.png', Text::_('COM_PHOCAGALLERY_BACK_TO_CATEGORY'), 'ph-icon-up-images ph-icon-button').'</a></div>';
// Get file thumbnail or No Image
$this->item->filenameno = $this->item->filename;
$this->item->filename = PhocaGalleryFile::getTitleFromFile($this->item->filename, 1);
$this->item->filesize = PhocaGalleryFile::getFileSize($this->item->filenameno);
$altValue = PhocaGalleryRenderFront::getAltValue($this->t['altvalue'], $this->item->title, $this->item->description, $this->item->metadesc);
$this->item->altvalue = $altValue;
$realImageSize = '';
$extImage = PhocaGalleryImage::isExtImage($this->item->extid);
if ($extImage) {
$this->item->extl = $this->item->extl;
$this->item->exto = $this->item->exto;
$realImageSize = PhocaGalleryImage::getRealImageSize($this->item->extl, '', 1);
$this->item->imagesize = PhocaGalleryImage::getImageSize($this->item->exto, 1, 1);
if ($this->item->extw != '') {
$extw = explode(',',$this->item->extw);
$this->item->extw = $extw[0];
}
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($this->item->extw, $this->item->exth, $this->t['picasa_correct_width_l'], $this->t['picasa_correct_height_l']);
$this->item->linkimage = HTMLHelper::_( 'image', $this->item->extl, $this->item->altvalue, array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height']));
$this->item->realimagewidth = $correctImageRes['width'];
$this->item->realimageheight = $correctImageRes['height'];
} else {
$this->item->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($this->item->filenameno, 'large');
$this->item->linkimage = HTMLHelper::_( 'image', $this->item->linkthumbnailpath, $this->item->altvalue);
$realImageSize = PhocaGalleryImage::getRealImageSize ($this->item->filenameno);
$this->item->imagesize = PhocaGalleryImage::getImageSize($this->item->filenameno, 1);
if (isset($realImageSize['w']) && isset($realImageSize['h'])) {
$this->item->realimagewidth = $realImageSize['w'];
$this->item->realimageheight = $realImageSize['h'];
} else {
$this->item->realimagewidth = $this->t['largewidth'];
$this->item->realimageheight = $this->t['largeheight'];
}
}
}
// ACTION
$this->t['action'] = $uri->toString();
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
$app = Factory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
//$this->params = $app->getParams();
$title = null;
$this->t['gallerymetakey'] = $this->params->get( 'gallery_metakey', '' );
$this->t['gallerymetadesc'] = $this->params->get( 'gallery_metadesc', '' );
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', Text::_('JGLOBAL_ARTICLES'));
}
$title = $this->params->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);
if (isset($this->item->title) && $this->item->title != '') {
$title = $title .' - ' . $this->item->title;
}
} else if ($app->get('sitename_pagetitles', 0) == 2) {
if (isset($this->item->title) && $this->item->title != '') {
$title = $title .' - ' . $this->item->title;
}
$title = Text::sprintf('JPAGETITLE', $title, htmlspecialchars_decode($app->get('sitename')));
}
$this->document->setTitle($title);
if ($this->item->metadesc != '') {
$this->document->setDescription($this->item->metadesc);
} else if ($this->t['gallerymetadesc'] != '') {
$this->document->setDescription($this->t['gallerymetadesc']);
} else if ($this->params->get('menu-meta_description', '')) {
$this->document->setDescription($this->params->get('menu-meta_description', ''));
}
if ($this->item->metakey != '') {
$this->document->setMetadata('keywords', $this->item->metakey);
} else if ($this->t['gallerymetakey'] != '') {
$this->document->setMetadata('keywords', $this->t['gallerymetakey']);
} else if ($this->params->get('menu-meta_keywords', '')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords', ''));
}
if ($app->get('MetaTitle') == '1' && $this->params->get('menupage_title', '')) {
$this->document->setMetaData('title', $this->params->get('page_title', ''));
}
/*if ($app->get('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->item->author);
}
/*$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}*/
// Breadcrumbs TO DO (Add the whole tree)
/*if (isset($this->category[0]->parentid)) {
if ($this->category[0]->parentid == 1) {
} else if ($this->category[0]->parentid > 0) {
$pathway->addItem($this->category[0]->parenttitle, Route::_(PhocaDocumentationHelperRoute::getCategoryRoute($this->category[0]->parentid, $this->category[0]->parentalias)));
}
}
if (!empty($this->category[0]->title)) {
$pathway->addItem($this->category[0]->title);
}*/
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view hidden="true" />
</metadata>

View File

@ -0,0 +1,11 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die('Restricted access'); ?>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
</metadata>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,163 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Uri\Uri;
jimport( 'joomla.application.component.view');
phocagalleryimport('phocagallery.comment.comment');
phocagalleryimport('phocagallery.comment.commentimage');
jimport( 'joomla.filesystem.file' );
jimport( 'joomla.filesystem.folder' );
class PhocaGalleryViewCommentImgA extends HtmlView
{
function display($tpl = null){
if (!Session::checkToken('request')) {
$response = array(
'status' => '0',
'error' => Text::_('JINVALID_TOKEN')
);
echo json_encode($response);
return;
}
$app = Factory::getApplication();
$params = $app->getParams();
$commentValue = $app->input->get( 'commentValue', '', 'string' );
$commentId = $app->input->get( 'commentId', 0, 'int' );// ID of File
$format = $app->input->get( 'format', '', 'string' );
$task = $app->input->get( 'task', '', 'string' );
$view = $app->input->get( 'view', '', 'string' );
$paramsC = ComponentHelper::getParams('com_phocagallery');
$param['display_comment_img'] = $paramsC->get( 'display_comment_img', 0 );
if ($task == 'refreshcomment' && ((int)$param['display_comment_img'] == 2 || (int)$param['display_comment_img'] == 3)) {
$user = Factory::getUser();
//$view = J Request::get Var( 'view', '', 'get', '', J REQUEST_NOTRIM );
//$Itemid = J Request::get Var( 'Itemid', 0, '', 'int');
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
$post['imgid'] = (int)$commentId;
$post['userid'] = $user->id;
$post['comment'] = strip_tags($commentValue);
if ($format != 'json') {
$msg = Text::_('COM_PHOCAGALLERY_ERROR_WRONG_COMMENT') ;
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
if ((int)$post['imgid'] < 1) {
$msg = Text::_('COM_PHOCAGALLERY_ERROR_IMAGE_NOT_EXISTS');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
$model = $this->getModel();
$checkUserComment = PhocaGalleryCommentImage::checkUserComment( $post['imgid'], $post['userid'] );
// User has already commented this category
if ($checkUserComment) {
$msg = Text::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED');
$response = array(
'status' => '0',
'error' => '',
'message' => $msg);
echo json_encode($response);
return;
} else {
if ($access > 0 && $user->id > 0) {
if(!$model->comment($post)) {
$msg = Text::_('COM_PHOCAGALLERY_ERROR_COMMENTING_IMAGE');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
} else {
$o = '<div class="pg-cv-comment-img-box-item">';
$o .= '<div class="pg-cv-comment-img-box-avatar">';
$avatar = PhocaGalleryCommentImage::getUserAvatar($user->id);
$this->t['path'] = PhocaGalleryPath::getPath();
$img = '<div style="width: 20px; height: 20px;">&nbsp;</div>';
if (isset($avatar->avatar) && $avatar->avatar != '') {
$pathAvatarAbs = $this->t['path']->avatar_abs .'thumbs/phoca_thumb_s_'. $avatar->avatar;
$pathAvatarRel = $this->t['path']->avatar_rel . 'thumbs/phoca_thumb_s_'. $avatar->avatar;
if (File::exists($pathAvatarAbs)){
$avSize = getimagesize($pathAvatarAbs);
$avRatio = $avSize[0]/$avSize[1];
$avHeight = 20;
$avWidth = 20 * $avRatio;
$img = '<img src="'.Uri::base().'/'.$pathAvatarRel.'" width="'.$avWidth.'" height="'.$avHeight.'" alt="" />';
}
}
$o .= $img;
$o .= '</div>';
$o .= '<div class="pg-cv-comment-img-box-comment">'.$user->name.': '.$post['comment'].'</div>';
$o .= '<div style="clear:both"></div>';
$o .= '</div>';
$msg = $o . '<br />' . Text::_('COM_PHOCAGALLERY_SUCCESS_COMMENT_SUBMIT');
$response = array(
'status' => '1',
'error' => '',
'message' => $msg);
echo json_encode($response);
return;
}
} else {
$msg = Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
}
} else {
$msg = Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
}
}
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view hidden="true" />
</metadata>
<!--<metadata>
<view title="_COM_PHOCAGALLERY_COOLIRS_3D_WALL_GROUP">
<message>
<![CDATA[_COM_PHOCAGALLERY_COOLIRS_3D_WALL_GROUP_DESC]]>
</message>
</view>
</metadata>-->

View File

@ -0,0 +1,74 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Uri\Uri;
if ($this->t['display_category'] == 0) {
echo Text::_('COM_PHOCAGALLERY_CATEGORY was not selected in parameters');
} else {
echo '<div id="phocagallery" class="pg-cooliris3dwall-view-view'.$this->params->get( 'pageclass_sfx' ).'">'. "\n";
// Heading
$heading = '';
if ($this->params->get( 'page_title' ) != '') {
$heading .= $this->params->get( 'page_title' );
}
if ( $this->t['displaycatnametitle'] == 1) {
if ($this->category->title != '') {
if ($heading != '') {
$heading .= ' - ';
}
$heading .= $this->category->title;
}
}
// Pagetitle
if ($this->t['showpageheading'] != 0) {
if ( $heading != '') {
echo '<h1>'. $this->escape($heading) . '</h1>';
}
}
// Category Description
if ( $this->category->description != '' ) {
echo '<div class="pg-cooliris3dwall-view-desc'.$this->params->get( 'pageclass_sfx' ).'">';
echo $this->category->description.'</div>'. "\n";
}
?>
<object id="o"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="<?php echo $this->t['cooliris3d_wall_width'];?>"
height="<?php echo $this->t['cooliris3d_wall_height'];?>">
<param name="movie"
value="http://apps.cooliris.com/embed/cooliris.swf" />
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="transparent" />
<param name="flashvars"
value="feed=<?php echo Uri::root() . $this->t['path']->image_rel . (int)$this->category->id;?>.rss" />
<embed type="application/x-shockwave-flash"
src="http://apps.cooliris.com/embed/cooliris.swf"
flashvars="feed=<?php echo Uri::root() . $this->t['path']->image_rel . (int)$this->category->id;?>.rss"
width="<?php echo $this->t['cooliris3d_wall_width'];?>"
height="<?php echo $this->t['cooliris3d_wall_height'];?>"
allowFullScreen="true"
allowScriptAccess="always"
wmode="transparent" >
</embed>
</object>
<?php
}
echo '<div>&nbsp;</div>';
echo PhocaGalleryUtils::getExtInfo();
echo '</div>';
?>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCAGALLERY_COOLIRIS_3D_WALL_LAYOUT">
<message>
<![CDATA[COM_PHOCAGALLERY_COOLIRIS_3D_WALL_LAYOUT_DESC]]>
</message>
</layout>
<fields name="request">
<fieldset name="request" addfieldpath="/administrator/components/com_phocagallery/models/fields">
<field name="id" type="phocagallerycategory" section="com_phocagallery" default="0" label="Select Category" description="A Phoca gallery category" required="true" />
</fieldset>
</fields>
<fields name="params">
<fieldset name="basic" addfieldpath="/administrator/components/com_phocagallery/models/fields" >
<field name="cooliris3d_wall_width" default="600" size="10" type="text" label="Cooliris 3D Wall Width" description="Cooliris 3D Wall Width DESC" />
<field name="cooliris3d_wall_height" default="370" size="10" type="text" label="Cooliris 3D Wall Height" description="Cooliris 3D Wall Height DESC" />
<field name="display_cat_name_title" type="list" default="1" label="Display Category Name in Page Title" description="Display Category Name in Page Title DESC">
<option value="0">Hide</option>
<option value="1">Show</option>
</field>
<field name="display_cat_name_breadcrumbs" type="list" default="0" label="Display Category Name in Breadcrumbs" description="Display Category Name in Breadcrumbs DESC">
<option value="0">Menu Item Title</option>
<option value="1">Menu Item Title - Category Title</option>
<option value="2">Category Title</option>
</field>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,178 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
jimport( 'joomla.application.component.view' );
class PhocaGalleryViewCooliris3DWall extends HtmlView
{
public $t;
protected $params;
function display($tpl = null) {
$app = Factory::getApplication();
$document = Factory::getDocument();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$menus = $app->getMenu();
$menu = $menus->getActive();
$this->params = $app->getParams();
$this->t['path'] = PhocaGalleryPath::getPath();
$model = $this->getModel();
// PARAMS
$this->t['displaycatnametitle'] = $this->params->get( 'display_cat_name_title', 1 );
$display_cat_name_breadcrumbs = $this->params->get( 'display_cat_name_breadcrumbs', 1 );
$this->t['showpageheading'] = $this->params->get( 'show_page_heading', 1 );
$this->t['cooliris3d_wall_width'] = $this->params->get( 'cooliris3d_wall_width', 600 );
$this->t['cooliris3d_wall_height'] = $this->params->get( 'cooliris3d_wall_height', 370 );
$this->t['gallerymetakey'] = $this->params->get( 'gallery_metakey', '' );
$this->t['gallerymetadesc'] = $this->params->get( 'gallery_metadesc', '' );
$this->t['enablecustomcss'] = $this->params->get( 'enable_custom_css', 0);
$this->t['customcss'] = $this->params->get( 'custom_css', '');
$idCategory = $app->input->get('id', 0, 'int');
// CSS
HTMLHelper::stylesheet('media/com_phocagallery/css/phocagallery.css' );
if ($this->t['enablecustomcss'] == 1) {
HTMLHelper::stylesheet('media/com_phocagallery/css/phocagallerycustom.css' );
PhocaGalleryRenderFront::displayCustomCSS($this->t['customcss']);
}
if ((int)$idCategory > 0) {
$category = $model->getCategory($idCategory);
$this->_prepareDocument($category);
// Define image tag attributes
/*if (!empty ($category->image)) {
$attribs['align'] = '"'.$category->image_position.'"';
$attribs['hspace'] = '"6"';
$this->t['image'] = HTMLHelper::_('image', 'images/stories/'.$category->image, '', $attribs);
}*/
$this->_addBreadCrumbs($category, isset($menu->query['id']) ? $menu->query['id'] : 0, $display_cat_name_breadcrumbs);
// ASIGN
$this->t['display_category'] = 1;
$this->tmpl = $this->t;
$this->category = $category;
//$this->params = $this->params;
} else {
$this->t['display_category'] = 0;
$this->tmpl = $this->t;
}
parent::display($tpl);
}
protected function _prepareDocument($category) {
$app = Factory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
//$this->params = $app->getParams();
$title = null;
$this->t['gallerymetakey'] = $this->params->get( 'gallery_metakey', '' );
$this->t['gallerymetadesc'] = $this->params->get( 'gallery_metadesc', '' );
$this->t['displaycatnametitle'] = $this->params->get( 'display_cat_name_title', 1 );
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', Text::_('JGLOBAL_ARTICLES'));
}
$title = $this->params->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);
if ($this->t['display_cat_name_title'] == 1 && isset($this->category->title) && $this->category->title != '') {
$title = $title .' - ' . $this->category->title;
}
} else if ($app->get('sitename_pagetitles', 0) == 2) {
if ($this->t['display_cat_name_title'] == 1 && isset($this->category->title) && $this->category->title != '') {
$title = $title .' - ' . $this->category->title;
}
$title = Text::sprintf('JPAGETITLE', $title, htmlspecialchars_decode($app->get('sitename')));
}
$this->document->setTitle($title);
if ($category->metadesc != '') {
$this->document->setDescription($category->metadesc);
} else if ($this->t['gallerymetadesc'] != '') {
$this->document->setDescription($this->t['gallerymetadesc']);
} else if ($this->params->get('menu-meta_description', '')) {
$this->document->setDescription($this->params->get('menu-meta_description', ''));
}
if ($category->metakey != '') {
$this->document->setMetadata('keywords', $category->metakey);
} else if ($this->t['gallerymetakey'] != '') {
$this->document->setMetadata('keywords', $this->t['gallerymetakey']);
} else if ($this->params->get('menu-meta_keywords', '')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords', ''));
}
if ($app->get('MetaTitle') == '1' && $this->params->get('menupage_title', '')) {
$this->document->setMetaData('title', $this->params->get('page_title', ''));
}
/*if ($app->get('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->item->author);
}
/*$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}*/
}
/**
* Method to add Breadcrubms in Phoca Gallery
* @param array $category Object array of Category
* @param int $rootId Id of Root Category
* @param int $displayStyle Displaying of Breadcrubm - Nothing, Category Name, Menu link with Name
* @return string Breadcrumbs
*/
function _addBreadCrumbs($category, $rootId, $displayStyle) {
$app = Factory::getApplication();
$pathway = $app->getPathway();
$pathWayItems = $pathway->getPathWay();
$lastItemIndex = count($pathWayItems) - 1;
switch ($displayStyle) {
case 0: // 0 - only menu link
// do nothing
break;
case 1: // 1 - menu link with category name
// replace the last item in the breadcrumb (menu link title) with the current value plus the category title
$pathway->setItemName($lastItemIndex, $pathWayItems[$lastItemIndex]->name . ' - ' . $category->title);
break;
case 2: // 2 - only category name
// replace the last item in the breadcrumb (menu link title) with the category title
$pathway->setItemName($lastItemIndex, $category->title);
break;
}
}
}
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view hidden="true" />
</metadata>

View File

@ -0,0 +1,167 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Component\ComponentHelper;
$layoutSVG = new FileLayout('svg_definitions', null, array('component' => 'com_phocagallery'));
$layoutC = new FileLayout('comments', null, array('component' => 'com_phocagallery'));
// SVG Definitions
$d = array();
echo $layoutSVG->render($d);
echo '<div id="phocagallery" class="pg-detail-item-box'.$this->params->get( 'pageclass_sfx' ).'">';
// Bootstrap Modal Popup - change dynamically the title in Bootstrap Modal Header (it is not reloaded when image is reloaded inside the iframe so we need to change it with help of JS - see
// main.js pgFrameOnLoad()
// pgFrameOnLoad() in iframe components/com_phocagallery/layouts/category_modal.php
if ($this->t['detailwindow'] == 0) {
echo '<div id="pgDetailTitle" data-title="' . $this->item->title . '" style="display:none"></div>';
}
if ($this->t['detailwindow'] == 7) {
echo '<div class="pg-detail-top-box-back-title">';
echo '<a href="'.Route::_('index.php?option=com_phocagallery&view=category&id='. $this->item->catslug.'&Itemid='. $this->itemId).'"';
echo ' title="'.Text::_( 'COM_PHOCAGALLERY_BACK_TO_CATEGORY' ).'">';
echo '<svg class="ph-si ph-si-detail-top-back"><use xlink:href="#ph-si-back"></use></svg>';
echo '</a></div>';
}
switch ($this->t['detailwindow']) {
case 4:
case 7:
case 9:
case 10:
case 11:
$closeImage = $this->item->linkimage;
$closeButton = '';
break;
default:
$closeButton = str_replace("%onclickclose%", $this->t['detailwindowclose'], $this->item->closebutton);
$closeImage = '<a href="#" onclick="'.$this->t['detailwindowclose'].'" style="margin:auto;padding:0">'.$this->item->linkimage.'</a>';
break;
}
$classSuffix = ' popup';
if ($this->t['detailwindow'] == 7) {
$classSuffix = ' no-popup';
}
/*
echo '<div class="ph-mc" style="padding-top:10px">'
.'<table border="0" class="ph-w100 ph-mc" cellpadding="0" cellspacing="0">'
.'<tr>'
.'<td colspan="6" align="center" valign="middle"'
.' style="'.$iH.'vertical-align: middle;" >'
.'<div id="phocaGalleryImageBox" style="'.$iW.'margin: auto;padding: 0;">'
.$closeImage;
*/
echo '<div class="pg-detail-item-image-box">'.$closeImage.'</div>';
$titleDesc = '';
if ($this->t['display_title_description'] == 1) {
$titleDesc .= $this->item->title;
if ($this->item->description != '' && $titleDesc != '') {
$titleDesc .= ' - ';
}
}
// Lightbox Description
if ($this->t['displaydescriptiondetail'] == 2 && (!empty($this->item->description) || !empty($titleDesc))){
echo '<div class="pg-detail-item-desc-box">' .(HTMLHelper::_('content.prepare', $titleDesc . $this->item->description, 'com_phocagallery.item')).'</div>';
}
/*
if ($this->t['detailbuttons'] == 1){
echo '<div class="pg-detail-item-button-box">'
.'<td align="left" width="30%" style="padding-left:48px">'.$this->item->prevbutton.'</td>'
.'<td align="center">'.$this->item->slideshowbutton.'</td>'
.'<td align="center">'.str_replace("%onclickreload%", $this->t['detailwindowreload'], $this->item->reloadbutton).'</td>'
. $closeButton
//.'<td align="right" width="30%" style="padding-right:48px">'.$this->item->nextbutton.'</td>'
.'</div>';
}
*/
if ((isset($this->itemnext[0]) && $this->itemnext[0]) || (isset($this->itemprev[0]) && $this->itemprev[0])) {
$suffix = '';
if ($this->t['tmpl'] == 'component') {
$suffix = 'tmpl=component';
}
echo '<div class="pg-detail-nav-box">';
if(isset($this->itemprev[0]) && $this->itemprev[0]) {
$p = $this->itemprev[0];
$linkPrev = Route::_(PhocaGalleryRoute::getImageRoute($p->id, $p->catid, $p->alias, $p->categoryalias, 'detail', $suffix));
echo '<div class="ph-left"><a href="'.$linkPrev.'" class="btn btn-primary ph-image-navigation" role="button"><svg class="ph-si ph-si-prev-btn"><use xlink:href="#ph-si-prev"></use></svg> '.Text::_('COM_PHOCAGALLERY_PREVIOUS').'</a></div>';
}
if(isset($this->itemnext[0]) && $this->itemnext[0]) {
$n = $this->itemnext[0];
$linkNext = Route::_(PhocaGalleryRoute::getImageRoute($n->id, $n->catid, $n->alias, $n->categoryalias, 'detail', $suffix));
echo '<div class="ph-right"><a href="'.$linkNext.'" class="btn btn-primary ph-image-navigation" role="button">'.Text::_('COM_PHOCAGALLERY_NEXT').' <svg class="ph-si ph-si-next-btn"><use xlink:href="#ph-si-next"></use></svg></a></div>';
}
echo '<div class="ph-cb"></div>';
echo '</div>';
}
echo $this->loadTemplate('rating');
// Tags
if ($this->t['displaying_tags_output'] != '') {
echo '<div class="pg-detail-item-tag-box">'.$this->t['displaying_tags_output'].'</div>';
}
if ($this->t['display_comment_img'] == 1 || $this->t['display_comment_img'] == 3 || ($this->t['display_comment_img'] == 2 && $this->t['tmpl'] == 'component')) {
$d = array();
$d['t'] = $this->t;
$d['form']['task'] = 'comment';
$d['form']['view'] = 'detail';
$d['form']['controller'] = 'detail';
$d['form']['tab'] = '';
$d['form']['id'] = $this->item->id;
$d['form']['catid'] = $this->item->catid;
$d['form']['itemid'] = $this->itemId;
echo $layoutC->render($d);
/*if ($this->t['externalcommentsystem'] == 1) {
if (ComponentHelper::isEnabled('com_jcomments', true)) {
include_once(JPATH_BASE.'/components/com_jcomments/jcomments.php');
echo JComments::showComments($this->item->id, 'com_phocagallery_images', Text::_('COM_PHOCAGALLERY_IMAGE') .' '. $this->item->title);
}
} else if ($this->t['externalcommentsystem'] == 2) {
echo $this->loadTemplate('comments-fb');
}*/
echo PhocaGalleryUtils::getExtInfo();
}
echo '</div>';
?>

View File

@ -0,0 +1,53 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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="phocagallery-comments"><?php
//echo '<div style="font-size:1px;height:1px;margin:0px;padding:0px;">&nbsp;</div>';//because of IE bug
$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_PHOCAGALLERY_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>
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,76 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Language\Text;
use Joomla\CMS\Router\Route;
$title = $this->item->filename;
$imgLink = HTMLHelper::_( 'image', 'images/phocagallery/'. $this->item->filenameno, '');
$extImage = PhocaGalleryImage::isExtImage($this->item->extid);
if ($extImage) {
$title = $this->item->title;
$imgLink = HTMLHelper::_( 'image', $this->item->exto, '');
}
if (isset($this->t['backbutton']) && $this->t['backbutton'] != '') {
echo $this->t['backbutton'];
echo '<div id="download-box"><div style="overflow:scroll;width:'.$this->t['boxlargewidth'].'px;height:'.$this->t['boxlargeheight'].'px;margin:0px;padding:0px;">' . $imgLink . '</div>';
echo '<div id="download-box"><div style="overflow:scroll;width:100%;height:'.$this->t['boxlargeheight'].'px;margin:0px;padding:0px;">' . $imgLink . '</div>';
echo '<div id="download-msg-nopopup"><div>'
.'<table width="360">'
.'<tr><td align="left">' . Text::_('COM_PHOCAGALLERY_IMAGE_NAME') . ': </td><td>'.$title.'</td></tr>'
.'<tr><td align="left">' . Text::_('COM_PHOCAGALLERY_IMAGE_FORMAT') . ': </td><td>'.$this->item->imagesize.'</td></tr>'
.'<tr><td align="left">' . Text::_('COM_PHOCAGALLERY_IMAGE_SIZE') . ': </td><td>'.$this->item->filesize.'</td></tr>';
echo '<tr><td align="left"><a title="'. Text::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD').'" href="'. Route::_('index.php?option=com_phocagallery&view=detail&catid='.$this->item->catslug.'&id='.$this->item->slug.'&phocadownload=2'.'&Itemid='. $this->itemId ).'">'.Text::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD').'</a></td><td>&nbsp;</td>';
echo '</table>';
echo '</div></div></div>';
} else {
//echo '<div id="download-box"><div style="overflow:scroll;width:'.$this->t['boxlargewidth'].'px;height:'.$this->t['boxlargeheight'].'px;margin:0px;padding:0px;">' . $imgLink. '</div>';
echo '<div id="download-box"><div style="overflow:scroll;width: 100%;height:'.$this->t['boxlargeheight'].'px;margin:0px;padding:0px;">' . $imgLink. '</div>';
echo '<div id="download-msg"><div>'
.'<table width="360">'
.'<tr><td align="left">' . Text::_('COM_PHOCAGALLERY_IMAGE_NAME') . ': </td><td>'.$title.'</td></tr>'
.'<tr><td align="left">' . Text::_('COM_PHOCAGALLERY_IMAGE_FORMAT') . ': </td><td>'.$this->item->imagesize.'</td></tr>'
.'<tr><td align="left">' . Text::_('COM_PHOCAGALLERY_IMAGE_SIZE') . ': </td><td>'.$this->item->filesize.'</td></tr>'
.'<tr><td colspan="2" align="left"><small>' . Text::_('COM_PHOCAGALLERY_DOWNLOAD_IMAGE') . '</small></td></tr>';
switch($this->t['detailwindow']) {
case 3:
case 4:
case 5:
case 7:
case 9:
case 10:
break;
default:
//echo '<tr><td>&nbsp;</td><td align="right">'.str_replace("%onclickclose%", $this->t['detailwindowclose'], $this->item->closetext).'</td></tr>';
break;
}
echo '</table>';
echo '</div></div></div>';
}
echo '<div id="phocaGallerySlideshowC" style="display:none"></div>';//because of loaded slideshow js
if ($this->t['detailwindow'] == 7) {
echo PhocaGalleryUtils::getExtInfo();
}
?>

View File

@ -0,0 +1,193 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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="phocagallery" class="pg-detail-view-multibox'.$this->params->get( 'pageclass_sfx' ).'">';
if ($this->t['backbutton'] != '') {
echo $this->t['backbutton'];
echo '<p>&nbsp;</p>';
}
// Min Width
$wRightO = $wLeftO = $wLeftOIE = '';
if ($this->t['multibox_fixed_cols'] == 1) {
$wLeft = $this->t['large_image_width'];
$wRight = (int)$this->t['multibox_width'] - (int)$wLeft - 20;//margin 4 x 5px
$wRightO = 'min-width: '.$wRight.'px';
$wLeftO = 'min-width: '.$wLeft.'px';
$wLeftOIE = 'width: '.$wLeft.'px';
// IE7
$document = JFactory::getDocument();
$document->addCustomTag("<!--[if lt IE 8 ]>\n<style type=\"text/css\"> \n"
." #phocagallery.pg-detail-view-multibox table tr td.pg-multibox-lefttd {"
." ".$wLeftOIE."; "
."} \n"
." </style>\n<![endif]-->");
}
// - - - - -
// LEFT
// - - - - -
echo '<table id="pg-multibox-table" cellpadding="0" cellspacing="0" border="0" style="height: '.$this->t['multibox_height'].'px;">'. "\n";
echo '<tr>'. "\n";
echo '<td valign="middle" align="center" class="pg-multibox-lefttd pg-dv-multibox-left">'. "\n";
$over = 'onmouseover="document.getElementById(\'phocagallerymultiboxnext\').style.display = \'block\';document.getElementById(\'phocagallerymultiboxprev\').style.display = \'block\';" ';
$out = 'onmouseout="document.getElementById(\'phocagallerymultiboxnext\').style.display = \'none\';document.getElementById(\'phocagallerymultiboxprev\').style.display = \'none\';"';
echo '<div class="pg-multibox-left pg-dv-multibox-left" '.$over.$out.' style="'.$wLeftO.'">';
if ($this->item->download == 1) {
echo $this->loadTemplate('download');
} else {
if ($this->item->videocode != '') {
$this->item->linkimage = $this->item->videocode;
}
if ($this->item->nextbuttonhref != '') {
echo '<a href="'.$this->item->nextbuttonhref.'">'.$this->item->linkimage.'</a>';
} else {
echo '<span >'.$this->item->linkimage.'</span>';
}
echo $this->item->prevbutton;
echo $this->item->nextbutton;
}
echo '</div>'. "\n";
echo '</td>'. "\n";
// - - - - -
// RIGHT
// - - - - -
echo '<td valign="top" class="pg-multibox-righttd pg-dv-multibox-right">'. "\n";
echo '<div class="pg-multibox-right pg-dv-multibox-right" style="height: '.$this->t['multibox_height_overflow'].'px;'.$wRightO.'">'. "\n";
// Title
if ($this->t['mb_title']) {
echo '<div class="pg-multibox-title">'.$this->item->title.'</div>'. "\n";
}
// Description
if ($this->t['mb_desc']) {
//echo '<div class="pg-multibox-desc">'.$this->item->description.'</div>'. "\n";
echo '<div class="pg-multibox-desc">'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $this->item->description, 'com_phocagallery.item').'</div>'. "\n";
}
// Uploaded By
if ($this->t['mb_uploaded_by']) {
echo '<div class="pg-multibox-user" >' . JText::_('COM_PHOCAGALLERY_UPLOADED_BY') . '</div>';
if ($this->t['useravatarimg'] != '') {
echo '<div class="pg-multibox-avatar">'.$this->t['useravatarimg'].'</div>';
}
echo '<div class="pg-multibox-username" style="padding-top: '.$this->t['useravatarmiddle'].'px;">'.$this->item->usernameno.'</div>';
echo '<div style="clear:both"></div>';
}
// Rating
if ($this->t['mb_rating']) {
echo "\n";
echo $this->loadTemplate('rating');
echo "\n";
}
//Thumbnails
if ($this->t['mb_thumbs']) {
if (!empty($this->t['mb_thumbs_data'])) {
echo '<div class="pg-multibox-thumbs-box" style="width: '.(int)$this->t['multibox_thubms_box_width'].'px;">';
foreach ($this->t['mb_thumbs_data'] as $k => $v) {
$extImage = PhocaGalleryImage::isExtImage($v->extid);
//$altValue = PhocaGalleryRenderFront::getAltValue($this->t['altvalue'], $v->title, $v->description, $v->metadesc);
$altValue = '';//Save resources - not necessary
if ($extImage) {
$img = Joomla\CMS\HTML\HTMLHelper::_( 'image', $v->exts, $altValue);
} else {
$linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($v->filename, 'small');
$img = Joomla\CMS\HTML\HTMLHelper::_( 'image', $linkthumbnailpath, $altValue);
}
if ($this->t['detailwindow'] == 7) {
$tCom = '';
} else {
$tCom = '&tmpl=component';
}
echo '<div class="pg-multibox-thumbs-item"><a href="'.JRoute::_('index.php?option=com_phocagallery&view=detail&catid='. $v->catslug.'&id='.$v->slug.$tCom.'&Itemid='. $this->itemId).'">';
echo $img;
echo '</a></div>';
}
echo '<div style="clear:both"></div>';
echo '</div>';
}
}
// Map
if ($this->t['mb_maps']) {
$src = JRoute::_('index.php?option=com_phocagallery&view=map&catid='.$this->item->catid
.'&id='.$this->item->id.'&mapwidth='
.$this->t['multibox_map_width'].'&mapheight='
.$this->t['multibox_map_height'].'&tmpl=component&Itemid='
.$this->itemId );
$this->t['multibox_map_width'] = $this->t['multibox_map_width'] + 20;
$this->t['multibox_map_height'] = $this->t['multibox_map_height'] + 10;
echo '<iframe src="'.$src.'" width="'
.$this->t['multibox_map_width'].'" height="'
.$this->t['multibox_map_height'].'" frameborder="0" style="border:none; overflow:hidden;padding:0px;margin:0px;" name="pgmap"></iframe>'. "\n";
}
// Tags
if ($this->t['mb_tags'] && $this->t['displaying_tags_output'] != '') {
echo '<div class="pg-multibox-tags-box">';
echo '<div class="pg-multibox-tags" >' . JText::_('COM_PHOCAGALLERY_TAGS') . '</div>';
echo '<div class="pg-detail-tags-multibox">'.$this->t['displaying_tags_output'].'</div>';
echo '</div>';
}
// Comments
if ($this->t['mb_comments']) {
echo '<div class="pg-multibox-comments">';
if ((int)$this->t['externalcommentsystem'] == 2) {
echo $this->loadTemplate('comments-fb');
} else if ((int)$this->t['externalcommentsystem'] == 1) {
if (JComponentHelper::isEnabled('com_jcomments', true)) {
include_once(JPATH_BASE.'/components/com_jcomments/jcomments.php');
echo JComments::showComments($this->item->id, 'com_phocagallery_images', JText::_('COM_PHOCAGALLERY_IMAGE') .' '. $this->item->title);
}
} else {
$src = JRoute::_('index.php?option=com_phocagallery&view=comment&catid='.$this->item->catid.'&id='.$this->item->id.'&tmpl=component&commentsi=1&Itemid='. $this->itemId );
echo '<iframe src="'.$src.'" width="'.$this->t['multibox_comments_width'].'" height="'.$this->t['multibox_comments_height'].'" frameborder="0" class="pg-multibox-comments-iframe" name="pgcomment"></iframe>'. "\n";
}
echo '</div>';
}
echo '</div>'. "\n";
echo '</td>'. "\n";
echo '</tr>'. "\n";
echo '</table>'. "\n";
echo '</div>'. "\n";
if ($this->t['detailwindow'] == 7) {
echo '<p>&nbsp;</p>';
echo PhocaGalleryUtils::getExtInfo();
}
?>

View File

@ -0,0 +1,85 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Factory;
use Joomla\CMS\Language\Text;
$app = Factory::getApplication();
$amp = PhocaGalleryUtils::setQuestionmarkOrAmp($this->t['action']);
//if ((int)$this->t['display_rating_img'] == 1 || $this->t['mb_rating']) {
if ((int)$this->t['display_rating_img'] == 1) {
// Leave message for already voted images
$vote = $app->input->get('vote', 0, 'int');;
if ($vote == 1) {
$voteMsg = Text::_('COM_PHOCAGALLERY_ALREADY_RATED_IMG_THANKS');
} else {
$voteMsg = Text::_('COM_PHOCAGALLERY_ALREADY_RATE_IMG');
}
echo '<table style="text-align:left" border="0">'
.'<tr>'
.'<td><strong>' . Text::_('COM_PHOCAGALLERY_RATING'). '</strong>: ' . $this->t['votesaverageimg'] .' / '.$this->t['votescountimg'] . ' ' . Text::_($this->t['votestextimg']). '&nbsp;&nbsp;</td>';
if ($this->t['alreay_ratedimg']) {
echo '<td style="text-align:left"><ul class="star-rating">'
.'<li class="current-rating" style="width:'.$this->t['voteswidthimg'].'px"></li>'
.'<li><span class="star1"></span></li>';
for ($i = 2;$i < 6;$i++) {
echo '<li><span class="stars'.$i.'"></span></li>';
}
echo '</ul></td>';
if ($this->t['enable_multibox'] == 1) {
echo '<td></td></tr>';
echo '<tr><td style="text-align:left" colspan="4" class="pg-rating-msg">'.$voteMsg.'</td></tr>';
} else {
echo '<td style="text-align:left" colspan="4" class="pg-rating-msg">&nbsp;&nbsp;'.$voteMsg.'</td></tr>';
}
} else if ($this->t['not_registered_img']) {
echo '<td style="text-align:left"><ul class="star-rating">'
.'<li class="current-rating" style="width:'.$this->t['voteswidthimg'].'px"></li>'
.'<li><span class="star1"></span></li>';
for ($i = 2;$i < 6;$i++) {
echo '<li><span class="stars'.$i.'"></span></li>';
}
echo '</ul></td>';
if ($this->t['enable_multibox'] == 1) {
echo '<td></td></tr>';
echo '<tr><td style="text-align:left" colspan="4" class="pg-rating-msg">'.Text::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_RATE_IMAGE').'</td></tr>';
} else {
echo '<td style="text-align:left" colspan="4" class="pg-rating-msg">&nbsp;&nbsp;' . Text::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_RATE_IMAGE').'</td></tr>';
}
} else {
echo '<td style="text-align:left"><ul class="star-rating">'
.'<li class="current-rating" style="width:'.$this->t['voteswidthimg'].'px"></li>'
//.'<li><a href="'.$this->t['action'].$amp.'controller=detail&task=rate&rating=1" title="1 '. JText::_('COM_PHOCAGALLERY_STAR_OUT_OF').' 5" class="star1">1</a></li>';
.'<li><a href="'.htmlspecialchars($this->t['action']).$amp.'controller=detail&task=rate&rating=1" title="'. Text::sprintf('COM_PHOCAGALLERY_STAR_OUT_OF', 1, 5). '" class="star1">1</a></li>';
for ($i = 2;$i < 6;$i++) {
//echo '<li><a href="'.$this->t['action'].$amp.'controller=detail&task=rate&rating='.$i.'" title="'.$i.' '. JText::_('COM_PHOCAGALLERY_STARS_OUT_OF').' 5" class="stars'.$i.'">'.$i.'</a></li>';
echo '<li><a href="'.htmlspecialchars($this->t['action']).$amp.'controller=detail&task=rate&rating='.$i.'" title="'.Text::sprintf('COM_PHOCAGALLERY_STARS_OUT_OF', $i, 5). '" class="stars'.$i.'">'.$i.'</a></li>';
}
echo '</ul></td></tr>';
}
echo '</table>';
}
?>

View File

@ -0,0 +1,73 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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="phocagallery" class="pg-detail-view'.$this->params->get( 'pageclass_sfx' ).'">';
if ($this->t['backbutton'] != '') {
echo $this->t['backbutton'];
}
/*if($this->t['responsive'] == 1) {
$iW = '100%';
$iH = '100%';
$iH = $this->t['largeheight']. 'px';
$iW = $this->t['largewidth']. 'px';
} else {*/
$iW = $this->t['largewidth']. 'px';
$iH = $this->t['largeheight']. 'px';
//}
//echo '<div id="phocaGallerySlideshowC" style="width:'. $iW.';height:'.$iH .';padding:0;margin: auto"></div>';
echo '<div class="ph-mc">'
.'<table border="0" class="ph-mc" cellpadding="0" cellspacing="0">'
.'<tr>'
.'<td colspan="6" valign="middle"'
.' style="height:'.$iH.';width: '.$iW.';" >';
echo '<div id="phocaGallerySlideshowC" style="max-width:'. $iW.';max-height:'.$iH .';padding:0;margin: auto;">';
//.'<a href="#" onclick="'.$this->t['detailwindowclose'].'">'.$this->item->linkimage.'</a>';
/*.'<script type="text/javascript" style="padding:0;margin:0;">';
if ( $this->t['slideshowrandom'] == 1 ) {
echo 'new fadeshow(fadeimages, '.$this->t['largewidth'] .', '. $this->t['largeheight'] .', 0, '. $this->t['slideshowdelay'] .', '. $this->t['slideshowpause'] .', \'R\')';
} else {
echo 'new fadeshow(fadeimages, '.$this->t['largewidth'] .', '. $this->t['largeheight'] .', 0, '. $this->t['slideshowdelay'] .', '. $this->t['slideshowpause'] .')';
}
echo '</script>';*/
echo '</div>';
echo '</td>'
.'</tr>';
echo '<tr><td colspan="6"><div style="padding:0;margin:0;height:3px;font-size:0px;">&nbsp;</div></td></tr>';
// Standard Description (to get the same height as by not slideshow
if ($this->t['displaydescriptiondetail'] == 1) {
echo '<tr><td colspan="6" align="left" valign="top"><div></div></td></tr>';
}
echo '<tr>'
.'<td align="left" width="30%" style="padding-left:48px">'. $this->item->prevbutton .'</td>'
.'<td align="center">'. $this->item->slideshowbutton .'</td>'
.'<td align="center">'. str_replace("%onclickreload%", $this->t['detailwindowreload'], $this->item->reloadbutton).'</td>';
if ($this->t['detailwindow'] == 4 || $this->t['detailwindow'] == 5 || $this->t['detailwindow'] == 7) {
} else {
echo '<td align="center">'. str_replace("%onclickclose%", $this->t['detailwindowclose'], $this->item->closebutton).'</td>';
}
echo '<td align="right" width="30%" style="padding-right:48px">'. $this->item->nextbutton .'</td>'
.'</tr>'
.'</table>'
.'</div>';
if ($this->t['detailwindow'] == 7) {
echo PhocaGalleryUtils::getExtInfo();
}
echo '</div>';

View File

@ -0,0 +1,43 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();
//$document->addScript(JURI::base(true).'/media/com_phocagallery/js/jquery/jquery-1.6.4.min.js');
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);// Load it here because of own nonConflict method (nonconflict is set below)
$document->addScript(JURI::base(true).'/media/com_phocagallery/js/fadeslideshow/fadeslideshow.js');
if($this->t['responsive'] == 1) {
$iW = '\'100%\'';
$iH = '\'100%\''; // DOES NOT WORK IN FADESLIDESHOW
//$iH = $this->t['largeheight'];
} else {
$iW = $this->t['largewidth'];
$iH = $this->t['largeheight'];
}
?><script type="text/javascript">
/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
var phocagallery=new fadeSlideShow({
wrapperid: "phocaGallerySlideshowC",
dimensions: [<?php echo $iW; ?>, <?php echo $iH; ?>],
imagearray: [<?php echo $this->item->slideshowfiles ;?>],
displaymode: {type:'auto', pause: <?php echo $this->t['slideshow_pause'] ?>, cycles:0, wraparound:false, randomize: <?php echo $this->t['slideshowrandom'] ?>},
persist: false,
fadeduration: <?php echo $this->t['slideshow_delay'] ?>,
descreveal: "<?php echo $this->t['slideshow_description'] ?>",
togglerid: "",
})
</script>

View File

@ -0,0 +1,240 @@
<?php
/*
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* @component Phoca Gallery
* @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\Component\ComponentHelper;
$layoutSVG = new FileLayout('svg_definitions', null, array('component' => 'com_phocagallery'));
$layoutC = new FileLayout('comments', null, array('component' => 'com_phocagallery'));
// SVG Definitions
$d = array();
echo $layoutSVG->render($d);
if ($this->t['ytb_display'] == 1) {
/*$document = Factory::getDocument();
/$document->addCustomTag( "<style type=\"text/css\"> \n"
." body {overflow:hidden;} \n"
." </style> \n");*/
echo '<div class="pg-ytb-full">'.$this->item->videocode.'</div>';
} else {
echo '<div id="phocagallery" class="pg-detail-item-box'.$this->params->get( 'pageclass_sfx' ).'">';
if ($this->t['detailwindow'] == 7) {
echo '<div class="pg-detail-top-box-back-title">';
echo '<a href="'.Route::_('index.php?option=com_phocagallery&view=category&id='. $this->item->catslug.'&Itemid='. $this->itemId).'"';
echo ' title="'.Text::_( 'COM_PHOCAGALLERY_BACK_TO_CATEGORY' ).'">';
echo '<svg class="ph-si ph-si-detail-top-back"><use xlink:href="#ph-si-back"></use></svg>';
echo '</a></div>';
}
switch ($this->t['detailwindow']) {
case 4:
case 7:
case 9:
case 10:
case 11:
$closeImage = $this->item->linkimage;
$closeButton = '';
break;
default:
$closeButton = str_replace("%onclickclose%", $this->t['detailwindowclose'], $this->item->closebutton);
$closeImage = '<a href="#" onclick="'.$this->t['detailwindowclose'].'" style="margin:auto;padding:0">'.$this->item->linkimage.'</a>';
break;
}
$classSuffix = ' popup';
if ($this->t['detailwindow'] == 7) {
$classSuffix = ' no-popup';
}
/*
echo '<div class="ph-mc" style="padding-top:10px">'
.'<table border="0" class="ph-w100 ph-mc" cellpadding="0" cellspacing="0">'
.'<tr>'
.'<td colspan="6" align="center" valign="middle"'
.' style="'.$iH.'vertical-align: middle;" >'
.'<div id="phocaGalleryImageBox" style="'.$iW.'margin: auto;padding: 0;">'
.$closeImage;
*/
//echo '<div class="pg-detail-item-image-box">'.$closeImage.'</div>';
echo '<div class="pg-ytb-detail">'.$this->item->videocode.'</div>';
$titleDesc = '';
if ($this->t['display_title_description'] == 1) {
$titleDesc .= $this->item->title;
if ($this->item->description != '' && $titleDesc != '') {
$titleDesc .= ' - ';
}
}
// Lightbox Description
if ($this->t['displaydescriptiondetail'] == 2 && (!empty($this->item->description) || !empty($titleDesc))){
echo '<div class="pg-detail-item-desc-box">' .(HTMLHelper::_('content.prepare', $titleDesc . $this->item->description, 'com_phocagallery.item')).'</div>';
}
/*
if ($this->t['detailbuttons'] == 1){
echo '<div class="pg-detail-item-button-box">'
.'<td align="left" width="30%" style="padding-left:48px">'.$this->item->prevbutton.'</td>'
.'<td align="center">'.$this->item->slideshowbutton.'</td>'
.'<td align="center">'.str_replace("%onclickreload%", $this->t['detailwindowreload'], $this->item->reloadbutton).'</td>'
. $closeButton
//.'<td align="right" width="30%" style="padding-right:48px">'.$this->item->nextbutton.'</td>'
.'</div>';
}
*/
if ((isset($this->itemnext[0]) && $this->itemnext[0]) || (isset($this->itemprev[0]) && $this->itemprev[0])) {
$suffix = '';
if ($this->t['tmpl'] == 'component') {
$suffix = 'tmpl=component';
}
echo '<div class="pg-detail-nav-box">';
if(isset($this->itemprev[0]) && $this->itemprev[0]) {
$p = $this->itemprev[0];
$linkPrev = Route::_(PhocaGalleryRoute::getImageRoute($p->id, $p->catid, $p->alias, $p->categoryalias, 'detail', $suffix));
echo '<div class="ph-left"><a href="'.$linkPrev.'" class="btn btn-primary ph-image-navigation" role="button"><svg class="ph-si ph-si-prev-btn"><use xlink:href="#ph-si-prev"></use></svg> '.Text::_('COM_PHOCAGALLERY_PREVIOUS').'</a></div>';
}
if(isset($this->itemnext[0]) && $this->itemnext[0]) {
$n = $this->itemnext[0];
$linkNext = Route::_(PhocaGalleryRoute::getImageRoute($n->id, $n->catid, $n->alias, $n->categoryalias, 'detail', $suffix));
echo '<div class="ph-right"><a href="'.$linkNext.'" class="btn btn-primary ph-image-navigation" role="button">'.Text::_('COM_PHOCAGALLERY_NEXT').' <svg class="ph-si ph-si-next-btn"><use xlink:href="#ph-si-next"></use></svg></a></div>';
}
echo '<div class="ph-cb"></div>';
echo '</div>';
}
echo $this->loadTemplate('rating');
// Tags
if ($this->t['displaying_tags_output'] != '') {
echo '<div class="pg-detail-item-tag-box">'.$this->t['displaying_tags_output'].'</div>';
}
if ($this->t['display_comment_img'] == 1 || $this->t['display_comment_img'] == 3 || ($this->t['display_comment_img'] == 2 && $this->t['tmpl'] == 'component')) {
$d = array();
$d['t'] = $this->t;
$d['form']['task'] = 'comment';
$d['form']['view'] = 'detail';
$d['form']['controller'] = 'detail';
$d['form']['tab'] = '';
$d['form']['id'] = $this->item->id;
$d['form']['catid'] = $this->item->catid;
$d['form']['itemid'] = $this->itemId;
echo $layoutC->render($d);
/*if ($this->t['externalcommentsystem'] == 1) {
if (ComponentHelper::isEnabled('com_jcomments', true)) {
include_once(JPATH_BASE.'/components/com_jcomments/jcomments.php');
echo JComments::showComments($this->item->id, 'com_phocagallery_images', Text::_('COM_PHOCAGALLERY_IMAGE') .' '. $this->item->title);
}
} else if ($this->t['externalcommentsystem'] == 2) {
echo $this->loadTemplate('comments-fb');
}*/
echo PhocaGalleryUtils::getExtInfo();
}
echo '</div>';
}
/*echo '<div id="phocagallery" class="pg-detail-view'.$this->params->get( 'pageclass_sfx' ).'">';
if ($this->t['backbutton'] != '') {
echo $this->t['backbutton'];
}
echo '<table border="0" style="width:'.$this->t['boxlargewidth'].'px;height:'.$this->t['boxlargeheight'].'px;">'
.'<tr>'
.'<td colspan="5" class="pg-center" align="center" valign="middle">'
.$this->item->videocode
.'</td>'
.'</tr>';
$titleDesc = '';
if ($this->t['display_title_description'] == 1) {
$titleDesc .= $this->item->title;
if ($this->item->description != '' && $titleDesc != '') {
$titleDesc .= ' - ';
}
}
// Standard Description
if ($this->t['displaydescriptiondetail'] == 1) {
echo '<tr>'
.'<td colspan="6" align="left" valign="top" class="pg-dv-desc">'
.'<div class="pg-dv-desc">'
. $titleDesc . $this->item->description . '</div>'
.'</td>'
.'</tr>';
}
if ($this->t['detailbuttons'] == 1){
echo '<tr>'
.'<td align="left" width="30%" style="padding-left:48px">'.$this->item->prevbutton.'</td>'
.'<td align="center"></td>'
.'<td align="center">'.str_replace("%onclickreload%", $this->t['detailwindowreload'], $this->item->reloadbutton).'</td>';
if ($this->t['detailwindow'] == 4 || $this->t['detailwindow'] == 5 || $this->t['detailwindow'] == 7) {
} else {
echo '<td align="center">' . str_replace("%onclickclose%", $this->t['detailwindowclose'], $this->item->closebutton). '</td>';
}
echo '<td align="right" width="30%" style="padding-right:48px">'.$this->item->nextbutton.'</td>'
.'</tr>';
}
echo '</table>';
echo $this->loadTemplate('rating');
if ($this->t['detailwindow'] == 7) {
echo PhocaGalleryUtils::getExtInfo();
}
echo '</div>';
}
*/
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,678 @@
<?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;
*/
use Joomla\CMS\Factory;
defined('_JEXEC') or die();
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Plugin\PluginHelper;
jimport( 'joomla.application.component.view');
phocagalleryimport( 'phocagallery.image.image');
phocagalleryimport( 'phocagallery.image.imagefront');
phocagalleryimport( 'phocagallery.file.filethumbnail');
phocagalleryimport( 'phocagallery.rate.rateimage');
phocagalleryimport( 'phocagallery.picasa.picasa');
phocagalleryimport( 'phocagallery.facebook.fbsystem');
phocagalleryimport( 'phocagallery.youtube.youtube');
phocagalleryimport( 'phocagallery.user.user');
phocagalleryimport('phocagallery.comment.comment');
phocagalleryimport('phocagallery.comment.commentimage');
class PhocaGalleryViewDetail extends HtmlView
{
public $t;
protected $params;
protected $itemnext;
protected $itemprev;
protected $category;
function display($tpl = null) {
$app = Factory::getApplication();
$uri = Uri::getInstance();
$id = $app->input->get('id', 0, 'int');
$document = Factory::getDocument();
$this->params = $app->getParams();
$user = Factory::getUser();
$var['slideshow'] = $app->input->get('phocaslideshow', 0, 'int');
$var['download'] = $app->input->get('phocadownload', 0, 'int');
$this->t['action'] = $uri->toString();
$path = PhocaGalleryPath::getPath();
$this->itemId = $app->input->get('Itemid', 0, 'int');
$this->t['tmpl'] = $app->input->get('tmpl', '', 'string');
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
PhocaGalleryRenderFront::renderAllCSS();
PhocaGalleryRenderFront::renderMainJs();
// Information from the plugin - window is displayed after plugin action
$get = array();
$get['detail'] = $app->input->get( 'detail', '', 'string');
$get['buttons'] = $app->input->get( 'buttons', '', 'string' );
$get['ratingimg'] = $app->input->get( 'ratingimg', '', 'string' );
$this->t['tmpl'] = $app->input->get( 'tmpl', '', 'string');
$this->t['picasa_correct_width_l'] = (int)$this->params->get( 'large_image_width', 640 );
$this->t['picasa_correct_height_l'] = (int)$this->params->get( 'large_image_height', 480 );
$this->t['enablecustomcss'] = $this->params->get( 'enable_custom_css', 0);
$this->t['customcss'] = $this->params->get( 'custom_css', '');
$this->t['enable_multibox'] = $this->params->get( 'enable_multibox', 0);
$this->t['multibox_height'] = (int)$this->params->get( 'multibox_height', 560 );
$this->t['multibox_width'] = (int)$this->params->get( 'multibox_width', 980 );
$this->t['multibox_map_height'] = (int)$this->params->get( 'multibox_map_height', 300 );
$this->t['multibox_map_width'] = (int)$this->params->get( 'multibox_map_width', 280 );
$this->t['multibox_height_overflow'] = (int)$this->t['multibox_height'] - 10;//padding
$this->t['multibox_comments_width'] = $this->params->get( 'multibox_comments_width', 300 );
$this->t['multibox_comments_height'] = $this->params->get( 'multibox_comments_height', 600 );
$this->t['multibox_thubms_box_width'] = $this->params->get( 'multibox_thubms_box_width', 300 );
$this->t['multibox_thubms_count'] = $this->params->get( 'multibox_thubms_count', 4 );
$this->t['large_image_width'] = $this->params->get( 'large_image_width', 640 );
$this->t['large_image_height'] = $this->params->get( 'large_image_height', 640 );
$this->t['multibox_fixed_cols'] = $this->params->get( 'multibox_fixed_cols', 1 );
$this->t['display_multibox'] = $this->params->get( 'display_multibox', array(1,2));
$this->t['display_title_description'] = $this->params->get( 'display_title_description', 0);
$this->t['responsive'] = $this->params->get( 'responsive', 0 );
$this->t['bootstrap_icons'] = $this->params->get( 'bootstrap_icons', 0 );
$this->t['display_comment_img'] = $this->params->get( 'display_comment_img', 0 );
$this->t['display_cat_name_breadcrumbs '] = $this->params->get( 'display_cat_name_breadcrumbs', 1 );
// CSS
PhocaGalleryRenderFront::renderAllCSS(1);
// Plugin information
$this->t['detailwindow'] = $this->params->get( 'detail_window', 0 );
if (isset($get['detail']) && $get['detail'] != '') {
$this->t['detailwindow'] = $get['detail'];
}
// Plugin information
$this->t['detailbuttons'] = $this->params->get( 'detail_buttons', 1 );
if (isset($get['buttons']) && $get['buttons'] != '') {
$this->t['detailbuttons'] = $get['buttons'];
}
// Close and Reload links (for different window types)
$close = PhocaGalleryRenderFront::renderCloseReloadDetail($this->t['detailwindow']);
$this->t['detailwindowclose'] = $close['detailwindowclose'];
$this->t['detailwindowreload'] = $close['detailwindowreload'];
$this->t['displaydescriptiondetail'] = $this->params->get( 'display_description_detail', 0 );
$this->t['display_rating_img'] = $this->params->get( 'display_rating_img', 0 );
$this->t['display_icon_download'] = $this->params->get( 'display_icon_download', 0 );
$this->t['externalcommentsystem'] = $this->params->get( 'external_comment_system', 0 );
$this->t['largewidth'] = $this->params->get( 'large_image_width', 640 );
$this->t['largeheight'] = $this->params->get( 'large_image_height', 480 );
$this->t['boxlargewidth'] = $this->params->get( 'front_modal_box_width', 680 );
$this->t['boxlargeheight'] = $this->params->get( 'front_modal_box_height', 560 );
$this->t['slideshow_delay'] = $this->params->get( 'slideshow_delay', 3000 );
$this->t['slideshow_pause'] = $this->params->get( 'slideshow_pause', 2500 );
$this->t['slideshowrandom'] = $this->params->get( 'slideshow_random', 0 );
$this->t['slideshow_description'] = $this->params->get( 'slideshow_description', 'peekaboo' );
$this->t['gallerymetakey'] = $this->params->get( 'gallery_metakey', '' );
$this->t['gallerymetadesc'] = $this->params->get( 'gallery_metadesc', '' );
$this->t['altvalue'] = $this->params->get( 'alt_value', 1 );
$this->t['enablecustomcss'] = $this->params->get( 'enable_custom_css', 0);
$this->t['customcss'] = $this->params->get( 'custom_css', '');
$this->t['display_tags_links'] = $this->params->get( 'display_tags_links', 0 );
$this->t['ytb_display'] = $this->params->get( 'ytb_display', 0 );
/*$paramsFb = PhocaGalleryFbSystem::getCommentsParams($this->params->get( 'fb_comment_user_id', ''));// Facebook
$this->t['fb_comment_app_id'] = isset($paramsFb['fb_comment_app_id']) ? $paramsFb['fb_comment_app_id'] : '';
$this->t['fb_comment_width'] = isset($paramsFb['fb_comment_width']) ? $paramsFb['fb_comment_width'] : 550;
$this->t['fb_comment_lang'] = isset($paramsFb['fb_comment_lang']) ? $paramsFb['fb_comment_lang'] : 'en_US';
$this->t['fb_comment_count'] = isset($paramsFb['fb_comment_count']) ? $paramsFb['fb_comment_count'] : '';*/
$this->t['max_upload_char'] = $this->params->get( 'max_upload_char', 1000 );
$this->t['max_comment_char'] = $this->params->get( 'max_comment_char', 1000 );
$this->t['max_create_cat_char'] = $this->params->get( 'max_create_cat_char', 1000 );
$oH = '';
if ($this->t['enable_multibox'] == 1) {
$this->t['fb_comment_width'] = $this->t['multibox_comments_width'];
$oH = 'overflow:hidden;';
}
// CSS
/*JHtml::stylesheet('media/com_phocagallery/css/phocagallery.css' );
if ($this->t['enablecustomcss'] == 1) {
HTMLHelper::stylesheet('media/com_phocagallery/css/phocagallerycustom.css' );
if ($this->t['customcss'] != ''){
$document->addCustomTag( "\n <style type=\"text/css\"> \n"
.$this->escape(strip_tags($this->t['customcss']))
."\n </style> \n");
}
}*/
//Multibox displaying
/*$this->t['mb_title'] = PhocaGalleryUtils::isEnabledMultiboxFeature(1);
$this->t['mb_desc'] = PhocaGalleryUtils::isEnabledMultiboxFeature(2);
$this->t['mb_uploaded_by'] = PhocaGalleryUtils::isEnabledMultiboxFeature(3);
$this->t['mb_rating'] = PhocaGalleryUtils::isEnabledMultiboxFeature(4);
$this->t['mb_maps'] = PhocaGalleryUtils::isEnabledMultiboxFeature(5);
$this->t['mb_tags'] = PhocaGalleryUtils::isEnabledMultiboxFeature(6);
$this->t['mb_comments'] = PhocaGalleryUtils::isEnabledMultiboxFeature(7);
$this->t['mb_thumbs'] = PhocaGalleryUtils::isEnabledMultiboxFeature(8);
// No bar in Detail View
if ($this->t['detailwindow'] == 7) {
} else {
$oS = " html, body, .contentpane, #all, #main {".$oH."padding:0px !important;margin:0px !important; width: 100% !important; max-width: 100% !important;} \n"
// gantry-fix-begin
."body {min-width:100%} \n"
.".rt-container {width:100%} \n";
// gantry-fix-end
if ($this->t['responsive'] == 1) {
$oS .= "html, body {height:100%;} \n"
. ".pg-detail-view {
position: relative;
top: 50%;
transform: perspective(1px) translateY(-50%);
} \n";
}
$document->addCustomTag( "<style type=\"text/css\"> \n" . $oS . " </style> \n");
}
*/
// Download from the detail view which is not in the popupbox
if ($var['download'] == 2 ){
$this->t['display_icon_download'] = 2;
}
// Plugin Information
if (isset($get['ratingimg']) && $get['ratingimg'] != '') {
$this->t['display_rating_img'] = $get['ratingimg'];
}
// Model
$model = $this->getModel();
$item = $model->getData();
$this->category = $model->getCategory($item->id);
//Multibox Thumbnails
/*$this->t['mb_thumbs_data'] = '';
if ($this->t['mb_thumbs'] == 1) {
// if we get item variable, we have rights to load the thumbnails, this is why we checking it
if (isset($item->id) && isset($item->catid) && (int)$item->id > 0 && (int)$item->catid > 0) {
$this->t['mb_thumbs_data'] = $model->getThumbnails((int)$item->id, (int)$item->catid, (int)$item->ordering);
}
}*/
// User Avatar
$this->t['useravatarimg'] = '';
$this->t['useravatarmiddle'] = '';
$userAvatar = false;
if (isset($item->userid)) {
$userAvatar = PhocaGalleryUser::getUserAvatar($item->userid);
}
if ($userAvatar) {
$pathAvatarAbs = $path->avatar_abs .'thumbs/phoca_thumb_s_'. $userAvatar->avatar;
$pathAvatarRel = $path->avatar_rel . 'thumbs/phoca_thumb_s_'. $userAvatar->avatar;
if (File::exists($pathAvatarAbs)){
$sIH = $this->params->get( 'small_image_height', 96 );
$sIHR = @getImageSize($pathAvatarAbs);
if (isset($sIHR[1])) {
$sIH = $sIHR[1];
}
if ((int)$sIH > 0) {
$this->t['useravatarmiddle'] = ((int)$sIH / 2) - 10;
}
$this->t['useravatarimg'] = '<img src="'.Uri::base(true) . '/' . $pathAvatarRel.'?imagesid='.md5(uniqid(time())).'" alt="" />';
}
}
// Access check - don't display the image if you have no access to this image (if user add own url)
// USER RIGHT - ACCESS - - - - - - - - - -
$rightDisplay = 0;
if (!empty($item)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $item->cataccessuserid, $item->cataccess, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
}
if ((int)$rightDisplay == 0) {
echo $close['html'];
//Some problem with cache - Joomla! return this message if there is no reason for do it.
//$this->t['pl'] = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
//$app->redirect(JRoute::_($this->t['pl'], false));
exit;
}
// - - - - - - - - - - - - - - - - - - - -
phocagalleryimport('phocagallery.image.image');
phocagalleryimport('phocagallery.render.renderdetailbutton'); // Javascript Slideshow buttons
$detailButton = new PhocaGalleryRenderDetailButton();
if ($this->t['enable_multibox'] == 1) {
$detailButton->setType('multibox');
}
$item->reloadbutton = $detailButton->getReload($item->catslug, $item->slug);
$item->closebutton = $detailButton->getClose($item->catslug, $item->slug);
$item->closetext = $detailButton->getCloseText($item->catslug, $item->slug);
$item->nextbutton = $detailButton->getNext((int)$item->catid, (int)$item->id, (int)$item->ordering);
$item->nextbuttonhref = $detailButton->getNext((int)$item->catid, (int)$item->id, (int)$item->ordering, 1);
$item->prevbutton = $detailButton->getPrevious((int)$item->catid, (int)$item->id, (int)$item->ordering);
$slideshowData = $detailButton->getJsSlideshow((int)$item->catid, (int)$item->id, (int)$var['slideshow'], $item->catslug, $item->slug);
$item->slideshowbutton = $slideshowData['icons'];
$item->slideshowfiles = $slideshowData['files'];
$item->slideshow = $var['slideshow'];
$item->download = $var['download'];
// ALT VALUE
$altValue = PhocaGalleryRenderFront::getAltValue($this->t['altvalue'], $item->title, $item->description, $item->metadesc);
$item->altvalue = $altValue;
// Get file thumbnail or No Image
$item->filenameno = $item->filename;
$item->filename = PhocaGalleryFile::getTitleFromFile($item->filename, 1);
$item->filesize = PhocaGalleryFile::getFileSize($item->filenameno);
$realImageSize = '';
$extImage = PhocaGalleryImage::isExtImage($item->extid);
if ($extImage) {
$item->extl = $item->extl;
$item->exto = $item->exto;
$realImageSize = PhocaGalleryImage::getRealImageSize($item->extl, '', 1);
$item->imagesize = PhocaGalleryImage::getImageSize($item->exto, 1, 1);
if ($item->extw != '') {
$extw = explode(',',$item->extw);
$item->extw = $extw[0];
}
if ($item->exth != '') {
$exth = explode(',',$item->exth);
$item->exth = $exth[0];
}
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($item->extw, $item->exth, $this->t['picasa_correct_width_l'], $this->t['picasa_correct_height_l']);
$item->linkimage = HTMLHelper::_( 'image', $item->extl, $item->altvalue, array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'class' => 'pg-detail-image img img-responsive'));
$item->realimagewidth = $correctImageRes['width'];
$item->realimageheight = $correctImageRes['height'];
} else {
$item->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($item->filenameno, 'large');
$item->linkimage = HTMLHelper::_( 'image', $item->linkthumbnailpath, $item->altvalue, array( 'class' => 'pg-detail-image img img-responsive'));
$realImageSize = PhocaGalleryImage::getRealImageSize ($item->filenameno);
$item->imagesize = PhocaGalleryImage::getImageSize($item->filenameno, 1);
if (isset($realImageSize['w']) && isset($realImageSize['h'])) {
$item->realimagewidth = $realImageSize['w'];
$item->realimageheight = $realImageSize['h'];
} else {
$item->realimagewidth = $this->t['largewidth'];
$item->realimageheight = $this->t['largeheight'];
}
}
// Add Statistics
$model->hit($app->input->get( 'id', '', 'int' ));
// R A T I N G
// Only registered (VOTES + COMMENTS)
$this->t['not_registered_img'] = true;
$this->t['usernameimg'] = '';
if ($access > 0) {
$this->t['not_registered_img'] = false;
$this->t['usernameimg'] = $user->name;
}
// VOTES Statistics Img
//if ((int)$this->t['display_rating_img'] == 1 || $this->t['mb_rating']) {
if ((int)$this->t['display_rating_img'] == 1) {
$this->t['votescountimg'] = 0;
$this->t['votesaverageimg'] = 0;
$this->t['voteswidthimg'] = 0;
$votesStatistics = PhocaGalleryRateImage::getVotesStatistics((int)$item->id);
if (!empty($votesStatistics->count)) {
$this->t['votescountimg'] = $votesStatistics->count;
}
if (!empty($votesStatistics->average)) {
$this->t['votesaverageimg'] = $votesStatistics->average;
if ($this->t['votesaverageimg'] > 0) {
$this->t['votesaverageimg'] = round(((float)$this->t['votesaverageimg'] / 0.5)) * 0.5;
$this->t['voteswidthimg'] = 22 * $this->t['votesaverageimg'];
} else {
$this->t['votesaverageimg'] = (int)0;// not float displaying
}
}
if ((int)$this->t['votescountimg'] > 1) {
$this->t['votestextimg'] = 'COM_PHOCAGALLERY_VOTES';
} else {
$this->t['votestextimg'] = 'COM_PHOCAGALLERY_VOTE';
}
// Already rated?
$this->t['alreay_ratedimg'] = PhocaGalleryRateImage::checkUserVote( (int)$item->id, (int)$user->id );
}
// Tags
$this->t['displaying_tags_output'] = '';
//if ($this->t['display_tags_links'] == 1 || $this->t['display_tags_links'] == 3 || $this->t['mb_tags']) {
if ($this->t['display_tags_links'] == 1 || $this->t['display_tags_links'] == 3) {
if ($this->t['detailwindow'] == 7) {
$this->t['displaying_tags_output'] = PhocaGalleryTag::displayTags($item->id);
} else {
$this->t['displaying_tags_output'] = PhocaGalleryTag::displayTags($item->id, 1);
}
}
// Only registered (VOTES + COMMENTS)
$this->t['not_registered'] = true;
$this->t['name'] = '';
if ($access) {
$this->t['not_registered'] = false;
$this->t['name'] = $user->name;
}
$this->t['already_commented'] = PhocaGalleryCommentImage::checkUserComment( (int)$item->id, (int)$user->id );
$this->t['commentitem'] = PhocaGalleryCommentImage::displayComment( (int)$item->id);
$this->itemnext[0] = false;
$this->itemprev[0] = false;
//if ($this->t['enable_image_navigation'] == 1) {
if (isset($item->ordering) && isset($item->catid) && isset($item->id) && $item->catid > 0 && $item->id > 0) {
$this->itemnext = $model->getItemNext($item->ordering, $item->catid);
$this->itemprev = $model->getItemPrev($item->ordering, $item->catid);
}
//}
// ASIGN
$this->item = $item;
$this->_prepareDocument($item);
// Breadcrumb display:
// 0 - only menu link
// 1 - menu link - category name
// 2 - only category name
$this->_addBreadCrumbs( isset($menu->query['id']) ? $menu->query['id'] : 0, $this->t['display_cat_name_breadcrumbs '], $item);
if ($this->t['enable_multibox'] == 1) {
if ($item->download > 0) {
if ($this->t['display_icon_download'] == 2) {
$backLink = 'index.php?option=com_phocagallery&view=category&id='. $item->catslug.'&Itemid='. $this->itemId;
phocagalleryimport('phocagallery.file.filedownload');
if (isset($item->exto) && $item->exto != '') {
PhocaGalleryFileDownload::download($item, $backLink, 1);
} else {
PhocaGalleryFileDownload::download($item, $backLink);
}
exit;
} else {
parent::display('multibox');
//parent::display('download');
}
} else {
if (isset($item->videocode) && $item->videocode != '' && $item->videocode != '0') {
$item->videocode = PhocaGalleryYoutube::displayVideo($item->videocode);
}
parent::display('multibox');
}
} else if (isset($item->videocode) && $item->videocode != '' && $item->videocode != '0') {
$item->videocode = PhocaGalleryYoutube::displayVideo($item->videocode);
if ($this->t['detailwindow'] != 7 && $this->t['ytb_display'] == 1) {
$document->addCustomTag( "<style type=\"text/css\"> \n"
." html, body, .contentpane, div#all, div#main, div#system-message-container {padding: 0px !important;margin: 0px !important;} \n"
." div#sbox-window {background-color:#fff;padding: 0px;margin: 0px;} \n"
." </style> \n");
}
parent::display('video');
} else {
//parent::display('slideshowjs');
/*if ($item->slideshow == 1) {
parent::display('slideshow');
} else*/
if ($item->download > 0) {
if ($this->t['display_icon_download'] == 2) {
$backLink = 'index.php?option=com_phocagallery&view=category&id='. $item->catslug.'&Itemid='. $this->itemId;
phocagalleryimport('phocagallery.file.filedownload');
if (isset($item->exto) && $item->exto != '') {
PhocaGalleryFileDownload::download($item, $backLink, 1);
} else {
PhocaGalleryFileDownload::download($item, $backLink);
}
exit;
} else {
parent::display('download');
}
} else {
parent::display($tpl);
}
}
}
protected function _prepareDocument($item) {
$app = Factory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
//$this->params = $app->getParams();
$title = null;
$this->t['gallerymetakey'] = $this->params->get( 'gallery_metakey', '' );
$this->t['gallerymetadesc'] = $this->params->get( 'gallery_metadesc', '' );
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', Text::_('JGLOBAL_ARTICLES'));
}
$title = $this->params->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);
if (isset($item->title) && $item->title != '') {
$title = $title .' - ' . $item->title;
}
} else if ($app->get('sitename_pagetitles', 0) == 2) {
if (isset($item->title) && $item->title != '') {
$title = $title .' - ' . $item->title;
}
$title = Text::sprintf('JPAGETITLE', $title, htmlspecialchars_decode($app->get('sitename')));
}
$this->document->setTitle($title);
if ($item->metadesc != '') {
$this->document->setDescription($item->metadesc);
} else if ($this->t['gallerymetadesc'] != '') {
$this->document->setDescription($this->t['gallerymetadesc']);
} else if ($this->params->get('menu-meta_description', '')) {
$this->document->setDescription($this->params->get('menu-meta_description', ''));
}
if ($item->metakey != '') {
$this->document->setMetadata('keywords', $item->metakey);
} else if ($this->t['gallerymetakey'] != '') {
$this->document->setMetadata('keywords', $this->t['gallerymetakey']);
} else if ($this->params->get('menu-meta_keywords', '')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords', ''));
}
if ($app->get('MetaTitle') == '1' && $this->params->get('menupage_title', '')) {
$this->document->setMetaData('title', $this->params->get('page_title', ''));
}
/*if ($app->get('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->item->author);
}
/*$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}*/
// Breadcrumbs TO DO (Add the whole tree)
/*if (isset($this->category[0]->parentid)) {
if ($this->category[0]->parentid == 1) {
} else if ($this->category[0]->parentid > 0) {
$pathway->addItem($this->category[0]->parenttitle, Route::_(PhocaDocumentationHelperRoute::getCategoryRoute($this->category[0]->parentid, $this->category[0]->parentalias)));
}
}
if (!empty($this->category[0]->title)) {
$pathway->addItem($this->category[0]->title);
}*/
// Features added by Bernard Gilly - alphaplug.com
// load external plugins
/*$user = Factory::getUser();
$imgid = $item->id;
$catid = $item->catid;
$db = Factory::getDBO();
$query = "SELECT owner_id FROM #__phocagallery_categories WHERE `id`='$catid'";
$db->setQuery( $query );
$ownerid = $db->loadResult();
$dispatcher = JDispatcher::getInstance();
PluginHelper::importPlugin('phocagallery');
$results = Factory::getApplication()->triggerEvent('onViewImage', array($imgid, $catid, $ownerid, $user->id ) );*/
$user = Factory::getUser();
//$dispatcher = J Dispatcher::getInstance();
PluginHelper::importPlugin('phocagallery');
$results = Factory::getApplication()->triggerEvent('onViewImage', array((int)$item->id, (int)$item->catid, (int)$item->owner_id, (int)$user->id ) );
}
/**
* Method to add Breadcrubms in Phoca Gallery
* @param array $this->category Object array of Category
* @param int $rootId Id of Root Category
* @param int $displayStyle Displaying of Breadcrubm - Nothing, Category Name, Menu link with Name
* @return string Breadcrumbs
*/
function _addBreadCrumbs($rootId, $displayStyle, $image)
{
$app = Factory::getApplication();
$i = 0;
$category = $this->category[0];
while (isset($category->id))
{
$crumbList[$i++] = $category;
if ($category->id == $rootId)
{
break;
}
$db = Factory::getDBO();
$query = 'SELECT *' .
' FROM #__phocagallery_categories AS c' .
' WHERE c.id = '.(int) $category->parent_id.
' AND c.published = 1';
$db->setQuery($query);
$rows = $db->loadObjectList('id');
if (!empty($rows))
{
$category = $rows[$category->parent_id];
}
else
{
$category = '';
}
// $category = $rows[$category->parent_id];
}
$pathway = $app->getPathway();
$pathWayItems = $pathway->getPathWay();
$lastItemIndex = count($pathWayItems) - 1;
for ($i--; $i >= 0; $i--)
{
// special handling of the root category
if ($crumbList[$i]->id == $rootId)
{
switch ($displayStyle)
{
case 0: // 0 - only menu link
// do nothing
break;
case 1: // 1 - menu link with category name
// replace the last item in the breadcrumb (menu link title) with the current value plus the category title
$pathway->setItemName($lastItemIndex, $pathWayItems[$lastItemIndex]->name . ' - ' . $crumbList[$i]->title);
break;
case 2: // 2 - only category name
// replace the last item in the breadcrumb (menu link title) with the category title
$pathway->setItemName($lastItemIndex, $crumbList[$i]->title);
break;
}
}
else
{
$pathway->addItem($crumbList[$i]->title, Route::_('index.php?option=com_phocagallery&view=category&id='. $crumbList[$i]->id.':'.$crumbList[$i]->alias.'&Itemid='. $this->itemId ));
}
}
// Add the image title
$pathway->addItem($image->title);
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view hidden="true" />
</metadata>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

Some files were not shown because too many files have changed in this diff Show More