Changeset 567
- Timestamp:
- 09/13/06 19:24:04 (7 years ago)
- Location:
- trunk/plugins/ExtendedFileManager
- Files:
-
- 1 added
- 6 modified
-
Readme.txt (modified) (3 diffs)
-
assets/images.js (modified) (2 diffs)
-
assets/manager.js (modified) (2 diffs)
-
config.inc.php (modified) (2 diffs)
-
extended-file-manager.js (modified) (4 diffs)
-
lang/de.js (added)
-
manager.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/ExtendedFileManager/Readme.txt
r521 r567 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 39 39 40 Installation : … … 52 53 // only snippets of code from initializing file shown below 53 54 54 <?php55 56 // define backend configuration for both plugins57 58 $IMConfig = array();59 $IMConfig['images_dir'] = '<images dir>';60 $IMConfig['images_url'] = '<images url>';61 $IMConfig['thumbnail_prefix'] = 't_';62 $IMConfig['thumbnail_dir'] = 't';63 $IMConfig['resized_prefix'] = 'resized_';64 $IMConfig['resized_dir'] = '';65 $IMConfig['tmp_prefix'] = '_tmp';66 $IMConfig['max_filesize_kb_image'] = 2000;67 // maximum size for uploading files in 'insert image' mode (2000 kB here)68 69 $IMConfig['max_filesize_kb_link'] = 5000;70 // maximum size for uploading files in 'insert link' mode (2000 kB here)71 72 // Maximum upload folder size in Megabytes.73 // Use 0 to disable limit74 75 $IMConfig['max_foldersize_mb'] = 0;76 $IMConfig['allowed_image_extensions'] = array("jpg","gif","png");77 $IMConfig['allowed_link_extensions'] = array("jpg","gif","pdf","ip","txt",78 "psd","png","html","swf",79 "xml","xls");80 81 $IMConfig = serialize($IMConfig);82 if(!isset($_SESSION['Xinha:ImageManager']))83 {84 $_SESSION['Xinha:ImageManager'] = uniqid('secret_code');85 }86 87 ?>88 55 89 56 xinha_plugins = xinha_plugins ? xinha_plugins : … … 101 68 102 69 // pass the configuration to plugins 103 if (xinha_config.ImageManager) { 104 xinha_config.ImageManager.backend_config = '<?php echo jsaddslashes($IMConfig)?>'; 105 xinha_config.ImageManager.backend_config_hash = '<?php echo sha1($IMConfig . $_SESSION['Xinha:ImageManager'])?>'; 70 if (xinha_config.ExtendedFileManager) { 71 with (xinha_config.ExtendedFileManager) 72 { 73 <?php 74 75 // define backend configuration for the plugin 76 $IMConfig = array(); 77 $IMConfig['images_dir'] = '<images dir>'; 78 $IMConfig['images_url'] = '<images url>'; 79 $IMConfig['thumbnail_prefix'] = 't_'; 80 $IMConfig['thumbnail_dir'] = 't'; 81 $IMConfig['resized_prefix'] = 'resized_'; 82 $IMConfig['resized_dir'] = ''; 83 $IMConfig['tmp_prefix'] = '_tmp'; 84 $IMConfig['max_filesize_kb_image'] = 2000; 85 // maximum size for uploading files in 'insert image' mode (2000 kB here) 86 87 $IMConfig['max_filesize_kb_link'] = 5000; 88 // maximum size for uploading files in 'insert link' mode (2000 kB here) 89 90 // Maximum upload folder size in Megabytes. 91 // Use 0 to disable limit 92 $IMConfig['max_foldersize_mb'] = 0; 93 94 $IMConfig['allowed_image_extensions'] = array("jpg","gif","png"); 95 $IMConfig['allowed_link_extensions'] = array("jpg","gif","pdf","ip","txt", 96 "psd","png","html","swf", 97 "xml","xls"); 98 99 require_once '/path/to/xinha/contrib/php-xinha.php'; 100 xinha_pass_to_php_backend($IMConfig); 101 102 ?> 103 } 106 104 } 107 108 if (xinha_config.ExtendedFileManager) {109 xinha_config.ExtendedFileManager.backend_config = '<?php echo jsaddslashes($IMConfig)?>';110 xinha_config.ExtendedFileManager.backend_config_hash = '<?php echo sha1($IMConfig . $_SESSION['Xinha:ImageManager'])?>';111 }112 113 105 114 106 ===== -
trunk/plugins/ExtendedFileManager/assets/images.js
r524 r567 73 73 topDoc.getElementById('f_url').value = ''; 74 74 topDoc.getElementById('f_alt').value = ''; 75 topDoc.getElementById('f_title').value = ''; 75 76 topDoc.getElementById('f_width').value = ''; 76 77 topDoc.getElementById('f_margin').value = ''; … … 113 114 { 114 115 var obj = topDoc.getElementById('f_url'); obj.value = filename; 115 var obj = topDoc.getElementById('f_alt'); obj.value = alt; 116 obj = topDoc.getElementById('f_alt'); obj.value = alt; 117 obj = topDoc.getElementById('f_title'); obj.value = alt; 116 118 117 119 if(width==0 && height==0) toggleImageProperties(true); -
trunk/plugins/ExtendedFileManager/assets/manager.js
r521 r567 102 102 document.getElementById("f_url").value = param["f_url"]; 103 103 document.getElementById("f_alt").value = param["f_alt"]; 104 document.getElementById("f_title").value = param["f_title"]; 104 105 document.getElementById("f_border").value = param["f_border"]; 105 106 document.getElementById("f_width").value = param["f_width"]; … … 217 218 { 218 219 // pass data back to the calling window 219 var fields = ["f_url", "f_alt", "f_ align", "f_border", "f_margin", "f_padding", "f_height", "f_width", "f_borderColor", "f_backgroundColor"];220 var fields = ["f_url", "f_alt", "f_title", "f_align", "f_border", "f_margin", "f_padding", "f_height", "f_width", "f_borderColor", "f_backgroundColor"]; 220 221 var param = new Object(); 221 222 for (var i in fields) -
trunk/plugins/ExtendedFileManager/config.inc.php
r524 r567 203 203 $IMConfig['use_color_pickers'] = true; 204 204 205 $IMConfig['images_enable_alt'] = false; 206 $IMConfig['images_enable_title'] = true; 207 205 208 /* 206 209 Possible values: true, false … … 254 257 255 258 256 // If config specified from front end, merge it 257 if(isset($_REQUEST['backend_config'])) 259 // Standard PHP Backend Data Passing 260 // if data was passed using xinha_pass_to_php_backend() we merge the items 261 // provided into the Config 262 require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php')); 263 if($passed_data = xinha_read_passed_data()) 264 { 265 $IMConfig = array_merge($IMConfig, $passed_data); 266 $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&'; 267 } 268 // Deprecated config passing, don't use this way any more! 269 elseif(isset($_REQUEST['backend_config'])) 258 270 { 259 271 if(get_magic_quotes_gpc()) { -
trunk/plugins/ExtendedFileManager/extended-file-manager.js
r521 r567 63 63 { 64 64 'backend' : _editor_url + 'plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&', 65 'backend_data' : null, 66 // deprecated keys, use passing data through e.g. xinha_pass_to_php_backend() 65 67 'backend_config' : null, 66 68 'backend_config_hash': null, … … 84 86 f_url : HTMLArea.is_ie ? image.src : image.getAttribute("src"), 85 87 f_alt : image.alt, 88 f_title : image.title, 86 89 f_border : image.style.borderWidth ? image.style.borderWidth : image.border, 87 90 f_align : image.align, … … 115 118 manager += '&backend_config_secret_key_location=' 116 119 + encodeURIComponent(editor.config.ExtendedFileManager.backend_config_secret_key_location); 120 } 121 122 if(editor.config.ExtendedFileManager.backend_data != null) 123 { 124 for ( var i in editor.config.ExtendedFileManager.backend_data ) 125 { 126 manager += '&' + i + '=' + encodeURIComponent(editor.config.ExtendedFileManager.backend_data[i]); 127 } 117 128 } 118 129 … … 151 162 { 152 163 case "f_alt" : img.alt = value; break; 164 case "f_title" : img.title = value; break; 153 165 case "f_border" : 154 166 img.style.borderWidth = /[^0-9]/.test(value) ? value : (parseInt(value || "0") + 'px'); -
trunk/plugins/ExtendedFileManager/manager.php
r525 r567 94 94 </table> 95 95 </fieldset> 96 <!-- temp -->97 <!-- /temp -->98 96 <!-- image properties --> 99 97 <table class="inputTable"> … … 101 99 <td align="right" nowrap><label for="f_url"><?php if($insertMode=='image') echo 'File Name'; else echo 'URL';?></label></td> 102 100 <td colspan="5"><input type="text" id="<?php if($insertMode=='image') echo 'f_url'; else echo 'f_href';?>" class="largelWidth" value="" /></td> 103 <td rowspan="5" colspan="2" valign="top"><?php if($insertMode=='image') { ?> 101 <?php // calculate number of table rows to span for the preview cell 102 $num_rows = 3; // filename & upload & disk info message 103 if ($insertMode == 'image' && $IMConfig['images_enable_alt']) 104 $num_rows++; 105 if ($insertMode == 'link' || $IMConfig['images_enable_title']) 106 $num_rows++; 107 ?> 108 <td rowspan="<?php echo $num_rows ?>" colspan="2" valign="top"><?php if($insertMode=='image') { ?> 104 109 <div style="padding:4px;background-color:#CCC;border:1px inset;width: 100px; height: 100px;"> 105 110 <img src="" id="f_preview" /> … … 114 119 <input type="text" name="f_other_target" id="f_other_target" style="visibility:hidden; width:120px;" /> 115 120 <?php } ?></td> 116 </tr> 117 <tr> 118 <td align="right"><label for="f_alt"><?php if($insertMode=='image') echo 'Alt'; else echo 'Title (tooltip)';?></label></td> 119 <td colspan="5"><input type="text" id="<?php if($insertMode=='image') echo 'f_alt'; else echo 'f_title';?>" class="largelWidth" value="" /></td> 120 </tr> 121 </tr> 122 <?php if($insertMode == 'image' && $IMConfig['images_enable_alt']) { ?> 123 <tr> 124 <td align="right"><label for="f_alt">Alt</label></td> 125 <td colspan="5"><input type="text" id="f_alt" class="largelWidth" value="" /></td> 126 </tr> 127 <?php } else { 128 $hidden_fields[] = 'f_alt'; 129 } 130 if ($insertMode == 'link' || $IMConfig['images_enable_title']) { ?> 131 <tr> 132 <td align="right"><label for="f_title">Title (tooltip)</label></td> 133 <td colspan="5"><input type="text" id="f_title" class="largelWidth" value="" /></td> 134 </tr> 135 <?php } else { 136 $hidden_fields[] = 'f_title'; 137 } ?> 121 138 <tr> 122 139 <?php … … 141 158 </tr> 142 159 <tr> 143 <td> </td>144 <td colspan="5"> <span id="diskmesg"></span></td>160 <td>tu<?php if (!empty($hidden_fields)) foreach ($hidden_fields as $hf) echo "<input type=\"hidden\" id=\"{$hf}\" name=\"{$hf}\" value=\"\" />"; ?></td> 161 <td colspan="5"><span id="diskmesg"></span></td> 145 162 </tr> 146 163 <tr> 147 164 <td align="right"><?php if($insertMode=='image') { ?> <label for="f_width">Width</label><?php }?></td> 148 165 149 <td><?php if($insertMode=='image') { ?> <input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/><?php } else echo "        ";?></td>166 <td><?php if($insertMode=='image') { ?> <input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/><?php } else echo " ";?></td> 150 167 151 168 <td rowspan="2"><?php if($insertMode=='image') { ?><img src="<?php print $IMConfig['base_url'];?>img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" />
