From: Michael J. Rubinsky Date: Sun, 19 Sep 2010 19:35:37 +0000 (-0400) Subject: use filename as default caption when uploading via Ansel's UI X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e8cb8df3376d7f066a138e87af791b533bbaac8a;p=horde.git use filename as default caption when uploading via Ansel's UI --- diff --git a/ansel/lib/Gallery.php b/ansel/lib/Gallery.php index c02fb83c7..4e6f17b59 100644 --- a/ansel/lib/Gallery.php +++ b/ansel/lib/Gallery.php @@ -220,7 +220,13 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical /** * Add an image to this gallery. * - * @param array $image_data The image to add. Required keys include + * @param array $image_data The image to add. Keys include: + *
+     *    image_filename   - The filename of the image [REQUIRED].
+     *    data             - The binary image data [REQUIRED]
+     *    image_caption    - The caption/description. Defaults to filename.
+     *    image_type       - The MIME type of the image. Attempts to detect.
+     *  
* 'image_caption', and 'data'. Optional keys * include 'image_filename' and 'image_type' * @@ -239,8 +245,8 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical } $resetStack = false; - if (!isset($image_data['image_filename'])) { - $image_data['image_filename'] = 'Untitled'; + if (empty($image_data['image_caption'])) { + $image_data['image_caption'] = $image_data['image_filename']; } $image_data['gallery_id'] = $this->id; $image_data['image_sort'] = $this->countImages();