Uploading of new photos now fully working.

This commit is contained in:
2016-09-04 14:15:38 +02:00
parent 77a9cd5d53
commit 790d5fc5d0
5 changed files with 81 additions and 32 deletions

View File

@@ -8,11 +8,16 @@
class MediaUploader extends SubTemplate
{
public function __construct(Tag $tag)
{
$this->tag = $tag;
}
protected function html_content()
{
echo '
<form action="" class="admin_box" method="post" enctype="multipart/form-data">
<h2>Upload new photos</h2>
<form action="', BASEURL, '/uploadmedia/?tag=', $this->tag->id_tag, '" class="admin_box" method="post" enctype="multipart/form-data">
<h2>Upload new photos to &quot;', $this->tag->tag, '&quot;</h2>
<div>
<h3>Select files</h3>
<input type="file" id="upload_queue" name="uploads[]" multiple>
@@ -29,7 +34,8 @@ class MediaUploader extends SubTemplate
var upload_queue = new UploadQueue({
queue_element: document.getElementById("upload_queue"),
preview_area: document.getElementById("upload_preview_area"),
submit_button: document.querySelector("input[type=submit]")
submit_button: document.querySelector("input[type=submit]"),
upload_url: "', BASEURL, '/uploadmedia/?format=json&tag=', $this->tag->id_tag, '"
});
}, 100);
</script>';