Created
February 27, 2013 16:33
-
-
Save jbroadway/5049305 to your computer and use it in GitHub Desktop.
Selecting multiple files or images in an Elefant form.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- apps/demo/views/multi-file.html --> | |
{! filemanager/util/multi-file !} | |
<script> | |
$(function () { | |
$.multi_file ({ | |
field: '#files', | |
preview: '#preview' | |
}); | |
}); | |
</script> | |
<form method="post" id="{{_form}}"> | |
<p> | |
{"Attach files:"} | |
<div id="preview"></div> | |
<input type="hidden" name="files" id="files" value="{{files|quotes}}" /> | |
</p> | |
<p><input type="submit" value="{"Submit"}" /></p> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // apps/demo/handlers/multi-file.php | |
$page->layout = 'admin'; | |
$page->title = __ ('Multi-file demo'); | |
$form = new Form ('post', $this); | |
$form->data = array ( | |
'files' => '' // set default list here | |
); | |
echo $form->handle (function ($form) use ($page) { | |
$page->title = __ ('Submitted:'); | |
info (explode ('|', $_POST['files'])); | |
}); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- apps/demo/views/multi-image.html --> | |
{! filemanager/util/multi-image !} | |
<script> | |
$(function () { | |
$.multi_image ({ | |
field: '#images', | |
preview: '#preview' | |
}); | |
}); | |
</script> | |
<form method="post" id="{{_form}}"> | |
<p> | |
{"Attach images:"} | |
<div id="preview"></div> | |
<input type="hidden" name="images" id="images" value="{{images|quotes}}" /> | |
</p> | |
<p><input type="submit" value="{"Submit"}" /></p> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // apps/demo/handlers/multi-image.php | |
$page->layout = 'admin'; | |
$page->title = __ ('Multi-image demo'); | |
$form = new Form ('post', $this); | |
$form->data = array ( | |
'images' => '' // set default list here | |
); | |
echo $form->handle (function ($form) use ($page) { | |
$page->title = __ ('Submitted:'); | |
info (explode ('|', $_POST['images'])); | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment