Changeset 579
- Timestamp:
- 09/19/06 19:35:56 (7 years ago)
- Location:
- trunk/plugins/ExtendedFileManager
- Files:
-
- 2 added
- 9 modified
-
Classes/ExtendedFileManager.php (modified) (3 diffs)
-
Readme.txt (modified) (8 diffs)
-
config.inc.php (modified) (2 diffs)
-
demo_images/Readme.txt (added)
-
editor.php (modified) (4 diffs)
-
editorFrame.php (modified) (3 diffs)
-
extended-file-manager.js (modified) (2 diffs)
-
images.php (modified) (4 diffs)
-
img/1x1_transparent.gif (added)
-
manager.php (modified) (1 diff)
-
thumbs.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/ExtendedFileManager/Classes/ExtendedFileManager.php
r524 r579 54 54 function getImagesDir() 55 55 { 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']; 57 59 } 58 60 … … 63 65 function getImagesURL() 64 66 { 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']; 66 70 } 67 71 … … 657 661 //well, no thumbnail was found, so ask the thumbs.php 658 662 //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"; 660 664 } 661 665 -
trunk/plugins/ExtendedFileManager/Readme.txt
r567 r579 1 1 Package : Extended File Manager EFM 1.1.1 2 Plugin url : http://www.afrusoft.com/htmlarea 2 3 3 Version 1.1 created from 1.0 beta by Krzysztof Kotowicz <koto@webworkers.pl> 4 4 … … 6 6 ---------- 7 7 8 Extended File Manager is an advanced plugin for HtmlArea 3.08 Extended File Manager is an advanced plugin for Xinha 9 9 10 10 It works in two different modes. … … 12 12 2). Insert File Link Mode. 13 13 14 In Insert Image Mode, it replaces the basic insert image functionality of HtmlArea with its advanced image manager.14 In Insert Image Mode, it replaces the basic insert image functionality of Xinha with its advanced image manager. 15 15 16 16 If Insert File Link Mode is enabled, a new icon will be added to the toolbar with advanced file linking capability. … … 36 36 * Can be used to insert link to non-image files like pdf or zip. 37 37 * 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) 39 41 40 42 Installation : … … 46 48 Plugin may be configured via xinha_config.ExtendedFileManager object. 47 49 Look 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: 50 settings. All available options can be found in the file config.inc.php. 52 51 53 52 // only snippets of code from initializing file shown below … … 67 66 ... 68 67 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 69 xinha_config.ExtendedFileManager.use_linker = false; 70 // pass the configuration to plugin 70 71 if (xinha_config.ExtendedFileManager) { 71 72 with (xinha_config.ExtendedFileManager) … … 77 78 $IMConfig['images_dir'] = '<images dir>'; 78 79 $IMConfig['images_url'] = '<images url>'; 80 $IMConfig['files_dir'] = '<files dir>'; 81 $IMConfig['files_url'] = '<files url>'; 79 82 $IMConfig['thumbnail_prefix'] = 't_'; 80 83 $IMConfig['thumbnail_dir'] = 't'; … … 86 89 87 90 $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) 89 92 90 93 // Maximum upload folder size in Megabytes. -
trunk/plugins/ExtendedFileManager/config.inc.php
r576 r579 60 60 */ 61 61 $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'; 62 64 63 65 /* … … 69 71 in this directory and its subdirectories. 70 72 */ 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 75 76 /* 76 77 Possible values: true, false -
trunk/plugins/ExtendedFileManager/editor.php
r521 r579 8 8 * http://www.afrusoft.com/htmlarea 9 9 */ 10 if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; 11 if(!isset($insertMode)) $insertMode="image"; 10 12 11 13 require_once('config.inc.php'); … … 13 15 require_once('../ImageManager/Classes/ImageEditor.php'); 14 16 15 $manager = new ExtendedFileManager($IMConfig );17 $manager = new ExtendedFileManager($IMConfig,$insertMode); 16 18 $editor = new ImageEditor($manager); 17 19 … … 29 31 /*<![CDATA[*/ 30 32 31 var _backend_url = "<?php print $IMConfig['backend_url'] ; ?>";33 var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&"; 32 34 33 35 if(window.opener) … … 142 144 </div> 143 145 <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> 145 147 </div> 146 148 <div id="bottom"></div> -
trunk/plugins/ExtendedFileManager/editorFrame.php
r521 r579 8 8 * http://www.afrusoft.com/htmlarea 9 9 */ 10 if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; 11 if(!isset($insertMode)) $insertMode="image"; 10 12 11 13 require_once('config.inc.php'); … … 13 15 require_once('../ImageManager/Classes/ImageEditor.php'); 14 16 15 $manager = new ExtendedFileManager($IMConfig );17 $manager = new ExtendedFileManager($IMConfig,$insertMode); 16 18 $editor = new ImageEditor($manager); 17 19 $imageInfo = $editor->processImage(); … … 26 28 <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/EditorContent.js"></script> 27 29 <script type="text/javascript"> 28 var _backend_url = "<?php print $IMConfig['backend_url'] ; ?>";30 var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&"; 29 31 30 32 if(window.top) -
trunk/plugins/ExtendedFileManager/extended-file-manager.js
r573 r579 39 39 var toolbar = cfg.toolbar; 40 40 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 } 53 55 54 56 ExtendedFileManager._pluginInfo = { … … 62 64 HTMLArea.Config.prototype.ExtendedFileManager = 63 65 { 66 'use_linker': true, 64 67 'backend' : _editor_url + 'plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&', 65 68 'backend_data' : null, -
trunk/plugins/ExtendedFileManager/images.php
r524 r579 108 108 <tr> 109 109 <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;" on click="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 } ?> > 111 111 <?php 112 112 if(strlen($entry)>$maxNameLength) echo substr($entry,0,$maxNameLength)."..."; else echo $entry; … … 162 162 ?> 163 163 <div class="thumb_holder" id="holder_<?php echo asc2hex($entry) ?>"> 164 <a href="#" class="thumb" style="cursor: pointer;" on click="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']); ?>"> 165 165 <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" /> 166 166 </a> … … 203 203 { 204 204 ?> 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> 206 206 <?php 207 207 } … … 296 296 function editImage(image) 297 297 { 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 ?>"; 299 299 Dialog(url, function(param) 300 300 { -
trunk/plugins/ExtendedFileManager/manager.php
r574 r579 152 152 <td rowspan="<?php echo $num_rows ?>" colspan="2" valign="top"><?php if($insertMode=='image') { ?> 153 153 <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" /> 155 155 </div> 156 156 <?php } else if($insertMode=="link" && $IMConfig['link_enable_target'] !== false) {?><label for="f_align">Target Window</label> -
trunk/plugins/ExtendedFileManager/thumbs.php
r521 r579 10 10 * http://www.afrusoft.com/htmlarea 11 11 */ 12 if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; 13 if(!isset($insertMode)) $insertMode="image"; 12 14 13 15 require_once('config.inc.php'); … … 19 21 exit(); 20 22 21 22 $manager = new ExtendedFileManager($IMConfig); 23 $manager = new ExtendedFileManager($IMConfig,$insertMode); 23 24 24 25 //get the image and the full path to the image
