<?php
/**
* Part of Showkase web site management package
*
* @package Showkase
* @author Jack Hardie {@link http://www.jhardie.com}
* @copyright Copyright (c) 2012, SimpleViewer Inc.
*/
defined('SK_ACCESS')||die('<h1>403: Forbidden</h1>');
require_once 'classes'.DIRECTORY_SEPARATOR.'gallery.php';
/**
* Models a ListViewer gallery
*
* @package Showkase
*/
class ListViewerGallery extends Gallery
{
/**
* @var string gallery type
*
*/
protected $galleryType = 'listviewer';
/**
* @var string name of image class
*/
protected $imageClass = 'ListviewerImage';
/**
* @var string default image path
*/
protected $imageDirPathRelGallery = LISTVIEWER_DEFAULT_IMAGE_PATH;
/**
* @var string default thumb path
*/
protected $thumbDirPathRelGallery = LISTVIEWER_DEFAULT_THUMB_PATH;
/**
* @var integer thumb width
*/
protected $thumbWidth = LISTVIEWER_THUMB_WIDTH;
/**
* @var integer thumb height
*/
protected $thumbHeight = LISTVIEWER_THUMB_HEIGHT;
/**
* @var integer thumb quality
*/
protected $thumbQuality = LISTVIEWER_THUMB_QUALITY;
/**
* @var string acceptable html tags in captions
*/
protected $okCaptionTags = '<a><u><font><b><i><br><br/>';
/**
* @var string settings tag in gallery xml file
*/
protected $xmlSettingsTag = LISTVIEWER_XML_SETTINGS_TAG;
/**
* @var string gallery.xml file image tag name
*/
protected $xmlImageTag = LISTVIEWER_XML_IMAGE_TAG;
/**
* Get xml path
*
* @return string calculated xml path
*/
function getXmlPath()
{
return str_replace('/', DIRECTORY_SEPARATOR, $this->pathParser->fix($this->galleryPathRelSvm.LISTVIEWER_XML_PATH_REL_GALLERY));
}
/**
* get prefix for colors in gallery.xml
* @return string
*/
public function getColorPrefix()
{
return '0x';
}
/**
* Set captions etc in image data
*
* @access public
* @return boolean true on success
* @param array captions
*/
function setAllImageAttributes($post)
{
$captions = $post['cap'];
$titles = $post['tit'];
$links = $post['url'];
$targets = $post['target'];
$i=0;
foreach (array_keys($this->imageObjects) as $key)
{
$this->imageObjects[$key]->setImageAttributes(
$titles[$key],
$captions[$key],
$links[$key],
$targets[$key],
$i,
$this->okCaptionTags
);
$i++;
}
return true;
}
/**
* Overrides Gallery::writeXml
* No need to save an xml file for a listviewer gallery
*
* @param string file path
* @return void
*/
protected function writeXml($xmlPath){}
/**
* Dummy import method
*
* @return array of gallery settings
*/
public function importConfig()
{
return array();
}
}