summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/album.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-01-03 15:51:24 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-01-03 15:51:24 +0000
commit399abbc3a754cf5fdcfdff113446e1bc264091e2 (patch)
tree592188568e15325d59e51bf19cfdf667fae8d86d /modules/gallery/helpers/album.php
parent925a6a2220760cb7daacee1ab80a07b61b3a30a1 (diff)
parent64e5efd57ba1479179c202e1b76b6eeb42d2924c (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/album.php')
-rw-r--r--modules/gallery/helpers/album.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php
index cc631be4..feaf74cc 100644
--- a/modules/gallery/helpers/album.php
+++ b/modules/gallery/helpers/album.php
@@ -34,7 +34,7 @@ class album_Core {
* @return Item_Model
*/
static function create($parent, $name, $title, $description=null, $owner_id=null, $slug=null) {
- if (!$parent->loaded || !$parent->is_album()) {
+ if (!$parent->loaded() || !$parent->is_album()) {
throw new Exception("@todo INVALID_PARENT");
}
@@ -68,11 +68,11 @@ class album_Core {
// Randomize the name or slug if there's a conflict
// @todo Improve this. Random numbers are not user friendly
while (ORM::factory("item")
- ->where("parent_id", $parent->id)
- ->open_paren()
- ->where("name", $album->name)
- ->orwhere("slug", $album->slug)
- ->close_paren()
+ ->where("parent_id", "=", $parent->id)
+ ->and_open()
+ ->where("name", "=", $album->name)
+ ->or_where("slug", "=", $album->slug)
+ ->close()
->find()->id) {
$rand = rand();
$album->name = "{$name}-$rand";
@@ -115,6 +115,7 @@ class album_Core {
static function get_edit_form($parent) {
$form = new Forge("albums/update/{$parent->id}", "", "post", array("id" => "g-edit-album-form"));
+ $form->hidden("from_id");
$group = $form->group("edit_item")->label(t("Edit Album"));
$group->input("title")->label(t("Title"))->value($parent->title);