diff --git a/modules/editor/components/image_gallery/image_gallery.class.php b/modules/editor/components/image_gallery/image_gallery.class.php index 63dae031c..52555f059 100644 --- a/modules/editor/components/image_gallery/image_gallery.class.php +++ b/modules/editor/components/image_gallery/image_gallery.class.php @@ -49,11 +49,14 @@ $gallery_info->bg_color = $xml_obj->attrs->bg_color; $gallery_info->gallery_align = $xml_obj->attrs->gallery_align; - preg_match_all("/([^\"]){0,1}http([a-zA-Z0-9\_\-\:\/\.\~]*)([^\.]*)\.(gif|jpg|jpeg|png)/i",trim($xml_obj->body),$matches); - $image_list = $matches[0]; - $image_count = count($image_list); - for($i=0;$i<$image_count;$i++) $image_list[$i] = preg_replace('/^(\>|\s)/','', $image_list[$i]); - $gallery_info->image_list = $image_list; + $images_list = $xml_obj->attrs->images_list; + $images_list = preg_replace('/\.(gif|jpg|jpeg|png) /i',".\\1\n",$images_list); + $gallery_info->images_list = explode("\n",trim($images_list)); + + if(!$gallery_info->width) { + preg_match_all('/([0-9]+)/i',$xml_obj->attrs->style,$matches); + $gallery_info->width = $matches[0][0]; + } Context::set('gallery_info', $gallery_info); diff --git a/modules/editor/components/image_gallery/tpl/list_gallery.html b/modules/editor/components/image_gallery/tpl/list_gallery.html index 54df67a0c..8d159d4ad 100644 --- a/modules/editor/components/image_gallery/tpl/list_gallery.html +++ b/modules/editor/components/image_gallery/tpl/list_gallery.html @@ -1,7 +1,7 @@