source: branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/mootools-filemanager/Demos/CKEditor.php @ 1302

Last change on this file since 1302 was 1302, checked in by gogo, 8 years ago

Updates to http://www.github.com/sleemanj/mootools-filemanager from GerHoblett?

http://www.github.com/GerHoblett/

Changes to said updates by gogo (sleemanj @ github)

Modifications to MootoolsFileManager? to work with those updates, some courtesy of GerHoblett?, some sleemanj

GerHoblett? provided a large diff which accomplished the goal in a quite different way. It has merit, however I have opted for a less-affecting path in so far as Xinha's "way" is concerned, namely, not splitting the config for a single plugin into several calls to backend config passing functions which seemed a little cumbersome.

Instead I take the option of using POST to send backend data around, at the minor expense of an extra round trip when displaying thumbnails (for each one). This could be reduced by checking for thumbnail existence and returning the thumbnail name directly in "onView" rather than the backend request to generate said thumbnail.

Still to do, is to make the preview pane thumbnail also work.


File size: 2.1 KB
Line 
1<!DOCTYPE html>
2<html>
3  <head>
4  <meta charset="UTF-8" />
5  <meta http-equiv="content-language" content="<?php echo $_GET['langCode']; ?>" />
6 
7  <title>MooTools FileManager CKEditor example</title>
8 
9  <!-- thirdparty/MooTools -->
10  <script type="text/javascript" src="mootools-core.js"></script>
11  <script type="text/javascript" src="mootools-more.js"></script>
12 
13  <!-- thirdparty/MooTools-FileManager -->
14  <script type="text/javascript" src="../Source/FileManager.js"></script>
15  <script type="text/javascript" src="../Source/Uploader/Fx.ProgressBar.js"></script>
16  <script type="text/javascript" src="../Source/Uploader/Swiff.Uploader.js"></script>
17  <script type="text/javascript" src="../Source/Uploader.js"></script>
18  <script type="text/javascript" src="../Language/Language.<?= $_GET["langCode"]; ?>.js"></script>
19
20  <script type="text/javascript">
21  /* <![CDATA[ */
22   
23   /* To use Mootools-FileManager with CKEditor you need set the following CKEDITOR.configs:
24    *
25    * CKEDITOR.config.filebrowserBrowseUrl      = 'path/to/this/CKEditor.php';
26    * CKEDITOR.config.filebrowserWindowWidth    = 1024; // optional
27    * CKEDITOR.config.filebrowserWindowHeight   = 700;  // optional
28    *
29    */
30 
31    function openFilemanager() {
32      var complete = function(path, file){
33        window.opener.CKEDITOR.tools.callFunction('<?= $_GET["CKEditorFuncNum"]; ?>', path);
34        window.close();
35      };
36
37      var fileManager = new FileManager({
38          url: 'manager.php',
39          assetBasePath: '../Assets',
40          language: '<?= $_GET["langCode"]; ?>',
41          destroy: true,
42          upload: true,
43          rename: true,
44          download: true,
45          createFolders: true,
46          selectable: true,
47          hideClose: true,
48          hideOverlay: true,
49          onComplete: complete
50      });
51      fileManager.filemanager.setStyle('width','100%');
52      fileManager.filemanager.setStyle('height','95%');
53     
54      fileManager.show();
55    }
56   
57    window.addEvent('domready', function(){
58      openFilemanager();
59    });
60  /* ]]> */
61  </script>
62 
63  <style type="text/css">
64  body {
65    overflow: hidden;
66  }
67  </style>
68</head>
69<body>
70</body>
71</html>
Note: See TracBrowser for help on using the repository browser.