This is a complete code for tinymce4x and Elfinder file manager integration... just run test.php and upload_files sholud be writable