Changeset 1300 for branches


Ignore:
Timestamp:
03/29/11 01:39:55 (8 years ago)
Author:
gogo
Message:

Update the MootoolsFileManager? to the latest cpojer with some modifications.
Add a demo for the MFM examples/mootools-file-manager.php
Change the default config for ImageManager? and ExtendedFileManager? for added security.

Location:
branches/MootoolsFileManager-Update
Files:
282 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/MootoolsFileManager-Update/plugins/ExtendedFileManager/config.inc.php

    r1253 r1300  
    189189       is ignored, you can not create directories 
    190190*/ 
    191 $IMConfig['allow_new_dir'] = true; 
     191$IMConfig['allow_new_dir'] = false; 
    192192 
    193193/* 
     
    201201       is ignored, you can not edit images. 
    202202*/ 
    203 $IMConfig['allow_edit_image'] = true; 
     203$IMConfig['allow_edit_image'] = false; 
    204204 
    205205/* 
     
    211211 
    212212*/ 
    213 $IMConfig['allow_rename'] = true; 
     213$IMConfig['allow_rename'] = false; 
    214214 
    215215/* 
     
    221221 
    222222*/ 
    223 $IMConfig['allow_cut_copy_paste'] = true; 
     223$IMConfig['allow_cut_copy_paste'] = false; 
    224224 
    225225/* 
     
    231231 
    232232*/ 
    233 $IMConfig['allow_delete'] = true; 
     233$IMConfig['allow_delete'] = false; 
    234234 
    235235/* 
  • branches/MootoolsFileManager-Update/plugins/ImageManager/config.inc.php

    r1253 r1300  
    224224*/ 
    225225 
    226 $IMConfig['allow_new_dir'] = true; 
     226$IMConfig['allow_new_dir'] = false; 
    227227 
    228228// ------------------------------------------------------------------------- 
     
    255255*/ 
    256256 
    257 $IMConfig['allow_delete'] = true; 
     257$IMConfig['allow_delete'] = false; 
    258258 
    259259// ------------------------------------------------------------------------- 
     
    270270*/ 
    271271 
    272 $IMConfig['allow_edit'] = true; 
     272$IMConfig['allow_edit'] = false; 
    273273 
    274274 
  • branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/MootoolsFileManager.FileManager.js

    r1247 r1300  
    9090        language:       _editor_lang, 
    9191        selectable:     true, 
     92        upload:         this.phpcfg.allow_files_upload, 
     93        destroy:        this.phpcfg.allow_files_delete, 
     94        createFolders:  this.phpcfg.allow_files_upload,    
    9295        uploadAuthData: this.editor.config.MootoolsFileManager.backend_data, 
    9396        onComplete:     function(path, file) { self.FileManagerReturn(path,file); }, 
     
    107110    } 
    108111     
    109     this.FileManagerWidget.show();     
     112    if(link) 
     113    {       
     114        var src  = Xinha.is_ie ? link.href : link.getAttribute("href"); 
     115        if(!src.match(/^(([a-z]+:)|\/)/i)) 
     116        { 
     117            src = self.editor.config.baseHref.replace(/\/[^\/]*$/, '') + '/' + src; 
     118            if(src.match(/^[a-z]+:/i) && !self.phpcfg.files_url.match(/^[a-z]:/i)) 
     119            { 
     120              src = src.replace(/^[a-z]+:(\/\/?)[^/]*/i, ''); 
     121            } 
     122        } 
     123         
     124        // Get exploded path without the base url 
     125        var path = src.replace(self.phpcfg.files_url+'/', '').split('/'); 
     126         
     127        // Pull off the file 
     128        var base = path.pop();       
     129         
     130        // Join the path back togethor (no base url, trailing slash if the path has any length) 
     131        path = path.length ? (path.join('/') + '/') : ''; 
     132         
     133        // feed to widget 
     134        this.FileManagerWidget.show(null, path, base);           
     135    } 
     136    else 
     137    { 
     138      this.FileManagerWidget.show();     
     139    }     
    110140}; 
    111141 
  • branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js

    r1297 r1300  
    7070      selectable:     true, 
    7171      upload:         this.phpcfg.allow_images_upload, 
     72      destroy:        this.phpcfg.allow_images_delete, 
     73      createFolders:  this.phpcfg.allow_images_upload,             
    7274      uploadAuthData: this.editor.config.MootoolsFileManager.backend_data, 
    7375      onComplete:     function(path, file) { self.ImageManagerReturn(path,file); }, 
     
    7577      onShow:         function() {         
    7678        if(this.swf && this.swf.box) this.swf.box.style.display = '';  
    77         if(self.current_image) 
    78         { 
    79             var src  = self.current_image.getAttribute('src'); 
    80             if(!src.match(/^(([a-z]+:)|\/)/i)) 
    81             { 
    82                 src = self.editor.config.baseHref.replace(/\/[^\/]*$/, '') + '/' + src; 
    83                 if(src.match(/^[a-z]+:/i) && !self.phpcfg.images_url.match(/^[a-z]:/i)) 
    84                 { 
    85                   src = src.replace(/^[a-z]+:(\/\/?)[^/]*/i, ''); 
    86                 } 
    87             } 
    88             var path = src.replace(self.phpcfg.images_url+'/', '').split('/'); 
    89             var base = path.pop(); 
    90             path     = self.phpcfg.images_url.split('/').pop() + (path.length ? ('/' + path.join('/')) : '');   
    91             this.load(path, true, (function() { this.fillInfo(base); }).bind(this));             
    92         } 
    9379      }, 
    9480      onDetails:      function(details)  
     
    10591  } 
    10692   
    107   this.ImageManagerWidget.show();     
     93  if(self.current_image) 
     94  {       
     95      var src  = self.current_image.getAttribute('src'); 
     96      if(!src.match(/^(([a-z]+:)|\/)/i)) 
     97      { 
     98          src = self.editor.config.baseHref.replace(/\/[^\/]*$/, '') + '/' + src; 
     99          if(src.match(/^[a-z]+:/i) && !self.phpcfg.images_url.match(/^[a-z]:/i)) 
     100          { 
     101            src = src.replace(/^[a-z]+:(\/\/?)[^/]*/i, ''); 
     102          } 
     103      } 
     104       
     105      // Get exploded path without the base url 
     106      var path = src.replace(self.phpcfg.images_url+'/', '').split('/'); 
     107       
     108      // Pull off the file 
     109      var base = path.pop();       
     110       
     111      // Join the path back togethor (no base url, trailing slash if the path has any length) 
     112      path = path.length ? (path.join('/') + '/') : ''; 
     113       
     114      // feed to widget 
     115      this.ImageManagerWidget.show(null, path, base);           
     116  } 
     117  else 
     118  { 
     119    this.ImageManagerWidget.show();     
     120  } 
    108121}; 
    109122 
  • branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/MootoolsFileManager.css

    r1245 r1300  
    22.filemanager-info-area { width:50%; float:left; clear:left; } 
    33.filemanager-preview-area { width:50%; float:left; clear:right; } 
    4 div.filemanager-info-area dt, div.filemanager-preview-area dt { width:25%; margin-left:5px; } 
     4div.filemanager-info-area dt, div.filemanager-preview-area dt { width:80px; margin-left:5px; } 
    55div.filemanager-info-area dd, div.filemanager-preview-area dd { width:auto; } 
    66 
  • branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/MootoolsFileManager.js

    r1297 r1300  
    4141{ 
    4242  MootoolsFileManager.AssetLoader 
    43     .loadScript('mootools-filemanager/Demos/mootools-core.js', 'MootoolsFileManager') 
    44     .loadScript('mootools-filemanager/Demos/mootools-more.js', 'MootoolsFileManager'); 
     43    .loadScript('mootools-filemanager/Demos/mootools-core-1.3.1.js', 'MootoolsFileManager') 
     44    .loadScript('mootools-filemanager/Demos/mootools-more-1.3.1.1.js', 'MootoolsFileManager'); 
    4545} 
    4646 
     
    4949if(typeof FileManager == 'undefined') 
    5050{ 
     51  if(typeof __MFM_ASSETS_DIR__ == 'undefined') 
     52  { 
     53    __MFM_ASSETS_DIR__ = Xinha.getPluginDir('MootoolsFileManager')+'/mootools-filemanager/Assets' 
     54  } 
     55   
     56  if(typeof __MFM_USE_FLASH__ == 'undefined') 
     57  { 
     58    __MFM_USE_FLASH__ = true; 
     59  } 
     60   
    5161  MootoolsFileManager.AssetLoader 
    52     .loadStyle('mootools-filemanager/Css/FileManager.css', 'MootoolsFileManager') 
    53     .loadStyle('mootools-filemanager/Css/Additions.css', 'MootoolsFileManager') 
    54     .loadScript('mootools-filemanager/Source/Additions.js', 'MootoolsFileManager')         
    55     .loadScript('mootools-filemanager/Source/Uploader/Fx.ProgressBar.js', 'MootoolsFileManager') 
    56     .loadScript('mootools-filemanager/Source/Uploader/Swiff.Uploader.js', 'MootoolsFileManager') 
     62    // These are now loaded by FileManager.js automatically 
     63    //.loadStyle('mootools-filemanager/Assets/Css/FileManager.css', 'MootoolsFileManager') 
     64    //.loadStyle('mootools-filemanager/Assets/Css/Additions.css', 'MootoolsFileManager') 
     65    //.loadScript('mootools-filemanager/Source/Additions.js', 'MootoolsFileManager')         
    5766    .loadScript('mootools-filemanager/Source/FileManager.js', 'MootoolsFileManager') 
    58     .loadScript('mootools-filemanager/Source/Uploader.js', 'MootoolsFileManager') 
    5967    .loadScript('mootools-filemanager/Language/Language.en.js', 'MootoolsFileManager'); 
     68     
     69 if(__MFM_USE_FLASH__) 
     70 { 
     71   MootoolsFileManager.AssetLoader 
     72     .loadScript('mootools-filemanager/Source/Uploader/Swiff.Uploader.js', 'MootoolsFileManager') 
     73     .loadScript('mootools-filemanager/Source/Uploader/Fx.ProgressBar.js', 'MootoolsFileManager') 
     74     .loadScript('mootools-filemanager/Source/Uploader.js', 'MootoolsFileManager'); 
     75 } 
     76 else 
     77 { 
     78   MootoolsFileManager.AssetLoader 
     79      .loadScript('mootools-filemanager/Source/Uploader/Fx.ProgressBar.js', 'MootoolsFileManager') 
     80      .loadScript('mootools-filemanager/Source/NoFlash.Uploader.js', 'MootoolsFileManager'); 
     81 }     
    6082} 
    6183MootoolsFileManager.AssetLoader.loadStyle('MootoolsFileManager.css', 'MootoolsFileManager'); 
    62  
    6384 
    6485function MootoolsFileManager(editor) 
  • branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/backend.php

    r1297 r1300  
    7777require_once('config.php'); 
    7878 
     79// Ensure thumbnail path is OK 
     80if(!isset($IMConfig['files_dir']) || !isset($IMConfig['images_dir'])) 
     81{ 
     82  unset($IMConfig['thumbs_dir']); 
     83  unset($IMConfig['thumbs_url']); 
     84} 
     85else 
     86{  
     87  if(!file_exists($IMConfig['thumbs_dir'])) @mkdir($IMConfig['thumbs_dir']); 
     88} 
     89 
    7990switch ( @$_REQUEST[ "__function" ] ) 
    8091{ 
     
    8798 
    8899  case 'image-manager': 
    89     include('mootools-filemanager/Backend/FileManager.php'); 
     100    include('mootools-filemanager/Assets/Connector/FileManager.php'); 
    90101 
    91102    $browser = new FileManager(array( 
    92103      'directory'     => $IMConfig['images_dir'], 
    93104      'baseURL'       => $IMConfig['images_url'], 
     105      'thumbnailPath' => $IMConfig['thumbs_dir'], 
    94106       
    95107      'assetBasePath' => $IMConfig['base_url'] .'/mootools-filemanager/Assets', 
    96108       
    97109      'upload'        => $IMConfig['allow_images_upload'], 
     110      'create'        => $IMConfig['allow_images_upload'], 
    98111      'maxUploadSize' => size_to_bytes($IMConfig['max_images_upload_size']), 
    99112       
     
    109122   
    110123  case 'file-manager': 
    111     include('mootools-filemanager/Backend/FileManager.php'); 
     124    include('mootools-filemanager/Assets/Connector/FileManager.php'); 
    112125 
    113126    $browser = new FileManager(array( 
    114127      'directory'     => $IMConfig['files_dir'], 
    115128      'baseURL'       => $IMConfig['files_url'], 
     129      'thumbnailPath' => $IMConfig['thumbs_dir'], 
    116130       
    117131      'assetBasePath' => $IMConfig['base_url'] .'/mootools-filemanager/Assets', 
    118132       
    119133      'upload'        => $IMConfig['allow_files_upload'], 
     134      'create'        => $IMConfig['allow_files_upload'], 
    120135      'maxUploadSize' => size_to_bytes($IMConfig['max_files_upload_size']), 
    121136       
  • branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/config.php

    r1297 r1300  
    8888  $IMConfig['images_dir'] = FALSE; // No trailing slash 
    8989  $IMConfig['images_url'] = FALSE; // No trailing slash 
     90   
     91  $IMConfig['thumbs_dir'] = NULL;  // Will default to images_url/.thumbs or files_url/.thumbs 
    9092 
    9193  /** 
     
    191193@session_write_close(); // Close session now so we don't lock. 
    192194 
     195if(!isset($IMConfig['thumbs_dir'])) 
     196{ 
     197  $IMConfig['thumbs_dir'] = (isset($IMConfig['images_dir']) ? $IMConfig['images_dir'] : $IMConfig['files_dir']) . '/.thumbs'; 
     198} 
    193199?> 
Note: See TracChangeset for help on using the changeset viewer.