Changeset 573
- Timestamp:
- 09/16/06 01:12:46 (7 years ago)
- Location:
- trunk/plugins/ExtendedFileManager
- Files:
-
- 1 added
- 4 modified
-
config.inc.php (modified) (1 diff)
-
extended-file-manager.js (modified) (2 diffs)
-
img/unlocked.gif (modified) (previous)
-
img/unlocked_empty.gif (added)
-
manager.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/ExtendedFileManager/config.inc.php
r571 r573 210 210 $IMConfig['use_color_pickers'] = true; 211 211 212 /* 213 Possible values: true, false 214 215 TRUE - Allow the user to set alt (alternative text) attribute. 216 217 FALSE - No input field for alt attribute will be displayed. 218 219 NOTE: The alt attribute is _obligatory_ for images 220 */ 212 221 $IMConfig['images_enable_alt'] = true; 222 223 224 /* 225 Possible values: true, false 226 227 TRUE - Allow the user to set title attribute (usually displayed when mouse is over element). 228 229 FALSE - No input field for title attribute will be displayed. 230 231 */ 213 232 $IMConfig['images_enable_title'] = false; 214 233 234 /* 235 Possible values: true, false 236 237 TRUE - Allow the user to set align attribute. 238 239 FALSE - No selection box for align attribute will be displayed. 240 241 */ 242 $IMConfig['images_enable_align'] = true; 243 244 /* 245 Possible values: true, false 246 247 TRUE - Allow the user to set margin, padding, and border styles for the image 248 249 FALSE - No styling input fields will be displayed. 250 251 */ 252 $IMConfig['images_enable_styling'] = true; 253 254 /* 255 Possible values: true, false 256 257 TRUE - Allow the user to set target attribute for link (the window in which the link will be opened). 258 259 FALSE - No selection box for target attribute will be displayed. 260 261 */ 262 $IMConfig['link_enable_target'] = true; 215 263 /* 216 264 Possible values: true, false -
trunk/plugins/ExtendedFileManager/extended-file-manager.js
r571 r573 166 166 case "f_title" : img.title = value; break; 167 167 case "f_border" : 168 img.style.borderWidth = /[^0-9]/.test(value) ? value : ( parseInt(value || "0") + 'px');168 img.style.borderWidth = /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') :''; 169 169 if(img.style.borderWidth && !img.style.borderStyle) 170 170 { 171 171 img.style.borderStyle = 'solid'; 172 } 173 else if (!img.style.borderWidth) 174 { 175 img.style.border = ''; 172 176 } 173 177 break; … … 178 182 case "f_height" : img.height = parseInt(value || "0"); break; 179 183 case "f_padding": img.style.padding = 180 /[^0-9]/.test(value) ? value : ( parseInt(value || "0") + 'px'); break;184 /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') :''; break; 181 185 case "f_margin": img.style.margin = 182 /[^0-9]/.test(value) ? value : ( parseInt(value || "0") + 'px'); break;186 /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') :''; break; 183 187 } 184 188 } -
trunk/plugins/ExtendedFileManager/manager.php
r572 r573 18 18 $dirs = $manager->getDirs(); 19 19 20 // calculate number of table rows to span for the preview cell 21 $num_rows = 4; // filename & upload & disk info message & width+margin 22 23 if ($insertMode=='image') 24 { 25 if ($IMConfig['images_enable_styling'] === false) 26 { 27 $hidden_fields[] = 'f_margin'; 28 $hidden_fields[] = 'f_padding'; 29 $hidden_fields[] = 'f_border'; 30 $hidden_fields[] = 'f_backgroundColor'; 31 $hidden_fields[] = 'f_borderColor'; 32 $num_rows +=2; 33 } 34 else if ($IMConfig['use_color_pickers'] === false) 35 { 36 $hidden_fields[] = 'f_backgroundColor'; 37 $hidden_fields[] = 'f_borderColor'; 38 $num_rows +=2; 39 } 40 41 if ($IMConfig['images_enable_align'] === false) 42 { 43 $hidden_fields[] = 'f_align'; 44 } 45 if ($IMConfig['images_enable_alt']) 46 { 47 $num_rows++; 48 } 49 else 50 { 51 $hidden_fields[] = 'f_alt'; 52 } 53 if ($IMConfig['images_enable_title']) 54 { 55 $num_rows++; 56 } 57 else 58 { 59 $hidden_fields[] = 'f_title'; 60 } 61 } 62 63 if ($insertMode == 'link') 64 { 65 if ($IMConfig['link_enable_target'] === false) 66 { 67 $hidden_fields[] = 'f_target'; 68 } 69 $num_rows +=2; 70 } 71 20 72 ?> 21 73 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 22 74 <html> 23 75 <head> 24 <title>Insert File</title>76 <title>Insert <?php echo ($insertMode == 'image' ? 'Image' : 'File Link') ?></title> 25 77 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 26 78 <link href="<?php print $IMConfig['base_url'];?>assets/manager.css" rel="stylesheet" type="text/css" /> … … 99 151 <td align="right" nowrap><label for="f_url"><?php if($insertMode=='image') echo 'File Name'; else echo 'URL';?></label></td> 100 152 <td colspan="5"><input type="text" id="<?php if($insertMode=='image') echo 'f_url'; else echo 'f_href';?>" class="largelWidth" value="" /></td> 101 <?php // calculate number of table rows to span for the preview cell102 $num_rows = 3; // filename & upload & disk info message103 if ($insertMode == 'image' && $IMConfig['images_enable_alt'])104 $num_rows++;105 if ($insertMode == 'link' || $IMConfig['images_enable_title'])106 $num_rows++;107 ?>108 153 <td rowspan="<?php echo $num_rows ?>" colspan="2" valign="top"><?php if($insertMode=='image') { ?> 109 154 <div style="padding:4px;background-color:#CCC;border:1px inset;width: 100px; height: 100px;"> 110 155 <img src="" id="f_preview" /> 111 156 </div> 112 <?php } else if($insertMode=="link" ) {?><label for="f_align">Target Window</label>157 <?php } else if($insertMode=="link" && $IMConfig['link_enable_target'] !== false) {?><label for="f_align">Target Window</label> 113 158 <select id="f_target" style="width:125px;"> 114 159 <option value="">None (use implicit)</option> … … 125 170 <td colspan="5"><input type="text" id="f_alt" class="largelWidth" value="" /></td> 126 171 </tr> 127 <?php } else { 128 $hidden_fields[] = 'f_alt'; 129 } 172 <?php } 130 173 if ($insertMode == 'link' || $IMConfig['images_enable_title']) { ?> 131 174 <tr> … … 133 176 <td colspan="5"><input type="text" id="f_title" class="largelWidth" value="" /></td> 134 177 </tr> 135 <?php } else { 136 $hidden_fields[] = 'f_title'; 137 } ?> 178 <?php } ?> 138 179 <tr> 139 180 <?php … … 147 188 <table cellpadding="0" cellspacing="0" border="0"> 148 189 <tr> 149 <td><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo (($insertMode == 'image' ? $IMConfig['max_filesize_kb_image'] : $IMConfig['max_filesize_kb_link'] )*1024); ?>" />190 <td><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max = (($insertMode == 'image' ? $IMConfig['max_filesize_kb_image'] : $IMConfig['max_filesize_kb_link'] )*1024); ?>" /> 150 191 <input type="file" name="upload" id="upload" /></td> 151 <td><button type="submit" name="submit" onclick="doUpload();">Upload</button> </td>192 <td><button type="submit" name="submit" onclick="doUpload();">Upload</button>(<?php echo $max/1024 . 'KB'?> max.)</td> 152 193 </tr> 153 194 </table> … … 164 205 <td align="right"><?php if($insertMode=='image') { ?> <label for="f_width">Width</label><?php }?></td> 165 206 166 <td ><?php if($insertMode=='image') { ?> <input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/><?php } else echo " ";?></td>207 <td class="smallWidth"><?php if($insertMode=='image') { ?> <input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/><?php } else echo " ";?></td> 167 208 168 209 <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" /> … … 175 216 <td rowspan="3" align="right"></td> 176 217 177 <td align="right"><?php if($insertMode=='image' ) { ?><label for="f_margin">Margin</label><?php }?></td>178 179 <td><?php if($insertMode=='image' ) { ?><input type="text" id="f_margin" class="smallWidth" value="" /><?php } ?></td>218 <td align="right"><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><label for="f_margin">Margin</label><?php }?></td> 219 220 <td><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><input type="text" id="f_margin" class="smallWidth" value="" /><?php } ?></td> 180 221 </tr> 181 222 <tr> 182 223 <td align="right"><?php if($insertMode=='image') { ?><label for="f_height">Height</label><?php }?></td> 183 224 184 <td ><?php if($insertMode=='image') { ?><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/><?php }?></td>185 186 <td align="right"><?php if($insertMode=='image' ) { ?><label for="f_padding">Padding</label><?php }?></td>187 188 <td><?php if($insertMode=='image' ) { ?><input type="text" id="f_padding" class="smallWidth" value="" />225 <td class="smallWidth"><?php if($insertMode=='image') { ?><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/><?php }?></td> 226 227 <td align="right"><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><label for="f_padding">Padding</label><?php }?></td> 228 229 <td><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><input type="text" id="f_padding" class="smallWidth" value="" /> 189 230 <?php }?></td> 190 231 191 <?php if($insertMode=='image' && !empty($IMConfig['use_color_pickers']) ) { ?>192 <t h align="left">Color:</th>232 <?php if($insertMode=='image' && !empty($IMConfig['use_color_pickers']) && $IMConfig['images_enable_styling'] !== false) { ?> 233 <td align="left">Color</td> 193 234 <td> 194 235 <input name="f_backgroundColor" type="text" id="f_backgroundColor" size="7" /><input type="button" id="bgCol_pick" value="..." /> 195 236 </td> 196 <?php } else { // empty space in place of colorpickers ?>197 <td colspan="2" rowspan="2"><input id="f_borderColor" name="f_borderColor" type="hidden" /><input id="f_backgroundColor" name="f_backgroundColor" type="hidden" /></td>198 237 <?php } ?> 199 238 </tr> 200 239 <tr> 201 <td align="right"><?php if($insertMode=='image' ) { ?><label for="f_align">Align</label><?php }?></td>202 203 <td colspan="2"><?php if($insertMode=='image' ) { ?>240 <td align="right"><?php if($insertMode=='image' && $IMConfig['images_enable_align'] !== false) { ?><label for="f_align">Align</label><?php }?></td> 241 242 <td colspan="2"><?php if($insertMode=='image' && $IMConfig['images_enable_align'] !== false) { ?> 204 243 <select size="1" id="f_align" title="Positioning of this image"> 205 <option value="" >Not set</option>244 <option value="" selected="selected" >Not set</option> 206 245 <option value="left" >Left</option> 207 246 <option value="right" >Right</option> 208 247 <option value="texttop" >Texttop</option> 209 248 <option value="absmiddle" >Absmiddle</option> 210 <option value="baseline" selected="selected">Baseline</option>249 <option value="baseline" >Baseline</option> 211 250 <option value="absbottom" >Absbottom</option> 212 251 <option value="bottom" >Bottom</option> … … 216 255 </td> 217 256 218 <td align="right"><?php if($insertMode=='image' ) { ?><label for="f_border">Border</label><?php }?></td>219 <td><?php if($insertMode=='image' ) { ?><input type="text" id="f_border" class="smallWidth" value="" /><?php }?></td>220 <?php if($insertMode=='image' && !empty($IMConfig['use_color_pickers']) ) { ?>221 <t h align="left">Border Color:</th>257 <td align="right"><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><label for="f_border">Border</label><?php }?></td> 258 <td><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><input type="text" id="f_border" class="smallWidth" value="" /><?php }?></td> 259 <?php if($insertMode=='image' && !empty($IMConfig['use_color_pickers']) && $IMConfig['images_enable_styling'] !== false) { ?> 260 <td align="left">Border Color</td> 222 261 <td><input name="f_borderColor" type="text" id="f_borderColor" size="7" /><input type="button" id="bdCol_pick" value="..." /></td> 223 262 <?php } ?>
