elfinder.tpl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {% extends app.template_style ~ "/layout/no_layout.tpl" %}
  2. {% block body %}
  3. <!-- elFinder CSS (REQUIRED) -->
  4. <link rel="stylesheet" type="text/css" media="screen" href="{{ _p.web_lib }}elfinder/css/elfinder.min.css">
  5. <link rel="stylesheet" type="text/css" media="screen" href="{{ _p.web_lib }}elfinder/css/theme.css">
  6. <!-- elFinder JS (REQUIRED) -->
  7. <script type="text/javascript" src="{{ _p.web_lib }}elfinder/js/elfinder.min.js"></script>
  8. <!-- elFinder translation (OPTIONAL) -->
  9. <script type="text/javascript" src="{{ _p.web_lib }}elfinder/js/i18n/elfinder.ru.js"></script>
  10. <script type="text/javascript" charset="utf-8">
  11. // Helper function to get parameters from the query string.
  12. function getUrlParam(paramName) {
  13. var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i') ;
  14. var match = window.location.search.match(reParam) ;
  15. return (match && match.length > 1) ? match[1] : '';
  16. }
  17. $().ready(function() {
  18. var funcNum = getUrlParam('CKEditorFuncNum');
  19. var elf = $('#elfinder').elfinder({
  20. url : '{{ url('editor_connector') }}', // connector URL (REQUIRED)
  21. getFileCallback : function(file) {
  22. window.opener.CKEDITOR.tools.callFunction(funcNum, file);
  23. window.close();
  24. },
  25. resizable: false
  26. }).elfinder('instance');
  27. });
  28. </script>
  29. <div id="elfinder"></div>
  30. {% endblock %}