Skip to content

Instantly share code, notes, and snippets.

@jbroadway
Created May 2, 2012 05:42
Show Gist options
  • Save jbroadway/2574180 to your computer and use it in GitHub Desktop.
Save jbroadway/2574180 to your computer and use it in GitHub Desktop.
Calling the jwysiwyg file manager in Elefant without the editor
<!-- apps/test/views/fm.html -->
<script>
function filemanager () {
$.wysiwyg.fileManager.init (function (file) {
$('#file').val (file);
});
return false;
}
$(function () {
$.wysiwyg.fileManager.setAjaxHandler ('http://{{ $_SERVER.HTTP_HOST }}/filemanager/embed');
});
</script>
<p>
<input type="text" id="file" />
<a href="#" onclick="return filemanager ()">Browse</a>
</p>
<?php
// apps/test/handlers/fm.php
$this->require_admin ();
$page->layout = 'admin';
$page->add_style ('/css/wysiwyg/jquery.wysiwyg.css');
$page->add_style ('/css/files/wysiwyg.fileManager.css');
$page->add_script ('/js/wysiwyg/jquery.wysiwyg.js');
$page->add_script ('/js/wysiwyg/plugins/wysiwyg.fileManager.js');
$page->title = i18n_get ('FileManager Test');
echo $tpl->render ('test/fm');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment