If the titles are turned off then keep nivo from outputting them.
Markup changes
* @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()
/**
* @return string HTML output of the anchor
* @access public
*/
- public function toHtml()
- {
- $anchorFormat = '<a href="%s" %s>%s</a>';
- return sprintf(
- $anchorFormat,
- $this->image->getUrl(),
+ public function toHtml()
+ {
+ $anchorFormat = '<a href="%s" %s>%s</a>';
+ return sprintf(
+ $anchorFormat,
+ $this->image->getUrl(),
$this->image->getExternal() ? 'class="external"' : '',
- $this->_imageDecorator->toHtml()
- );
- }
+ $this->_imageDecorator->toHtml()
+ );
+ }
// }}}
public function getTitle()
*/
public function toHtml()
{
- $format = '<img '
- . 'width="%s" '
- . 'height="%s" '
- . 'src="%s" '
- . 'alt="" '
- . 'title="#event-%d">';
- 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 = '<img '
+ . 'width="%s" '
+ . 'height="%s" '
+ . 'src="%s" '
+ . 'alt="" '
+ . 'title="#event-%d">';
+ return sprintf(
+ $format,
+ $this->image->getWidth(),
+ $this->image->getHeight(),
+ ROTATING_IMAGE_RESIZED . $this->image->getImage(),
+ $this->image->getId()
+ );
+ } else {
+ $format = '<img '
+ . 'width="%s" '
+ . 'height="%s" '
+ . 'src="%s" '
+ . 'alt="">';
+ return sprintf(
+ $format,
+ $this->image->getWidth(),
+ $this->image->getHeight(),
+ ROTATING_IMAGE_RESIZED . $this->image->getImage()
+ );
+ }
}
// }}}
*/
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;
$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();
<?php
-// vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker syntax=php:
+// vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker syntax=php:
/**
* File Doc Comment
* @category RotatingImages
* @package Toolkit_RotatingImages
* @author Jamie Kahgee <steve@gaslightmedia.com>
- * @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';
* @package Toolkit_RotatingImages
* @author Jamie Kahgee <steve@gaslightmedia.com>
* @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
{
$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 = '<img src="%s%s">';
$this->setupDefaults($d);
}
- // }}}
+ // }}}
// {{{ configureElements()
/**
->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,
$this->setupElements($e);
}
- // }}}
- // {{{ configureFilters()
+ // }}}
+ // {{{ configureFilters()
/**
* Configure how the form elements should act when being submitted
$this->setupFilters($f);
}
- // }}}
- // {{{ configureForm()
+ // }}}
+ // {{{ configureForm()
/**
* Configure a form so we can use it
$this->configureConstants();
}
- // }}}
- // {{{ configureRules()
+ // }}}
+ // {{{ configureRules()
/**
* Configure how the form elements should act
$this->setupRules($r);
}
- // }}}
- // {{{ setupRenderers()
+ // }}}
+ // {{{ setupRenderers()
/**
* Custom rendering templates for special fields on the form
$error = '<!-- BEGIN error --><div class="req"> {error} </div><!-- END error -->';
$renderer->setElementTemplate(
'<tr align="center">
- <td colspan="2">' . $required . '{label}' . $error . '{element}</td>
- </tr>', 'submit'
+ <td colspan="2">' . $required . '{label}' . $error . '{element}</td>
+ </tr>', 'submit'
);
$renderer->setElementTemplate(
'<tr align="center">
- <td colspan="2">' . $required . '{label}' . $error . '{element}</td>
- </tr>', 'delete'
+ <td colspan="2">' . $required . '{label}' . $error . '{element}</td>
+ </tr>', 'delete'
);
}
- // }}}
+ // }}}
// {{{ toHtml()
/**
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;
{end:}
</div>
</div>
+{if:useTitles}
<div flexy:foreach="images,image" id="event-{image.getId():h}" class="nivo-html-caption">
{if:image.getTitle()}<strong>{image.getTitle()}</strong>{end:}
{if:image.getDescr()}<span>{image.getDescr()}</span>{end:}
</div>
{end:}
+{end:}
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;
$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);
$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();
}
?>