fix renaming albums
This commit is contained in:
parent
b5ae924031
commit
415e968612
|
@ -98,7 +98,7 @@ function galleryRename(name) {
|
||||||
}
|
}
|
||||||
$.getJSON("ajax/galleryOp.php", {operation: "rename", oldname: name, newname: result}, function(r) {
|
$.getJSON("ajax/galleryOp.php", {operation: "rename", oldname: name, newname: result}, function(r) {
|
||||||
if (r.status == "success") {
|
if (r.status == "success") {
|
||||||
Albums.rename($(".gallery_album_box").filterAttr('data-album',albumName), result);
|
Albums.rename($(".gallery_album_box").filterAttr('data-album',name), result);
|
||||||
} else {
|
} else {
|
||||||
alert("Error: " + r.cause);
|
alert("Error: " + r.cause);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,8 +75,8 @@ Albums={
|
||||||
},
|
},
|
||||||
rename: function(element, new_name) {
|
rename: function(element, new_name) {
|
||||||
if (new_name) {
|
if (new_name) {
|
||||||
$(element).attr("title", new_name);
|
$(element).attr("data-album", new_name);
|
||||||
$("a", element).attr("href", "?view="+new_name);
|
$("a.view", element).attr("href", "?view="+new_name);
|
||||||
$("h1", element).text(new_name);
|
$("h1", element).text(new_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class OC_Gallery_Album {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function rename($oldname, $newname, $owner) {
|
public static function rename($oldname, $newname, $owner) {
|
||||||
$stmt = OC_DB::prepare('UPDATE OR IGNORE *PREFIX*gallery_albums SET album_name=? WHERE uid_owner=? AND album_name=?');
|
$stmt = OC_DB::prepare('UPDATE *PREFIX*gallery_albums SET album_name=? WHERE uid_owner=? AND album_name=?');
|
||||||
$stmt->execute(array($newname, $owner, $oldname));
|
$stmt->execute(array($newname, $owner, $oldname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class OC_Gallery_Album {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function changePath($oldname, $newname, $owner) {
|
public static function changePath($oldname, $newname, $owner) {
|
||||||
$stmt = OC_DB::prepare('UPDATE OR IGNORE *PREFIX*gallery_albums SET album_path=? WHERE uid_owner=? AND album_path=?');
|
$stmt = OC_DB::prepare('UPDATE *PREFIX*gallery_albums SET album_path=? WHERE uid_owner=? AND album_path=?');
|
||||||
$stmt->execute(array($newname, $owner, $oldname));
|
$stmt->execute(array($newname, $owner, $oldname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue