elfinder_standalone.tpl 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  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. {{ elfinder_translation_file }}
  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. startPathHash: 'l2_Lw', // Sets the course driver as default
  25. resizable: false,
  26. lang: '{{ elfinder_lang }}'
  27. }).elfinder('instance');
  28. });
  29. </script>
  30. <div id="elfinder"></div>