// If the zip file contained a slideshow.xml file, use that for fetching images and their captions
$thumbnails = true;
if (file_exists($XML_path)) {
-
$slideshow_XML = simplexml_load_string(file_get_contents($XML_path));
$slideshowData = CubeIT_Util_Xml::toObject($slideshow_XML);
- foreach ($slideshowData->image as $img) {
+ $images = [];
+ if (is_array($slideshowData->image)) {
+ $images = $slideshowData->image;
+ } else if (is_object($slideshowData->image)) {
+ $images = [$slideshowData->image];
+ }
+ foreach ($images as $img) {
$full_path = $this->path_absolute . '/' . $img->_name;
$slides[] = ['caption' => $img->_caption, 'path' => $full_path];
}
-
$thumbnails = $slideshowData->_thumbnails !== 'false' && $slideshowData->_thumbnails;
} else {
// Or by default, just get all the images that were in the zip file...
if (null !== $slide['caption']) {
$res .= '<p class="fb-slideshow-slide-caption">' . $slide['caption'] . '</p>';
}
-
$res .= '</div>'; // .fb-slideshow-slide
}