source: trunk/plugins/ExtendedFileManager/editor.php @ 681

Last change on this file since 681 was 681, checked in by ray, 13 years ago

Ticket #916 TODO: Change plugins to use Xinha object name

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 9.4 KB
Line 
1<?php
2/**
3 * ExtendedFileManager editor.php file.
4 * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz
5 * Version: Updated on 08-01-2005 by Afru
6 * Version: Updated on 21-06-2006 by Krzysztof Kotowicz
7 * Package: ExtendedFileManager (EFM 1.1.1)
8 * http://www.afrusoft.com/htmlarea
9 */
10if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode'];
11        if(!isset($insertMode)) $insertMode="image";
12
13require_once('config.inc.php');
14require_once('Classes/ExtendedFileManager.php');
15require_once('../ImageManager/Classes/ImageEditor.php');
16
17$manager = new ExtendedFileManager($IMConfig,$insertMode);
18$editor = new ImageEditor($manager);
19
20?>
21<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22
23<html>
24<head>
25        <title></title>
26        <link href="<?php print $IMConfig['base_url'];?>assets/editor.css" rel="stylesheet" type="text/css" />
27<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/slider.js"></script>
28<script type="text/javascript" src="../../popups/popup.js"></script>
29<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script>
30<script type="text/javascript">
31/*<![CDATA[*/
32
33    var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&";
34
35        if(window.opener)
36                Xinha = window.opener.Xinha;
37/*]]>*/
38</script>
39<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editor.js"></script>
40</head>
41
42<body>
43<div id="indicator">
44<img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
45</div>
46<div id="tools">
47        <div id="tools_crop" style="display:none;">
48                <div id="tool_inputs">
49                        <label for="cx">Start X:</label><input type="text" id="cx"  class="textInput" onchange="updateMarker('crop')"/>
50                        <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/>
51                        <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/>
52                        <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/>                   <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
53                </div> 
54                <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>
55                <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>
56        </div> 
57        <div id="tools_scale" style="display:none;">
58                <div id="tool_inputs">
59                        <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/>
60                        <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>
61                        <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/>
62                        <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/>
63                        <label for="constProp">Constrain Proportions</label>
64                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
65                </div> 
66                <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>
67                <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
68        </div> 
69        <div id="tools_rotate" style="display:none;">
70                <div id="tool_inputs">
71                        <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;">
72              <option selected>Flip Image</option>
73              <option>-----------------</option>
74              <option value="hoz">Flip Horizontal</option>
75              <option value="ver">Flip Virtical</option>
76         </select>
77                        <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
78              <option selected>Rotate Image</option>
79              <option>-----------------</option>
80
81              <option value="180">Rotate 180 &deg;</option>
82              <option value="90">Rotate 90 &deg; CW</option>
83              <option value="-90">Rotate 90 &deg; CCW</option>
84         </select>
85                        <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
86                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
87                </div> 
88                <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>
89                <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
90        </div>         
91        <div id="tools_measure" style="display:none;">
92                <div id="tool_inputs">
93                        <label>X:</label><input type="text" class="measureStats" id="sx" />
94                        <label>Y:</label><input type="text" class="measureStats" id="sy" />
95                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
96                        <label>W:</label><input type="text" class="measureStats" id="mw" />
97                        <label>H:</label><input type="text" class="measureStats" id="mh" />
98                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
99                        <label>A:</label><input type="text" class="measureStats" id="ma" />             
100                        <label>D:</label><input type="text" class="measureStats" id="md" />             
101                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
102                        <button type="button" onclick="editor.reset();" >Clear</button>
103                </div> 
104        </div>
105        <div id="tools_save" style="display:none;">
106                <div id="tool_inputs">
107                        <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php echo $editor->getDefaultSaveFile();?>"/>
108                        <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)">
109            <option value="" selected>Image Format</option>
110            <option value="">---------------------</option>
111            <option value="jpeg,85">JPEG High</option>
112            <option value="jpeg,60">JPEG Medium</option>
113            <option value="jpeg,35">JPEG Low</option>
114            <option value="png">PNG</option>
115                        <?php if($editor->isGDGIFAble() != -1) { ?>
116            <option value="gif">GIF</option>
117                        <?php } ?>
118         </select>
119                        <label>Quality:</label>
120                        <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
121                                <tr>
122                                <td>
123                                        <div id="slidercasing">
124                                <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>
125            <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>
126                        </div> 
127                                </td>
128                                </tr>
129                        </table>                               
130                        <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/>
131                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
132                </div> 
133                <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>
134                <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>
135        </div> 
136</div>
137<div id="toolbar">
138<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>
139<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>
140<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>
141<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>
142<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>
143<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>
144</div>
145<div id="contents">
146<iframe src="<?php print $IMConfig['backend_url']; ?>__function=editorFrame&img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>&mode=<?php echo $insertMode ?>" name="editor" id="editor"  scrolling="auto" title="Image Editor" frameborder="0"></iframe>
147</div>
148<div id="bottom"></div>
149</body>
150</html>
Note: See TracBrowser for help on using the repository browser.