elfinder_standalone.tpl 1.4 KB

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