primo commit
This commit is contained in:
1
components/com_phocagallery/views/categories/index.html
Normal file
1
components/com_phocagallery/views/categories/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<view title="_COM_PHOCAGALLERY_CATEGORIES_GROUP">
|
||||
<message><![CDATA[_COM_PHOCAGALLERY_CATEGORIES_GROUP_DESC]]></message>
|
||||
</view>
|
||||
</metadata>
|
||||
@ -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>';
|
||||
@ -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>
|
||||
@ -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>';
|
||||
|
||||
?>
|
||||
@ -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;"> </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('»', '-',$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> </div>';
|
||||
echo PhocaGalleryUtils::getExtInfo();
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -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;"> </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('»', '-',$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> </div>';
|
||||
echo PhocaGalleryUtils::getExtInfo();
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -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('»', '-',$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('»','-',$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";
|
||||
?>
|
||||
@ -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('»', '-',$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('»','-',$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> </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> </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";
|
||||
?>
|
||||
@ -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('»', '-',$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('»','-',$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> </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> </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";
|
||||
?>
|
||||
@ -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";
|
||||
?>
|
||||
@ -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('»', '-',$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('»', '-',$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";
|
||||
?>
|
||||
@ -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('»', '-',$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('»','-',$this->categories[$i]->title),array('style' => ''));
|
||||
}
|
||||
|
||||
echo '</a></div></td>';
|
||||
echo '<td><a href="'.$this->categories[$i]->link.'">'.$this->categories[$i]->title.'</a> ';
|
||||
|
||||
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";
|
||||
?>
|
||||
@ -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') .' '.$this->t['ordering'];
|
||||
}
|
||||
if ($this->params->get('show_pagination_limit_categories')) {
|
||||
echo Text::_('COM_PHOCAGALLERY_DISPLAY_NUM') .' '.$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>';
|
||||
}
|
||||
?>
|
||||
@ -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";
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
158
components/com_phocagallery/views/categories/view.feed.php
Normal file
158
components/com_phocagallery/views/categories/view.feed.php
Normal 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
522
components/com_phocagallery/views/categories/view.html.php
Normal file
522
components/com_phocagallery/views/categories/view.html.php
Normal 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() );
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user