diff --git a/ajaxrequest.php b/ajaxrequest.php index 8c537c2..b673df2 100644 --- a/ajaxrequest.php +++ b/ajaxrequest.php @@ -37,7 +37,7 @@ if (isset($_GET["imagename"]) && isset($_GET["galleryname"]) && preg_match('/^[\w\d _-]+\.jp(e|)g$/', $_GET["imagename"]) && preg_match(GALLERY_RE, $_GET["galleryname"])) { header("Content-Type: text/plain; charset=UTF-8"); - if ($imageInfo = getImgInfo($_GET["galleryname"], $_GET["imagename"])) { + if ($imageInfo = getImageInfo($_GET["galleryname"], $_GET["imagename"])) { print json_encode($imageInfo); } else { header("HTTP/1.0 404 Not Found"); diff --git a/includes/galleryfunctions.php b/includes/galleryfunctions.php index 2c31a29..5589035 100644 --- a/includes/galleryfunctions.php +++ b/includes/galleryfunctions.php @@ -95,14 +95,12 @@ function getGalleryConfig($galleryname = null) { * @li @a data Label des Bildes * @li @a preview relative URL des Vorschaubildes * @li @a full relative URL des Vollbildes - * - * @bug @a data sollte @a label heißen */ -function getImgInfo($galleryname, $imagename) { +function getImageInfo($galleryname, $imagename) { $label = getImageLabel($galleryname, $imagename); $gallerylabel = getGalleryLabel($galleryname); return array("name" => $imagename, - "data" => $label, + "label" => $label, "preview" => GALLERYPREFIX . DIRECTORY_SEPARATOR . getScaledImage($galleryname, $imagename, $GLOBALS["previewwidth"], false), diff --git a/scripts/ourhandlers.js b/scripts/ourhandlers.js index f623cb1..e72fddc 100644 --- a/scripts/ourhandlers.js +++ b/scripts/ourhandlers.js @@ -55,11 +55,11 @@ function updateContentImage(pathParts) { "imagename" : pathParts.filename, "galleryname" : pathParts.gallery }, function(data, textStatus) { - $("#imagedescription").text(data["data"]); - $("#content_main img").attr("alt", data["data"]); + $("#imagedescription").text(data["label"]); + $("#content_main img").attr("alt", data["label"]); $("#content_main img").attr("src", data["preview"]); $("#content_main a").attr("href", data["full"]); - $("#content_main a").attr("title", data["data"]); + $("#content_main a").attr("title", data["label"]); document.title = data["title"]; }); }