Changeset 579 for trunk/plugins


Ignore:
Timestamp:
09/19/06 19:35:56 (13 years ago)
Author:
ray
Message:

ExtendedFileManager? updates:

*to complete cofigurability through js directories can now be set for images and files individually (optional & backwards compatible)

  • relocated button from the end of toolbar next to createlink
  • insert image/link with double click
  • preview img didn't have src when no image selected, which showed a "image not found icon" in IE
  • slight modifications and updates in Readme.txt (kicked out afru's website. The domain isn't even registered anymore)
Location:
trunk/plugins/ExtendedFileManager
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ExtendedFileManager/Classes/ExtendedFileManager.php

    r524 r579  
    5454        function getImagesDir() 
    5555        { 
    56                 Return $this->config['images_dir']; 
     56                if ($this->mode == 'link' && isset($this->config['files_dir'])) 
     57                        Return $this->config['files_dir']; 
     58                else Return $this->config['images_dir']; 
    5759        } 
    5860 
     
    6365        function getImagesURL() 
    6466        { 
    65                 Return $this->config['images_url']; 
     67                if ($this->mode == 'link' && isset($this->config['files_url'])) 
     68                                Return $this->config['files_url']; 
     69                else Return $this->config['images_url']; 
    6670        } 
    6771 
     
    657661                //well, no thumbnail was found, so ask the thumbs.php 
    658662                //to generate the thumbnail on the fly. 
    659                 Return $IMConfig['backend_url'] . '__function=thumbs&img='.rawurlencode($relative); 
     663                Return $IMConfig['backend_url'] . '__function=thumbs&img='.rawurlencode($relative)."&mode=$this->mode"; 
    660664        } 
    661665 
  • trunk/plugins/ExtendedFileManager/Readme.txt

    r567 r579  
    11Package : Extended File Manager EFM 1.1.1 
    2 Plugin url : http://www.afrusoft.com/htmlarea 
     2 
    33Version 1.1 created from 1.0 beta by Krzysztof Kotowicz <koto@webworkers.pl> 
    44 
     
    66---------- 
    77 
    8 Extended File Manager is an advanced plugin for HtmlArea 3.0  
     8Extended File Manager is an advanced plugin for Xinha  
    99 
    1010It works in two different modes. 
     
    12122). Insert File Link Mode. 
    1313 
    14 In Insert Image Mode, it replaces the basic insert image functionality of HtmlArea with its advanced image manager. 
     14In Insert Image Mode, it replaces the basic insert image functionality of Xinha with its advanced image manager. 
    1515 
    1616If Insert File Link Mode is enabled, a new icon will be added to the toolbar with advanced file linking capability. 
     
    3636* Can be used to insert link to non-image files like pdf or zip. 
    3737* You can specify image margin / padding / background and border colors 
    38 ** You may edit Alt/title tags for inserted images 
     38* You may edit Alt/title tags for inserted images 
     39 
     40(Most of the features can be enabled/disabled as needed) 
    3941 
    4042Installation : 
     
    4648Plugin may be configured via xinha_config.ExtendedFileManager object. 
    4749Look into ImageManager plugin documentation as this plugin uses almost identical 
    48 settings.  
    49  
    50 The plugin may share the same config array as ImageManager plugin - just specify 
    51 the same storage location like this: 
     50settings. All available options can be found in the file config.inc.php. 
    5251 
    5352// only snippets of code from initializing file shown below 
     
    6766... 
    6867 
    69 // pass the configuration to plugins 
     68//If you don't want to add a button for linking files and use only the advanced ImageManager 
     69xinha_config.ExtendedFileManager.use_linker = false; 
     70// pass the configuration to plugin 
    7071if (xinha_config.ExtendedFileManager) { 
    7172            with (xinha_config.ExtendedFileManager) 
     
    7778            $IMConfig['images_dir'] = '<images dir>'; 
    7879            $IMConfig['images_url'] = '<images url>'; 
     80            $IMConfig['files_dir'] = '<files dir>'; 
     81            $IMConfig['files_url'] = '<files url>'; 
    7982            $IMConfig['thumbnail_prefix'] = 't_'; 
    8083            $IMConfig['thumbnail_dir'] = 't'; 
     
    8689 
    8790            $IMConfig['max_filesize_kb_link'] = 5000; 
    88             // maximum size for uploading files in 'insert link' mode (2000 kB here) 
     91            // maximum size for uploading files in 'insert link' mode (5000 kB here) 
    8992 
    9093            // Maximum upload folder size in Megabytes. 
  • trunk/plugins/ExtendedFileManager/config.inc.php

    r576 r579  
    6060*/ 
    6161$IMConfig['images_dir'] = 'demo_images'; 
     62//You may set a different directory for the link mode; if you don't, the above setting will be used for both modes 
     63//$IMConfig['files_dir'] = 'demo_files'; 
    6264 
    6365/* 
     
    6971 in this directory and its subdirectories. 
    7072*/ 
    71 if ($insertMode == 'image') 
    72         $IMConfig['images_url'] = str_replace( "backend.php", "", $_SERVER["PHP_SELF"] ) . "demo_images"; 
    73 else if($insertMode == "link") 
    74         $IMConfig['images_url'] = str_replace( "manager.php", "", $_SERVER["PHP_SELF"] ) . "demo_images"; 
     73$IMConfig['images_url'] = str_replace( "backend.php", "", $_SERVER["PHP_SELF"] ) . "demo_images"; 
     74//$IMConfig['files_url'] = 'url/to/files_dir'; 
     75 
    7576/* 
    7677  Possible values: true, false 
  • trunk/plugins/ExtendedFileManager/editor.php

    r521 r579  
    88 * http://www.afrusoft.com/htmlarea 
    99 */ 
     10if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; 
     11        if(!isset($insertMode)) $insertMode="image"; 
    1012 
    1113require_once('config.inc.php'); 
     
    1315require_once('../ImageManager/Classes/ImageEditor.php'); 
    1416 
    15 $manager = new ExtendedFileManager($IMConfig); 
     17$manager = new ExtendedFileManager($IMConfig,$insertMode); 
    1618$editor = new ImageEditor($manager); 
    1719 
     
    2931/*<![CDATA[*/ 
    3032 
    31     var _backend_url = "<?php print $IMConfig['backend_url']; ?>"; 
     33    var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&"; 
    3234 
    3335        if(window.opener) 
     
    142144</div> 
    143145<div id="contents"> 
    144 <iframe src="<?php print $IMConfig['backend_url']; ?>__function=editorFrame&img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor"  scrolling="auto" title="Image Editor" frameborder="0"></iframe> 
     146<iframe src="<?php print $IMConfig['backend_url']; ?>__function=editorFrame&img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>&mode=<?php echo $insertMode ?>" name="editor" id="editor"  scrolling="auto" title="Image Editor" frameborder="0"></iframe> 
    145147</div> 
    146148<div id="bottom"></div> 
  • trunk/plugins/ExtendedFileManager/editorFrame.php

    r521 r579  
    88 * http://www.afrusoft.com/htmlarea 
    99 */ 
     10if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; 
     11        if(!isset($insertMode)) $insertMode="image"; 
    1012 
    1113require_once('config.inc.php'); 
     
    1315require_once('../ImageManager/Classes/ImageEditor.php'); 
    1416 
    15 $manager = new ExtendedFileManager($IMConfig); 
     17$manager = new ExtendedFileManager($IMConfig,$insertMode); 
    1618$editor = new ImageEditor($manager); 
    1719$imageInfo = $editor->processImage(); 
     
    2628<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/EditorContent.js"></script> 
    2729<script type="text/javascript"> 
    28     var _backend_url = "<?php print $IMConfig['backend_url']; ?>"; 
     30    var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&"; 
    2931 
    3032    if(window.top) 
  • trunk/plugins/ExtendedFileManager/extended-file-manager.js

    r573 r579  
    3939    var toolbar = cfg.toolbar; 
    4040    var self = this; 
    41  
    42     cfg.registerButton({ 
    43         id        : "linkfile", 
    44         tooltip   : HTMLArea._lc("Insert File Link",'ExtendedFileManager'), 
    45         image     : _editor_url + 'plugins/ExtendedFileManager/img/ed_linkfile.gif', 
    46         textMode  : false, 
    47         action    : function(editor) { 
    48                 editor._linkFile(); 
    49               } 
    50         }); 
    51     cfg.toolbar.push([ "linkfile" ]); 
    52 }; 
     41     
     42    if (cfg.ExtendedFileManager.use_linker) { 
     43        cfg.registerButton({ 
     44            id        : "linkfile", 
     45            tooltip   : HTMLArea._lc("Insert File Link",'ExtendedFileManager'), 
     46            image     : _editor_url + 'plugins/ExtendedFileManager/img/ed_linkfile.gif', 
     47            textMode  : false, 
     48            action    : function(editor) { 
     49                    editor._linkFile(); 
     50                  } 
     51            }); 
     52        cfg.addToolbarElement("linkfile", "createlink", 1); 
     53        }; 
     54    } 
    5355 
    5456ExtendedFileManager._pluginInfo = { 
     
    6264HTMLArea.Config.prototype.ExtendedFileManager = 
    6365{ 
     66  'use_linker': true, 
    6467  'backend'    : _editor_url + 'plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&', 
    6568  'backend_data' : null, 
  • trunk/plugins/ExtendedFileManager/images.php

    r524 r579  
    108108                <tr> 
    109109                          <td><img src="<?php print $IMConfig['base_url']; if(is_file('icons/'.$file['ext'].'_small.gif')) echo "icons/".$file['ext']."_small.gif"; else echo $IMConfig['default_listicon']; ?>" alt="" /></td> 
    110                   <th><a href="#" class="thumb" style="cursor: pointer;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" <?php if ($insertMode == 'image') { ?> onmouseover="showPreview('<?php echo $file['relative'];?>')" onmouseout="showPreview(window.parent.document.getElementById('f_url').value)" <?php } ?> > 
     110                  <th><a href="#" class="thumb" style="cursor: pointer;" ondblclick="this.onclick();window.top.onOK();" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" <?php if ($insertMode == 'image') { ?> onmouseover="showPreview('<?php echo $file['relative'];?>')" onmouseout="showPreview(window.parent.document.getElementById('f_url').value)" <?php } ?> > 
    111111                                <?php 
    112112                                if(strlen($entry)>$maxNameLength) echo substr($entry,0,$maxNameLength)."..."; else echo $entry; 
     
    162162                        ?> 
    163163                <div class="thumb_holder" id="holder_<?php echo asc2hex($entry) ?>"> 
    164                   <a href="#" class="thumb" style="cursor: pointer;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"> 
     164                  <a href="#" class="thumb" style="cursor: pointer;" ondblclick="this.onclick();window.top.onOK();" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"> 
    165165                    <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" /> 
    166166                  </a> 
     
    203203{ 
    204204?> 
    205 <div class="error"><span>Invalid base directory:</span> <?php echo $manager->config['images_dir']; ?></div> 
     205<div class="error"><span>Invalid base directory:</span> <?php echo $manager->getImagesDir(); ?></div> 
    206206<?php 
    207207} 
     
    296296        function editImage(image)  
    297297        { 
    298                 var url = "<?php print $IMConfig['backend_url']; ?>__function=editor&img="+image; 
     298                var url = "<?php print $IMConfig['backend_url']; ?>__function=editor&img="+image+"&mode=<?php print $insertMode ?>"; 
    299299        Dialog(url, function(param) 
    300300                { 
  • trunk/plugins/ExtendedFileManager/manager.php

    r574 r579  
    152152            <td rowspan="<?php echo $num_rows ?>" colspan="2" valign="top"><?php if($insertMode=='image') { ?> 
    153153            <div style="padding:4px;background-color:#CCC;border:1px inset;width: 100px; height: 100px;"> 
    154             <img src="" id="f_preview" /> 
     154            <img src="<?php print $IMConfig['base_url'];?>img/1x1_transparent.gif" id="f_preview" /> 
    155155            </div> 
    156156            <?php } else if($insertMode=="link" && $IMConfig['link_enable_target'] !== false) {?><label for="f_align">Target Window</label> 
  • trunk/plugins/ExtendedFileManager/thumbs.php

    r521 r579  
    1010 * http://www.afrusoft.com/htmlarea 
    1111 */ 
     12if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; 
     13if(!isset($insertMode)) $insertMode="image"; 
    1214 
    1315require_once('config.inc.php'); 
     
    1921        exit(); 
    2022 
    21  
    22 $manager = new ExtendedFileManager($IMConfig); 
     23$manager = new ExtendedFileManager($IMConfig,$insertMode); 
    2324 
    2425//get the image and the full path to the image 
Note: See TracChangeset for help on using the changeset viewer.