[43] | 1 | Originally Developed by: http://www.zhuo.org/htmlarea/ |
---|
| 2 | |
---|
| 3 | > This is a plug-in for HTMLArea 3.0 |
---|
| 4 | > |
---|
| 5 | > The PHP ImageManager + Editor provides an interface to |
---|
| 6 | > browser for image files on your web server. The Editor |
---|
| 7 | > allows some basic image manipulations such as, cropping, |
---|
| 8 | > rotation, flip, and scaling. |
---|
| 9 | > |
---|
| 10 | > Further and up-to-date documentation can be found at |
---|
| 11 | > http://www.zhuo.org/htmlarea/docs/index.html |
---|
| 12 | > |
---|
| 13 | > Cheer, |
---|
| 14 | > Wei |
---|
| 15 | |
---|
| 16 | 2005-03-20 |
---|
| 17 | by Yermo Lamers of DTLink, LLC (http://www.formvista.com/contact.html) |
---|
| 18 | |
---|
| 19 | Please post questions/comments/flames about this plugin in the Xinha forums |
---|
| 20 | at |
---|
| 21 | |
---|
| 22 | http://xinha.gogo.co.nz/punbb/viewforum.php?id=1 |
---|
| 23 | |
---|
| 24 | ------------------------------------------------------------------------------ |
---|
[48] | 25 | If you have GD installed and configured in PHP this should work out of the |
---|
| 26 | box. |
---|
[43] | 27 | |
---|
[48] | 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. |
---|
[45] | 30 | |
---|
| 31 | For demo purposes ImageManager is set up to view images in the |
---|
| 32 | |
---|
| 33 | /xinha/plugins/ImageManager/demo_images |
---|
| 34 | |
---|
| 35 | directory. This is governed by the images_dir and images_url config options. |
---|
| 36 | |
---|
[47] | 37 | The permissions on the demo_images directory may not be correct. The directory |
---|
| 38 | should be owned by the user your webserver runs as and should have 755 |
---|
| 39 | permissions. |
---|
| 40 | |
---|
[45] | 41 | -------------------------------------------------------------------------------- |
---|
| 42 | |
---|
[43] | 43 | By default this ImageManager is set up to browse some graphics |
---|
| 44 | in plugins/ImageManager/demo_images. |
---|
| 45 | |
---|
| 46 | For security reasons image uploading is turned off by default. |
---|
| 47 | You can enable it by editing config.inc.php. |
---|
| 48 | |
---|
| 49 | --------------------------------- |
---|
| 50 | For Developers |
---|
| 51 | --------------------------------- |
---|
| 52 | |
---|
| 53 | CHANGES FROM Wei's Original Code: |
---|
| 54 | |
---|
| 55 | Single Backend: |
---|
| 56 | --------------- |
---|
| 57 | |
---|
| 58 | All requests from the javascript code back to the server now |
---|
| 59 | are routed through a single configurable backend script, |
---|
| 60 | backend.php. |
---|
| 61 | |
---|
| 62 | Request URLs are of the form: |
---|
| 63 | |
---|
[48] | 64 | <config backend URL>(?|&)__plugin=ImageManager&__function=<function>&arg=value&arg=value |
---|
[43] | 65 | |
---|
| 66 | The default URL is plugins/xinha/backend.php. |
---|
| 67 | |
---|
| 68 | This approach makes it possible to completely replace the |
---|
| 69 | backend with a perl or ASP implementation without having to |
---|
| 70 | change any of the client side code. |
---|
| 71 | |
---|
| 72 | You can override the location and name of the backend.php |
---|
| 73 | script by setting the config.ImageManager.backend property from |
---|
| 74 | the calling page. Make sure the URL ends in an "&". The code, |
---|
| 75 | for now, assumes it can just tack on variables. |
---|
| 76 | |
---|
| 77 | For the moment the javascript files in the assets directory do |
---|
| 78 | not have access to the main editor object and as a result have |
---|
| 79 | not access to the config. For the moment we use a _backend_url |
---|
| 80 | variable output from PHP to communicate the location of the |
---|
| 81 | backend to these assets. It's a kludge. Ideally all these |
---|
| 82 | config values should be set from the calling page and be |
---|
| 83 | available through the editor.config.ImageManager object. |
---|
| 84 | |
---|
| 85 | Debug Messages |
---|
| 86 | --------------- |
---|
| 87 | |
---|
| 88 | The php files include a simple debugging library, ddt.php. See |
---|
| 89 | config.inc.php for how to turn it on. It can display trace |
---|
| 90 | messages to the browser or dump them to a log file. |
---|
| 91 | |
---|
| 92 | I'll try to package up the client-side tracing-to-textarea |
---|
| 93 | _ddt() functions I've put together. Having a trace message |
---|
| 94 | infrastructure has always served me well. |
---|
| 95 | |
---|
| 96 | ------------- |
---|
| 97 | Flakey Editor |
---|
| 98 | ------------- |
---|
| 99 | |
---|
| 100 | The editor I use is flakey (but very very fast). It has |
---|
| 101 | problems with tab to space conversion so if the indenting looks |
---|
| 102 | weird that's why. |
---|
| 103 | |
---|
| 104 | ---- |
---|
| 105 | TODO |
---|
| 106 | ---- |
---|
| 107 | |
---|
| 108 | ImageManager really needs a complete rewrite. |
---|
| 109 | |
---|
| 110 | . ImageManager should appear in a pane instead of a popup |
---|
| 111 | window using Sleeman's windowpane support. |
---|
| 112 | |
---|
| 113 | . html and php code are intermixed. It would be very nice to |
---|
| 114 | use some kind of templating for the dialogs; this templating |
---|
| 115 | should be done long hand so it can be re-used regardless of the |
---|
| 116 | backend implementation language. |
---|
| 117 | |
---|
| 118 | . the config should probably be some format that would be |
---|
| 119 | easily read by multiple implementations of the back end. It |
---|
| 120 | would be nice to have a single configuration system regardless |
---|
| 121 | of whether the backend is PHP, Perl or ASP. |
---|
| 122 | |
---|
| 123 | . javascript assets are not objects. Passing config options to |
---|
| 124 | the assets functions requires intermediate variables which is |
---|
| 125 | really ugly. Everything should be cleanly integrated into the |
---|
| 126 | object heirarchy akin to the way Linker is done. |
---|
| 127 | |
---|
| 128 | . if an image is selected from the document editor window it |
---|
| 129 | should be focused and highlighted in the image selection |
---|
| 130 | window. |
---|
| 131 | |
---|
| 132 | . fix fully-qualified url in image selection box under MSIE. |
---|
| 133 | |
---|
| 134 | . per-image permissions. We should include some kind of backend |
---|
| 135 | permissions management so users can only |
---|
| 136 | delete/edit/move/rename images that they have uploaded. |
---|
| 137 | |
---|
| 138 | . add a CANCEL button and a SAVE AS button to the editor. |
---|
| 139 | |
---|
| 140 | . add a list view akin to EFM. (and include image properties |
---|
| 141 | width/height/depth/etc.) |
---|
| 142 | |
---|
| 143 | . figure out a way for ImageManager to work "out of the box" |
---|
| 144 | regardless of install. |
---|
| 145 | |
---|
| 146 | . client-side tracing. |
---|
| 147 | |
---|
| 148 | . fancy stuff like adding a UI to define rollovers, animations, |
---|
| 149 | etc. |
---|
| 150 | |
---|