source: trunk/plugins/ImageManager/editor.php @ 48

Last change on this file since 48 was 48, checked in by yermol, 15 years ago

now uses PHP_SELF to figure out installation directory URL.
changed plugin to plugin and f to function everywhere.
updated README.

File size: 8.9 KB
Line 
1<?
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 = "<? print $IMConfig['backend_url']; ?>";
24</script>
25        <link href="<? print $IMConfig['base_url'];?>assets/editor.css" rel="stylesheet" type="text/css" />     
26<script type="text/javascript" src="<? print $IMConfig['base_url'];?>assets/slider.js"></script>
27<script type="text/javascript" src="<? print $IMConfig['base_url'];?>assets/popup.js"></script>
28<script type="text/javascript">
29/*<![CDATA[*/
30        window.resizeTo(673, 531);
31        if(window.opener)
32                I18N = window.opener.I18N;
33/*]]>*/
34</script>
35<script type="text/javascript" src="<? print $IMConfig['base_url'];?>assets/editor.js"></script>
36</head>
37
38<body>
39<div id="indicator">
40<img src="<? print $IMConfig['base_url'];?>img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
41</div>
42<div id="tools">
43        <div id="tools_crop" style="display:none;">
44                <div id="tool_inputs">
45                        <label for="cx">Start X:</label><input type="text" id="cx"  class="textInput" onchange="updateMarker('crop')"/>
46                        <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/>
47                        <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/>
48                        <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/>
49                        <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
50                </div> 
51                <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
52                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>         
53        </div> 
54        <div id="tools_scale" style="display:none;">
55                <div id="tool_inputs">
56                        <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/>
57                        <a href="javascript:toggleConstraints();" title="Lock"><img src="<? print $IMConfig['base_url'];?>img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label>
58                        <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/>
59                        <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/>
60                        <label for="constProp">Constrain Proportions</label>
61                        <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
62                </div> 
63                <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
64                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>         
65        </div> 
66        <div id="tools_rotate" style="display:none;">
67                <div id="tool_inputs">
68                        <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;">
69              <option selected>Flip Image</option>
70              <option>-----------------</option>
71              <option value="hoz">Flip Horizontal</option>
72              <option value="ver">Flip Virtical</option>
73         </select>
74                        <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
75              <option selected>Rotate Image</option>
76              <option>-----------------</option>
77
78              <option value="180">Rotate 180 &deg;</option>
79              <option value="90">Rotate 90 &deg; CW</option>
80              <option value="-90">Rotate 90 &deg; CCW</option>
81         </select>
82                        <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
83                        <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
84                </div> 
85                <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
86                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>         
87        </div>         
88        <div id="tools_measure" style="display:none;">
89                <div id="tool_inputs">
90                        <label>X:</label><input type="text" class="measureStats" id="sx" />
91                        <label>Y:</label><input type="text" class="measureStats" id="sy" />
92                        <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
93                        <label>W:</label><input type="text" class="measureStats" id="mw" />
94                        <label>H:</label><input type="text" class="measureStats" id="mh" />
95                        <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
96                        <label>A:</label><input type="text" class="measureStats" id="ma" />             
97                        <label>D:</label><input type="text" class="measureStats" id="md" />             
98                        <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
99                        <button type="button" onclick="editor.reset();" >Clear</button>
100                </div> 
101        </div>
102        <div id="tools_save" style="display:none;">
103                <div id="tool_inputs">
104                        <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/>
105                        <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)">
106            <option value="" selected>Image Format</option>
107            <option value="">---------------------</option>
108            <option value="jpeg,85">JPEG High</option>
109            <option value="jpeg,60">JPEG Medium</option>
110            <option value="jpeg,35">JPEG Low</option>
111            <option value="png">PNG</option>
112                        <? if($editor->isGDGIFAble() != -1) { ?>
113            <option value="gif">GIF</option>
114                        <? } ?>
115         </select>
116                        <label>Quality:</label>
117                        <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
118                                <tr>
119                                <td>
120                                        <div id="slidercasing">
121                                <div id="slidertrack" style="width:100px"><img src="<? print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
122            <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="<? print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
123                        </div> 
124                                </td>
125                                </tr>
126                        </table>                               
127                        <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/>
128                        <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
129                </div> 
130                <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
131                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>         
132        </div> 
133</div>
134<div id="toolbar">
135<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="<? print $IMConfig['base_url'];?>img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
136<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="<? print $IMConfig['base_url'];?>img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
137<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="<? print $IMConfig['base_url'];?>img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
138<a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="<? print $IMConfig['base_url'];?>img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a>
139<a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="<? print $IMConfig['base_url'];?>img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a>
140<a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="<? print $IMConfig['base_url'];?>img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a>
141</div>
142<div id="contents">
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</div>
145<div id="bottom"></div>
146</body>
147</html>
Note: See TracBrowser for help on using the repository browser.