diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-14 19:43:04 +0000 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-14 19:43:04 +0000 |
| commit | 4b4e9e8e45465012805854dd322431f87f2b09c7 (patch) | |
| tree | f275761db2763a19e0db16894a516357f73fa2a2 /modules/watermark/views | |
| parent | 7fa014ae61b7463632e67923b745a6de07dd3f20 (diff) | |
The start of the watermark module. It doesn't save the watermark at this point. This is more of trying out the approach where Forge is not used for forms. Basic html and the Validation library.
Diffstat (limited to 'modules/watermark/views')
| -rw-r--r-- | modules/watermark/views/watermark_add_form.html.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/watermark/views/watermark_add_form.html.php b/modules/watermark/views/watermark_add_form.html.php new file mode 100644 index 00000000..b5c50697 --- /dev/null +++ b/modules/watermark/views/watermark_add_form.html.php @@ -0,0 +1,46 @@ +<? defined("SYSPATH") or die("No direct script access."); ?> +<? if (empty($_FILES)): ?> +<script> +$("document").ready(function() { + ajaxify_form(); +}); + +function ajaxify_form() { + $("#gUploadWatermarkForm").ajaxForm({ + complete:function(xhr, statusText) { + $("#gUploadWatermarkForm").replaceWith(xhr.responseText); + if (xhr.status == 200) { + $("#gUploadWatermarkForm").clearForm(); + } + ajaxify_form(); + } + }); +} +</script> +<? endif ?> +<form action="<?= url::site("watermark/load")?>" method="post" id="gUploadWatermarkForm" + enctype="multipart/form-data"> + <fieldset> + <legend><?= _("Upload Watermark")?></legend> + <ul> + <li <? if (isset($errors["file"])): ?>class ="gError"<? endif ?>> + <label for="file"><?= _("File")?></label> + <input type="file" id="file" name="file" class="upload" + value="<?= $fields["file"] ?>"> + <? if (isset($errors["file"]["type"])): ?> + <p><?= _("Invalid File Type") ?></p> + <? elseif (isset($errors["file"]["size"])): ?> + <p><?= _("File too large") ?></p> + <? elseif (isset($errors["file"]["valid"])): ?> + <p><?= _("Upload failed") ?></p> + <? endif ?> + <? if (isset($success)): ?> + <p><?= $success ?></p> + <? endif ?> + </li> + <li> + <button type="submit" class="submit"><?= _("Upload") ?></button> + </li> + </ul> + </fieldset> +</form>
\ No newline at end of file |
