<?
// limit result to just the selected content.
$query = new P4Cms_Record_Query;
$query->setIds($this->ids);
// default is to sort entries in the order they were selected.
$postSort = array('id' => array(P4Cms_Model_Iterator::SORT_FIXED => $this->ids));
// each image can have a caption and a link
// take advantage of content list helper's entry-options feature
// to pass these through to the display image decorator.
$entryOptions = array();
foreach ($this->images as $image) {
$options = array();
if (isset($image['link'])) {
$options['link'] = $image['link'];
}
if (isset($image['caption'])) {
$options['caption'] = $image['caption'];
}
$entryOptions[$image['id']] = array(
'fields' => array(
'file' => array(
'decorators' => array(
'image' => array(
'options' => $options
)
)
)
)
);
}
if (!empty($this->images)) {
print $this->contentList(
$query,
array(
'dojoType' => 'p4cms.widget.ImageRotator',
'emptyMessage' => '',
'postSort' => $postSort,
'entryOptions' => $entryOptions,
'fields' => array(
'file' => array(
'decorators' => array(
'image' => array(
'decorator' => 'DisplayImage',
'options' => array(
'asBackground' => true,
'noSize' => true
)
)
)
)
),
'width' => $this->widget->getConfig('imageWidth'),
'height' => $this->widget->getConfig('imageHeight')
))->render();
} else {
print "No images to display.";
}
?>
# |
Change |
User |
Description |
Committed |
|
#1
|
16170 |
perforce_software |
Move Chronicle files to follow new path scheme for branching. |
|
|
//guest/perforce_software/chronicle/application/widget/views/scripts/image-rotator-widget/index.phtml |
#1
|
8972 |
Matt Attaway |
Initial add of the Chronicle source code |
|
|