From: Steve Sutton Date: Fri, 2 May 2014 19:29:19 +0000 (+0000) Subject: Update slideshow output for no titles X-Git-Tag: v1.0~33 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=073e1190cb203b69b893e25010e146d1ba18b6df;p=web%2FCedarvilleMarine.git Update slideshow output for no titles If the titles are turned off then keep nivo from outputting them. Markup changes --- diff --git a/Toolkit/RotatingImages/Decorator/Anchor.php b/Toolkit/RotatingImages/Decorator/Anchor.php index e83266e..5b19eeb 100644 --- a/Toolkit/RotatingImages/Decorator/Anchor.php +++ b/Toolkit/RotatingImages/Decorator/Anchor.php @@ -26,42 +26,42 @@ * @link <> */ class Toolkit_RotatingImages_Decorator_Anchor - extends Toolkit_RotatingImages_Decorator_DecoratorAbstract + extends Toolkit_RotatingImages_Decorator_DecoratorAbstract { - // {{{ properties + // {{{ properties /** * The image decorator object * @var Toolkit_RotatingImages_Decorator_Image * @access private */ - private $_imageDecorator; + private $_imageDecorator; - // }}} - // {{{ __construct() + // }}} + // {{{ __construct() /** * constructor * * create a shallow copy of the image passed in so we can manipulate - * it all we want and not worry about affecting the original object + * it all we want and not worry about affecting the original object * * @param Toolkit_RotatingImages_Decorator_Image $imageDecorator Object to decorate image markup * @param Toolkit_RotatingImages_Image $image Node to be decorated - * + * * @return void * @access protected */ - public function __construct( - Toolkit_RotatingImages_Decorator_Image $imageDecorator, - Toolkit_RotatingImages_Image $image - ) { - $this->_imageDecorator = $imageDecorator; - // Clone the node object so we keep original properties the same - $this->image = clone $image; - } + public function __construct( + Toolkit_RotatingImages_Decorator_Image $imageDecorator, + Toolkit_RotatingImages_Image $image + ) { + $this->_imageDecorator = $imageDecorator; + // Clone the node object so we keep original properties the same + $this->image = clone $image; + } - // }}} + // }}} // {{{ toHtml() /** @@ -70,16 +70,16 @@ class Toolkit_RotatingImages_Decorator_Anchor * @return string HTML output of the anchor * @access public */ - public function toHtml() - { - $anchorFormat = '%s'; - return sprintf( - $anchorFormat, - $this->image->getUrl(), + public function toHtml() + { + $anchorFormat = '%s'; + return sprintf( + $anchorFormat, + $this->image->getUrl(), $this->image->getExternal() ? 'class="external"' : '', - $this->_imageDecorator->toHtml() - ); - } + $this->_imageDecorator->toHtml() + ); + } // }}} public function getTitle() diff --git a/Toolkit/RotatingImages/Decorator/Image.php b/Toolkit/RotatingImages/Decorator/Image.php index 5f872ab..5b1a62e 100644 --- a/Toolkit/RotatingImages/Decorator/Image.php +++ b/Toolkit/RotatingImages/Decorator/Image.php @@ -57,19 +57,42 @@ class Toolkit_RotatingImages_Decorator_Image */ public function toHtml() { - $format = ''; - return sprintf( - $format, - $this->image->getWidth(), - $this->image->getHeight(), - ROTATING_IMAGE_RESIZED . $this->image->getImage(), - $this->image->getId() + $rotatingImagesConf = new Config; + $rotatingImagesRoot =& $rotatingImagesConf->parseConfig( + BASE . 'Toolkit/RotatingImages/config.ini', + 'IniFile' ); + $useTitles = $rotatingImagesRoot + ->getItem('section','conf') + ->getItem('directive', 'useTitles') + ->getContent(); + if ($useTitles) { + $format = ''; + return sprintf( + $format, + $this->image->getWidth(), + $this->image->getHeight(), + ROTATING_IMAGE_RESIZED . $this->image->getImage(), + $this->image->getId() + ); + } else { + $format = ''; + return sprintf( + $format, + $this->image->getWidth(), + $this->image->getHeight(), + ROTATING_IMAGE_RESIZED . $this->image->getImage() + ); + } } // }}} diff --git a/Toolkit/RotatingImages/Decorator/User.php b/Toolkit/RotatingImages/Decorator/User.php index af07f71..0eee3a0 100644 --- a/Toolkit/RotatingImages/Decorator/User.php +++ b/Toolkit/RotatingImages/Decorator/User.php @@ -92,6 +92,15 @@ class Toolkit_RotatingImages_Decorator_User */ public function toHtml() { + $rotatingImagesConf = new Config; + $rotatingImagesRoot =& $rotatingImagesConf->parseConfig( + BASE . 'Toolkit/RotatingImages/config.ini', + 'IniFile' + ); + $useTitles = $rotatingImagesRoot + ->getItem('section','conf') + ->getItem('directive', 'useTitles') + ->getContent(); $glmAppBaseUrl = MEDIA_APP_BASE_URL; $baseUrl = MEDIA_BASE_URL; @@ -111,6 +120,9 @@ class Toolkit_RotatingImages_Decorator_User $tpl->compile('rotatingImages.html'); $page = new stdClass(); $page->images = array(); + $page->useTitles = $useTitles; + //var_dump($page); + //exit; $images = ''; foreach ($this->_decorators as $i) { $images .= $i->toHtml(); diff --git a/Toolkit/RotatingImages/Forms/EditImage.php b/Toolkit/RotatingImages/Forms/EditImage.php index ba8da0b..1f20bdf 100644 --- a/Toolkit/RotatingImages/Forms/EditImage.php +++ b/Toolkit/RotatingImages/Forms/EditImage.php @@ -1,6 +1,6 @@ - * @license http://www.gaslightmedia.com Gaslightmedia + * @license http://www.gaslightmedia.com Gaslightmedia * @version CVS: $Id: EditImage.php,v 1.2 2010/08/15 18:40:57 jamie Exp $ - * @link http://demo.gaslightmedia.com + * @link http://demo.gaslightmedia.com */ require_once BASE . 'Toolkit/Forms/Rules/Image.php'; require_once BASE . 'Toolkit/Forms/Rules/Url.php'; @@ -26,8 +26,8 @@ require_once BASE . 'Toolkit/Forms/Rules/Url.php'; * @package Toolkit_RotatingImages * @author Jamie Kahgee * @copyright 2008 Gaslight Media - * @license http://www.gaslightmedia.com Gaslightmedia - * @link http://demo.gaslightmedia.com + * @license http://www.gaslightmedia.com Gaslightmedia + * @link http://demo.gaslightmedia.com */ class Toolkit_RotatingImages_Forms_EditImage extends Toolkit_FormBuilder @@ -79,12 +79,12 @@ class Toolkit_RotatingImages_Forms_EditImage { $c = array(); - // If we are adding a new banner + // If we are adding a new banner if (!filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT)) { $c['current_image_thumb'] = 'Image not yet uploaded'; } - // If the form has been submitted and a new image was uploaded + // If the form has been submitted and a new image was uploaded $currImg = $this->getSubmitValue('image'); if ($this->isSubmitted() && !empty($currImg)) { $img = ''; @@ -135,7 +135,7 @@ class Toolkit_RotatingImages_Forms_EditImage $this->setupDefaults($d); } - // }}} + // }}} // {{{ configureElements() /** @@ -153,8 +153,8 @@ class Toolkit_RotatingImages_Forms_EditImage ->getItem('directive', 'useTitles') ->getContent(); - // All Grouped Elements are created here. - // All Elements are created here. This includes group element definitions. + // All Grouped Elements are created here. + // All Elements are created here. This includes group element definitions. $e[] = array( 'type' => 'advcheckbox', 'req' => false, @@ -227,8 +227,8 @@ class Toolkit_RotatingImages_Forms_EditImage $this->setupElements($e); } - // }}} - // {{{ configureFilters() + // }}} + // {{{ configureFilters() /** * Configure how the form elements should act when being submitted @@ -251,8 +251,8 @@ class Toolkit_RotatingImages_Forms_EditImage $this->setupFilters($f); } - // }}} - // {{{ configureForm() + // }}} + // {{{ configureForm() /** * Configure a form so we can use it @@ -272,8 +272,8 @@ class Toolkit_RotatingImages_Forms_EditImage $this->configureConstants(); } - // }}} - // {{{ configureRules() + // }}} + // {{{ configureRules() /** * Configure how the form elements should act @@ -339,8 +339,8 @@ class Toolkit_RotatingImages_Forms_EditImage $this->setupRules($r); } - // }}} - // {{{ setupRenderers() + // }}} + // {{{ setupRenderers() /** * Custom rendering templates for special fields on the form @@ -356,17 +356,17 @@ class Toolkit_RotatingImages_Forms_EditImage $error = '
{error}
'; $renderer->setElementTemplate( ' - ' . $required . '{label}' . $error . '{element} - ', 'submit' + ' . $required . '{label}' . $error . '{element} + ', 'submit' ); $renderer->setElementTemplate( ' - ' . $required . '{label}' . $error . '{element} - ', 'delete' + ' . $required . '{label}' . $error . '{element} + ', 'delete' ); } - // }}} + // }}} // {{{ toHtml() /** diff --git a/Toolkit/RotatingImages/templates/rotatingImages.html b/Toolkit/RotatingImages/templates/rotatingImages.html index 7a63826..88f6e4f 100644 --- a/Toolkit/RotatingImages/templates/rotatingImages.html +++ b/Toolkit/RotatingImages/templates/rotatingImages.html @@ -13,6 +13,12 @@ top: -10px; right: 10px; } +.theme-default .nivoSlider { + background: none; + box-shadow: 0 0 0 0 transparent; + margin-bottom: 10px; + position: relative; +} #slider-wrapper { width: 100%; height: auto; @@ -28,8 +34,10 @@ {end:} +{if:useTitles}
{if:image.getTitle()}{image.getTitle()}{end:} {if:image.getDescr()}{image.getDescr()}{end:}
{end:} +{end:} diff --git a/admin/rotatingImages.php b/admin/rotatingImages.php index 5b4a1c5..514a991 100644 --- a/admin/rotatingImages.php +++ b/admin/rotatingImages.php @@ -2,8 +2,8 @@ require_once '../setup.phtml'; $rotatingImagesConf = new Config; $rotatingImagesRoot =& $rotatingImagesConf->parseConfig( - BASE . 'Toolkit/RotatingImages/config.ini', - 'IniFile' + BASE . 'Toolkit/RotatingImages/config.ini', + 'IniFile' ); $registry = new Toolkit_Registry; @@ -15,8 +15,8 @@ $registry->router->setPath(BASE . 'Toolkit/RotatingImages'); $registry->router->setApplication('RotatingImages'); $navigation = new Toolkit_RotatingImages_Navigation( - new HTML_Menu(), - new HTML_Menu_DirectRenderer() + new HTML_Menu(), + new HTML_Menu_DirectRenderer() ); $navArray = $navigation->getNavStructure($rotatingImagesRoot); @@ -25,18 +25,18 @@ $navHtml = $navigation->renderPageNav($navArray, 'rows'); $html = $registry->router->loader(); $appName - = $rotatingImagesRoot->getItem('section', 'conf') - ->getItem('directive', 'applicationName') - ->getContent(); + = $rotatingImagesRoot->getItem('section', 'conf') + ->getItem('directive', 'applicationName') + ->getContent(); if (filter_input(INPUT_GET, 'ac') == 'preview') { - GLM_TOOLBOX::top('', '', null, false); - echo $html; - GLM_TOOLBOX::footer(); + GLM_TOOLBOX::top('', '', null, false); + echo $html; + GLM_TOOLBOX::footer(); } else { - GLM_TOOLBOX::top($appName, ''); - echo $navHtml; - echo $html; - GLM_TOOLBOX::footer(); + GLM_TOOLBOX::top($appName, ''); + echo $navHtml; + echo $html; + GLM_TOOLBOX::footer(); } ?>