summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/controllers/item.php12
-rw-r--r--core/views/welcome.html.php12
2 files changed, 20 insertions, 4 deletions
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 @@
</p>
<form method="post" action="<?= url::site("album/1") ?>" enctype="multipart/form-data">
<p>
- Upload: <input name="file" type="file"/>
+ Upload:
+ <input name="file" type="file"/>
<input type="hidden" name="type" value="photo"/>
<input type="hidden" name="__action" value="put"/>
<input type="submit"/>
</p>
</form>
+ <form method="post" action="<?= url::site("album/1") ?>">
+ <p>
+ Create Album:
+ <input type="text" name="name"/>
+ <input type="hidden" name="type" value="album"/>
+ <input type="hidden" name="__action" value="put"/>
+ <input type="submit"/>
+ </p>
+ </form>
</div>
<div id="info" class="activity">