Created
February 25, 2013 17:49
-
-
Save jbroadway/5031735 to your computer and use it in GitHub Desktop.
File chooser in Elefant
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/file.html --> | |
{! filemanager/util/browser !} | |
<form method="post" id="{{_form}}"> | |
<p> | |
<input type="text" name="file" id="file" value="{{file|quotes}}" /> | |
<input type="submit" id="browse" value="{"Choose an file"}" /> | |
</p> | |
<p><input type="submit" value="{"Submit"}" /></p> | |
</form> | |
<script> | |
$(function () { | |
$('#browse').click (function () { | |
$.filebrowser ({ | |
set_value: '#file' | |
}); | |
return false; | |
}); | |
}); | |
</script> |
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/file.php | |
$page->layout = 'admin'; | |
$page->title = __ ('File Chooser Example'); | |
$form = new Form ('post', $this); | |
echo $form->handle (function ($form) use ($page) { | |
$page->title = __ ('Your File:'); | |
printf ('<p><a href="%s">%s</a></p>', $_POST['file'], basename ($_POST['file'])); | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment