diff options
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/album.php | 6 | ||||
-rw-r--r-- | core/helpers/photo.php | 15 |
2 files changed, 18 insertions, 3 deletions
diff --git a/core/helpers/album.php b/core/helpers/album.php index d82f076b..3e3b6054 100644 --- a/core/helpers/album.php +++ b/core/helpers/album.php @@ -62,9 +62,9 @@ class album_Core { static function get_add_form($parent) { $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gAddAlbumForm")); $group = $form->group(sprintf(_("Add Album to %s"), $parent->title)); - $group->input("name"); - $group->input("title"); - $group->input("description"); + $group->input("name")->label(true); + $group->input("title")->label(true); + $group->input("description")->label(true); $group->hidden("type")->value("album"); $group->submit(_("Create")); $form->add_rules_from(ORM::factory("item")); diff --git a/core/helpers/photo.php b/core/helpers/photo.php index fc23c375..6d9887a4 100644 --- a/core/helpers/photo.php +++ b/core/helpers/photo.php @@ -82,4 +82,19 @@ class photo_Core { return $result; } + + static function get_add_form($parent) { + $form = new Forge("albums/{$parent->id}", "", "post", + array("id" => "gAddPhotoForm", "enctype" => "multipart/form-data")); + $group = $form->group(sprintf(_("Add Photo to %s"), $parent->title)); + $group->input("name")->label(true); + $group->input("title")->label(true); + $group->input("description")->label(true)->rules("length[0, 255"); + $group->upload("file")->label(true)->rules("allow[jpg,png,gif,tiff]"); + $group->hidden("type")->value("photo"); + $group->submit(_("Upload")); + $form->add_rules_from(ORM::factory("item")); + return $form; + } + } |