source: branches/unified_backend/plugins/ImageManager/editor.php @ 121

Last change on this file since 121 was 121, checked in by yermol, 14 years ago

htmlarea.js

. more debugging messages added.
. added HTMLArea.Config.linkReplacementMode which can be either

fullyqualified (the old default behavior) or absolute.


When set to fullyqualified all absolute links (e.g. /somepath) will be changed to fullyqualified URLS (e.g. http://yoursite/somepth).


When set to absolute, all fullyqualified urls back to the current site
will be changed to absolute (e.g. httpyoursite/somepath to /somepath)
making the Xinha generated content portable between sites.


( see HTMLArea.prototype.outwardHtml() )


. bugfix - if plugin .js file has a parse error htmlarea will only try to load

it a configurable number of times before popping up an error message.


backends/backend.php

. initial unified backend created. Requests to this backend are routed

to the corresponding plugin specific backend.php file.


backends/backend_conf.php

. a central server side configuration file has been created for the use

of plugin serverside code.

. all backends hooked into this scheme must include the central config file.

ImageManager?

. modified the config to allow overriding default values.
. default image directory is now xinha/examples/images
. added debugging trace messages which are tagged with the ImageManager? name.
. now uses unified backend.

Linker

. includes central config.
. default directory is now the xinha/examples directory (to avoid scan.php security

problem)

. added debugging trace messages which are tagged with the Linker name.
. links selected from the tree are now displayed in absolute instead of fully qualified

fashion.

. on edit the link that was previously selected is highlighted.
. on edit the selected link is scrolled to if it's outside the viewable area.
. if scan.php returns some kind of error or invalid javascript Linker now pops up

a nice descriptive error message.


. bugfix - same pattern as in loading plugins. If there is some error in loading the directory listing Linker will only attempt it a few times before giving up and

displaying a nice error.


dTree.js

. added clear_s() method to clear the selection
. added getNodeElement() method to return the <a ..> element for a given node.

File size: 9.6 KB
Line 
1<?php
2/**
3 * The PHP Image Editor user interface.
4 * @author $Author: Wei Zhuo $
5 * @version $Id: editor.php 26 2004-03-31 02:35:21Z Wei Zhuo $
6 * @package ImageManager
7 */
8
9require_once('config.inc.php');
10require_once('Classes/ImageManager.php');
11require_once('Classes/ImageEditor.php');
12
13$manager = new ImageManager($IMConfig);
14$editor = new ImageEditor($manager);
15
16?>
17<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
18
19<html>
20<head>
21        <title></title>
22<script type="text/javascript">
23_backend_url = "<?php print $IMConfig['backend_url']; ?>";
24
25// This page is opened by a call to Dialog() in ImageManager/images.php in the
26// editImage() js function. (That Dialog() call is defined in ImageManager/assets/dialog.js
27//
28// The Dialog() call accepts an optional fourth parameter, the editor instance
29// that is raising this dialog. From there we can pull out the ImageManager instance and
30// get access to the ddt instance. This has an added benefit allowing us to
31// put all the previously free standing manager functions into the image manager class.
32
33_imgManager = window.opener.Dialog._editor.plugins[ "ImageManager" ].instance;
34
35_imgManager.ddt._ddt( "editor.php", "38", "top of editor.php file." );
36
37</script>
38        <link href="<?php print $IMConfig['base_url'];?>assets/editor.css" rel="stylesheet" type="text/css" /> 
39<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/slider.js"></script>
40<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script>
41<script type="text/javascript">
42/*<![CDATA[*/
43        window.resizeTo(673, 531);
44
45        if(window.opener)
46                HTMLArea = window.opener.HTMLArea;
47/*]]>*/
48</script>
49<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editor.js"></script>
50</head>
51
52<body>
53<div id="indicator">
54<img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
55</div>
56<div id="tools">
57        <div id="tools_crop" style="display:none;">
58                <div id="tool_inputs">
59                        <label for="cx">Start X:</label><input type="text" id="cx"  class="textInput" onchange="updateMarker('crop')"/>
60                        <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/>
61                        <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/>
62                        <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/>
63                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
64                </div> 
65                <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
66                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>               
67        </div> 
68        <div id="tools_scale" style="display:none;">
69                <div id="tool_inputs">
70                        <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/>
71                        <a href="javascript:toggleConstraints();" title="Lock"><img src="<?php print $IMConfig['base_url'];?>img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label>
72                        <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/>
73                        <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/>
74                        <label for="constProp">Constrain Proportions</label>
75                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
76                </div> 
77                <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
78                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>               
79        </div> 
80        <div id="tools_rotate" style="display:none;">
81                <div id="tool_inputs">
82                        <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;">
83              <option selected>Flip Image</option>
84              <option>-----------------</option>
85              <option value="hoz">Flip Horizontal</option>
86              <option value="ver">Flip Virtical</option>
87         </select>
88                        <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
89              <option selected>Rotate Image</option>
90              <option>-----------------</option>
91
92              <option value="180">Rotate 180 &deg;</option>
93              <option value="90">Rotate 90 &deg; CW</option>
94              <option value="-90">Rotate 90 &deg; CCW</option>
95         </select>
96                        <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
97                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
98                </div> 
99                <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
100                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>               
101        </div>         
102        <div id="tools_measure" style="display:none;">
103                <div id="tool_inputs">
104                        <label>X:</label><input type="text" class="measureStats" id="sx" />
105                        <label>Y:</label><input type="text" class="measureStats" id="sy" />
106                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
107                        <label>W:</label><input type="text" class="measureStats" id="mw" />
108                        <label>H:</label><input type="text" class="measureStats" id="mh" />
109                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
110                        <label>A:</label><input type="text" class="measureStats" id="ma" />             
111                        <label>D:</label><input type="text" class="measureStats" id="md" />             
112                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
113                        <button type="button" onclick="editor.reset();" >Clear</button>
114                </div> 
115        </div>
116        <div id="tools_save" style="display:none;">
117                <div id="tool_inputs">
118                        <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php echo $editor->getDefaultSaveFile();?>"/>
119                        <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)">
120            <option value="" selected>Image Format</option>
121            <option value="">---------------------</option>
122            <option value="jpeg,85">JPEG High</option>
123            <option value="jpeg,60">JPEG Medium</option>
124            <option value="jpeg,35">JPEG Low</option>
125            <option value="png">PNG</option>
126                        <?php if($editor->isGDGIFAble() != -1) { ?>
127            <option value="gif">GIF</option>
128                        <?php } ?>
129         </select>
130                        <label>Quality:</label>
131                        <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
132                                <tr>
133                                <td>
134                                        <div id="slidercasing">
135                                <div id="slidertrack" style="width:100px"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
136            <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
137                        </div> 
138                                </td>
139                                </tr>
140                        </table>                               
141                        <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/>
142                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
143                </div> 
144                <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
145                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>               
146        </div> 
147</div>
148<div id="toolbar">
149<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="<?php print $IMConfig['base_url'];?>img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
150<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="<?php print $IMConfig['base_url'];?>img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
151<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="<?php print $IMConfig['base_url'];?>img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
152<a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="<?php print $IMConfig['base_url'];?>img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a>
153<a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="<?php print $IMConfig['base_url'];?>img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a>
154<a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="<?php print $IMConfig['base_url'];?>img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a>
155</div>
156<div id="contents">
157<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>
158</div>
159<div id="bottom"></div>
160</body>
161</html>
Note: See TracBrowser for help on using the repository browser.