1 | <?php |
---|
2 | /** |
---|
3 | * The frame that contains the image to be edited. |
---|
4 | * @author $Author: Wei Zhuo $ |
---|
5 | * @version $Id: editorFrame.php 26 2004-03-31 02:35:21Z Wei Zhuo $ |
---|
6 | * @package ImageManager |
---|
7 | */ |
---|
8 | |
---|
9 | require_once('config.inc.php'); |
---|
10 | require_once('Classes/ImageManager.php'); |
---|
11 | require_once('Classes/ImageEditor.php'); |
---|
12 | |
---|
13 | $manager = new ImageManager($IMConfig); |
---|
14 | $editor = new ImageEditor($manager); |
---|
15 | $imageInfo = $editor->processImage(); |
---|
16 | |
---|
17 | ?> |
---|
18 | |
---|
19 | <html> |
---|
20 | <head> |
---|
21 | <title></title> |
---|
22 | <script type="text/javascript"> |
---|
23 | _backend_url = "<?php print $IMConfig['backend_url']; ?>"; |
---|
24 | </script> |
---|
25 | |
---|
26 | <link href="<?php print $IMConfig['base_url'];?>assets/editorFrame.css" rel="stylesheet" type="text/css" /> |
---|
27 | <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/wz_jsgraphics.js"></script> |
---|
28 | <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/EditorContent.js"></script> |
---|
29 | <script type="text/javascript"> |
---|
30 | |
---|
31 | if(window.top) |
---|
32 | HTMLArea = window.top.HTMLArea; |
---|
33 | |
---|
34 | function i18n(str) { |
---|
35 | return HTMLArea._lc(str, 'ImageManager'); |
---|
36 | } |
---|
37 | |
---|
38 | var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure |
---|
39 | |
---|
40 | var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>"; |
---|
41 | |
---|
42 | <?php if ($editor->isFileSaved() == 1) { ?> |
---|
43 | alert(i18n('File saved.')); |
---|
44 | window.parent.opener.selectImage |
---|
45 | ( |
---|
46 | '<?php echo $imageInfo['savedFile'] ?>', |
---|
47 | '<?php echo $imageInfo['savedFile'] ?>'.replace(/^.*\/?([^\/]*)$/, '$1'), |
---|
48 | <?php echo $imageInfo['width'] ?>, |
---|
49 | <?php echo $imageInfo['height'] ?> |
---|
50 | ); |
---|
51 | window.parent.opener.parent.refresh(); |
---|
52 | window.parent.close(); |
---|
53 | <?php } else if ($editor->isFileSaved() == -1) { ?> |
---|
54 | alert(i18n('File was not saved.')); |
---|
55 | <?php } ?> |
---|
56 | |
---|
57 | </script> |
---|
58 | <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editorFrame.js"></script> |
---|
59 | </head> |
---|
60 | |
---|
61 | <body> |
---|
62 | <div id="status"></div> |
---|
63 | <div id="ant" class="selection" style="visibility:hidden"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div> |
---|
64 | <?php if ($editor->isGDEditable() == -1) { ?> |
---|
65 | <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div> |
---|
66 | <?php } ?> |
---|
67 | <table height="100%" width="100%"> |
---|
68 | <tr> |
---|
69 | <td> |
---|
70 | <?php if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?> |
---|
71 | <span id="imgCanvas" class="crop"><img src="<?php echo $imageInfo['src']; ?>" <?php echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span> |
---|
72 | <?php } else { ?> |
---|
73 | <span class="error">No Image Available</span> |
---|
74 | <?php } ?> |
---|
75 | </td> |
---|
76 | </tr> |
---|
77 | </table> |
---|
78 | </body> |
---|
79 | </html> |
---|