From b5f2443bb53b802366d1f76c80beebef70129e3f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 10 Nov 2008 00:25:59 +0000 Subject: Add the ability to create albums to the scaffolding Revert $_POST back to $this->input->post() because that supports default values. --- core/controllers/item.php | 12 +++++++++--- core/views/welcome.html.php | 12 +++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/controllers/item.php b/core/controllers/item.php index f047e810..38049380 100644 --- a/core/controllers/item.php +++ b/core/controllers/item.php @@ -67,13 +67,19 @@ class Item_Controller extends Controller { switch ($this->input->post("type")) { case "album": $new_item = album::create( - $item->id, $_POST["name"], $_POST["title"], $_POST["description"]); + $item->id, + $this->input->post("name"), + $this->input->post("title", $this->input->post("name")), + $this->input->post("description")); break; case "photo": $new_item = photo::create( - $item->id, $_FILES["file"]["tmp_name"], $_FILES["file"]["name"], - $_POST["title"], $_POST["description"]); + $item->id, + $_FILES["file"]["tmp_name"], + $_FILES["file"]["name"], + $this->input->post("title", $this->input->post("name")), + $this->input->post("description")); break; } diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php index 19001db6..d4015a91 100644 --- a/core/views/welcome.html.php +++ b/core/views/welcome.html.php @@ -155,12 +155,22 @@

" enctype="multipart/form-data">

- Upload: + Upload: +

+
"> +

+ Create Album: + + + + +

+
-- cgit v1.2.3