Changeset 48
- Timestamp:
- 03/21/05 17:46:51 (8 years ago)
- Location:
- trunk/plugins/ImageManager
- Files:
-
- 10 modified
-
Classes/ImageManager.php (modified) (1 diff)
-
README.txt (modified) (3 diffs)
-
assets/editorFrame.js (modified) (4 diffs)
-
assets/images.js (modified) (2 diffs)
-
backend.php (modified) (3 diffs)
-
config.inc.php (modified) (3 diffs)
-
editor.php (modified) (1 diff)
-
image-manager.js (modified) (4 diffs)
-
images.php (modified) (2 diffs)
-
manager.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/ImageManager/Classes/ImageManager.php
r43 r48 554 554 //well, no thumbnail was found, so ask the thumbs.php 555 555 //to generate the thumbnail on the fly. 556 Return $IMConfig['backend_url'] . ' f=thumbs&img='.rawurlencode($relative);556 Return $IMConfig['backend_url'] . '__function=thumbs&img='.rawurlencode($relative); 557 557 } 558 558 -
trunk/plugins/ImageManager/README.txt
r47 r48 23 23 24 24 ------------------------------------------------------------------------------ 25 To get this working check see config.inc.php for configuration values. 25 If you have GD installed and configured in PHP this should work out of the 26 box. 26 27 27 Most likely you will need to adjust images_dir and images_url if you have 28 not unpacked Xinha in your DOCUMENT_ROOT.28 For production use see config.inc.php for configuration values. You will 29 want to adjust images_dir and images_url for your application. 29 30 30 31 For demo purposes ImageManager is set up to view images in the … … 39 40 40 41 -------------------------------------------------------------------------------- 41 42 43 44 I've packaged this up to be distributed with Xinha. In order45 for this to work as is, you either have to unpack Xinha in46 DOCUMENT_ROOT or you will need to edit config.inc.php to match47 your install.48 42 49 43 By default this ImageManager is set up to browse some graphics … … 68 62 Request URLs are of the form: 69 63 70 <config backend URL>(?|&) plugin=ImageManager&f=<function>&arg=value&arg=value64 <config backend URL>(?|&)__plugin=ImageManager&__function=<function>&arg=value&arg=value 71 65 72 66 The default URL is plugins/xinha/backend.php. -
trunk/plugins/ImageManager/assets/editorFrame.js
r43 r48 34 34 // a trailing & 35 35 36 var url = _backend_url + " f=editorFrame&img="+currentImageFile+"&action=crop¶ms="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value);36 var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=crop¶ms="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value); 37 37 38 38 //alert(url); … … 43 43 else if (action == 'scale') 44 44 { 45 var url = _backend_url + " f=editorFrame&img="+currentImageFile+"&action=scale¶ms="+parseInt(s_sw.value)+','+parseInt(s_sh.value);45 var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=scale¶ms="+parseInt(s_sw.value)+','+parseInt(s_sh.value); 46 46 //alert(url); 47 47 location.href = url; … … 53 53 54 54 if(flip.value == 'hoz' || flip.value == 'ver') 55 location.href = _backend_url + " f=editorFrame&img="+currentImageFile+"&action=flip¶ms="+flip.value;55 location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=flip¶ms="+flip.value; 56 56 else if (isNaN(parseFloat(r_ra.value))==false) 57 location.href = _backend_url + " f=editorFrame&img="+currentImageFile+"&action=rotate¶ms="+parseFloat(r_ra.value);57 location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=rotate¶ms="+parseFloat(r_ra.value); 58 58 } 59 59 else if(action == 'save') { … … 71 71 var filename = encodeURI(s_file.value); 72 72 var quality = parseInt(s_quality.value); 73 var url = _backend_url + " f=editorFrame&img="+currentImageFile+"&action=save¶ms="+format[0]+","+quality+"&file="+filename;73 var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=save¶ms="+format[0]+","+quality+"&file="+filename; 74 74 //alert(url); 75 75 location.href = url; -
trunk/plugins/ImageManager/assets/images.js
r43 r48 20 20 // assume it has a trailing & 21 21 22 location.href = _backend_url + " f=images&dir="+newDir;22 location.href = _backend_url + "__function=images&dir="+newDir; 23 23 } 24 24 … … 26 26 function newFolder(dir, newDir) 27 27 { 28 location.href = _backend_url + " f=images&dir="+dir+"&newDir="+newDir;28 location.href = _backend_url + "__function=images&dir="+dir+"&newDir="+newDir; 29 29 } 30 30 -
trunk/plugins/ImageManager/backend.php
r43 r48 20 20 * entry point. backend.php expects at least two URL variable parameters: 21 21 * 22 * plugin=ImageManager for future expansion; identify the plugin being requested.23 * f=thumbs|images|editorFrame|editor|manager function being called.22 * __plugin=ImageManager for future expansion; identify the plugin being requested. 23 * __function=thumbs|images|editorFrame|editor|manager function being called. 24 24 * 25 25 * Having a single entry point that strictly adheres to a defined interface will … … 56 56 // used by ImageManager is in the same files as the PHP code ...) 57 57 58 if ( @$formVars[ " plugin" ] != "ImageManager" )58 if ( @$formVars[ "__plugin" ] != "ImageManager" ) 59 59 { 60 60 // not for us. … … 69 69 // function request. 70 70 71 _ddt( __FILE__, __LINE__, "backend.php(): handling function '" . $formVars[ " f" ] . "' base_dir is '" . $IMConfig["base_dir"] . "'" );71 _ddt( __FILE__, __LINE__, "backend.php(): handling function '" . $formVars[ "__function" ] . "' base_dir is '" . $IMConfig["base_dir"] . "'" ); 72 72 73 switch ( @$formVars[ " f" ] )73 switch ( @$formVars[ "__function" ] ) 74 74 { 75 75 -
trunk/plugins/ImageManager/config.inc.php
r47 r48 22 22 * URL to use for unified backend. 23 23 * 24 * The ? plugin=ImageManager& is required.25 */ 26 27 $IMConfig['backend_url'] = "backend.php? plugin=ImageManager&";24 * The ?__plugin=ImageManager& is required. 25 */ 26 27 $IMConfig['backend_url'] = "backend.php?__plugin=ImageManager&"; 28 28 29 29 /** … … 77 77 // $IMConfig['images_url'] = "/url/to/above"; 78 78 79 // try to figure out the URL of the images directory. We're assuming it's not80 // symlinked.81 82 $IMConfig['images_url'] = "/xinha/plugins/ImageManager/demo_images";79 // try to figure out the URL of the sample images directory. For your installation 80 // you will probably want to keep images in another directory. 81 82 $IMConfig['images_url'] = str_replace( "backend.php", "", $_SERVER["PHP_SELF"] ) . "demo_images"; 83 83 84 84 // ------------------------------------------------------------------------- … … 250 250 251 251 // uncomment to send debug messages to a local file 252 //_setDebugLog( "/tmp/debug_log.txt" );252 _setDebugLog( "/tmp/debug_log.txt" ); 253 253 254 254 // turn debugging on everywhere. 255 //_ddtOn();255 _ddtOn(); 256 256 257 257 // END -
trunk/plugins/ImageManager/editor.php
r43 r48 141 141 </div> 142 142 <div id="contents"> 143 <iframe src="<? print $IMConfig['backend_url']; ?> f=editorFrame&img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>143 <iframe src="<? print $IMConfig['backend_url']; ?>__function=editorFrame&img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe> 144 144 </div> 145 145 <div id="bottom"></div> -
trunk/plugins/ImageManager/image-manager.js
r47 r48 44 44 HTMLArea.Config.prototype.ImageManager = 45 45 { 46 'backend' : _editor_url + 'plugins/ImageManager/backend.php? plugin=ImageManager&',46 'backend' : _editor_url + 'plugins/ImageManager/backend.php?__plugin=ImageManager&', 47 47 'images_url' : _editor_url + 'plugins/ImageManager/demo_images' 48 48 } … … 62 62 63 63 // the selection will have the absolute url to the image. 64 // We need tocoerce it to be relative to the images directory.64 // coerce it to be relative to the images directory. 65 65 // 66 66 // FIXME: we have the correct URL, but how to get it to select? 67 // FIXME: need to do the same for MSIE. 67 68 68 69 if ( image ) … … 78 79 var image_src = image.getAttribute("src"); 79 80 80 // alert( "images_url is '" + editor.config.ImageManager.images_url + "'" );81 // strip off any http://blah prefix 81 82 82 var image_regex = new RegExp( editor.config.ImageManager.images_url ); 83 var images_url = editor.config.ImageManager.images_url.replace( /https?:\/\/[^\/]*/, "" ); 84 85 // alert( "images_url is '" + images_url + "'" ); 86 87 var image_regex = new RegExp( images_url ); 83 88 84 89 // alert(" regex is '" + image_regex.source + "'" ); … … 110 115 // alert( "backend is '" + editor.config.ImageManager.backend + "'" ); 111 116 112 var manager = editor.config.ImageManager.backend + ' f=manager';117 var manager = editor.config.ImageManager.backend + '__function=manager'; 113 118 114 119 Dialog(manager, function(param) { -
trunk/plugins/ImageManager/images.php
r46 r48 68 68 <a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? print $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a> 69 69 </td></tr><tr><td class="edit"> 70 <a href="<? print $IMConfig['backend_url']; ?> f=images&dir=<? echo $relative; ?>&delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="<? print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="<? print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>70 <a href="<? print $IMConfig['backend_url']; ?>__function=images&dir=<? echo $relative; ?>&delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="<? print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="<? print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a> 71 71 <? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?> 72 72 </td></tr></table></td> … … 192 192 function editImage(image) 193 193 { 194 var url = "<? print $IMConfig['backend_url']; ?> f=editor&img="+image;194 var url = "<? print $IMConfig['backend_url']; ?>__function=editor&img="+image; 195 195 Dialog(url, function(param) 196 196 { -
trunk/plugins/ImageManager/manager.php
r43 r48 49 49 <? // we have to propagate our values through forms ?> 50 50 51 <input type="hidden" name=" plugin" value="ImageManager">52 <input type="hidden" name=" f" value="images">51 <input type="hidden" name="__plugin" value="ImageManager"> 52 <input type="hidden" name="__function" value="images"> 53 53 54 54 <fieldset><legend>Image Manager</legend> … … 66 66 <? } ?> 67 67 <div id="messages" style="display: none;"><span id="message"></span><img SRC="<? print $IMConfig['base_url']; ?>img/dots.gif" width="22" height="12" alt="..." /></div> 68 <iframe src="<? print $IMConfig['backend_url']; ?> f=images" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>68 <iframe src="<? print $IMConfig['backend_url']; ?>__function=images" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe> 69 69 </div> 70 70 </fieldset>
