Browse Source

Funktion getImgInfo() zu getImageInfo() und Key ''data'' im

Rückgabewert in ''label'' umbenannt (fixes #30)
tags/release-0-1^0
Jan Dittberner 12 years ago
parent
commit
098528cb41
3 changed files with 6 additions and 8 deletions
  1. +1
    -1
      ajaxrequest.php
  2. +2
    -4
      includes/galleryfunctions.php
  3. +3
    -3
      scripts/ourhandlers.js

+ 1
- 1
ajaxrequest.php View File

@@ -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");


+ 2
- 4
includes/galleryfunctions.php View File

@@ -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),


+ 3
- 3
scripts/ourhandlers.js View File

@@ -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"];
});
}


Loading…
Cancel
Save