[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 /** 3 * The PHP Image Editor user interface. 4 * @author $Author: Wei Zhuo $ 5 * @version $Id: editor.php 3621 2006-12-26 13:51:51Z dittmann $ 6 * @package ImageManager 7 */ 8 9 require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/include.php'); 10 check_login(); 11 $userid = get_userid(); 12 if (!check_permission($userid, 'Modify Files')) die(); 13 14 require_once ('config.inc.php'); 15 require_once ('Classes/ImageManager.php'); 16 require_once ('Classes/ImageEditor.php'); 17 18 $manager = new ImageManager($IMConfig); 19 $editor = new ImageEditor($manager); 20 21 ?> 22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 23 24 <html> 25 <head> 26 <title></title> 27 <link href="assets/editor.css" rel="stylesheet" type="text/css" /> 28 <script type="text/javascript" src="assets/slider.js"></script> 29 <script type="text/javascript" src="assets/popup.js"></script> 30 <script type="text/javascript"> 31 /*<![CDATA[*/ 32 window.resizeTo(673, 531); 33 if(window.opener) 34 I18N = window.opener.I18N; 35 36 37 /*]]>*/ 38 </script> 39 <script type="text/javascript" src="assets/editor.js"></script> 40 </head> 41 42 <body> 43 <div id="indicator"> 44 <img src="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')"/> 53 <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> 54 </div> 55 <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 56 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> 57 </div> 58 <div id="tools_scale" style="display:none;"> 59 <div id="tool_inputs"> 60 <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/> 61 <a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label> 62 <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/> 63 <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/> 64 <label for="constProp">Constrain Proportions</label> 65 <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> 66 </div> 67 <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 68 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> 69 </div> 70 <div id="tools_rotate" style="display:none;"> 71 <div id="tool_inputs"> 72 <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;"> 73 <option SELECTED>Flip Image</option> 74 <option>-----------------</option> 75 <option value="hoz">Flip Horizontal</option> 76 <option value="ver">Flip Virtical</option> 77 </select> 78 <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;"> 79 <option SELECTED>Rotate Image</option> 80 <option>-----------------</option> 81 82 <option value="180">Rotate 180 °</option> 83 <option value="90">Rotate 90 ° CW</option> 84 <option value="-90">Rotate 90 ° CCW</option> 85 </select> 86 <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" /> 87 <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> 88 </div> 89 <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 90 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> 91 </div> 92 <div id="tools_measure" style="display:none;"> 93 <div id="tool_inputs"> 94 <label>X:</label><input type="text" class="measureStats" id="sx" /> 95 <label>Y:</label><input type="text" class="measureStats" id="sy" /> 96 <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> 97 <label>W:</label><input type="text" class="measureStats" id="mw" /> 98 <label>H:</label><input type="text" class="measureStats" id="mh" /> 99 <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> 100 <label>A:</label><input type="text" class="measureStats" id="ma" /> 101 <label>D:</label><input type="text" class="measureStats" id="md" /> 102 <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> 103 <button type="button" onclick="editor.reset();" >Clear</button> 104 </div> 105 </div> 106 <div id="tools_save" style="display:none;"> 107 <div id="tool_inputs"> 108 <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php echo $editor->getDefaultSaveFile();?>"/> 109 <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)"> 110 <option value="" SELECTED>Image Format</option> 111 <option value="">---------------------</option> 112 <option value="jpeg,85">JPEG High</option> 113 <option value="jpeg,60">JPEG Medium</option> 114 <option value="jpeg,35">JPEG Low</option> 115 <option value="png">PNG</option> 116 <?php if($editor->isGDGIFAble() != -1) { ?> 117 <option value="gif">GIF</option> 118 <?php } ?> 119 </select> 120 <label>Quality:</label> 121 <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0"> 122 <tr> 123 <td> 124 <div id="slidercasing"> 125 <div id="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> 126 <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> 127 </div> 128 </td> 129 </tr> 130 </table> 131 <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/> 132 <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> 133 </div> 134 <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 135 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> 136 </div> 137 </div> 138 <div id="toolbar"> 139 <a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a> 140 <a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a> 141 <a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a> 142 <a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a> 143 <a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a> 144 <a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a> 145 </div> 146 <div id="contents"> 147 <iframe src="editorFrame.php?img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe> 148 </div> 149 <div id="bottom"></div> 150 </body> 151 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |