source: trunk/plugins/ImageManager/editorFrame.php @ 1072

Last change on this file since 1072 was 999, checked in by ray, 12 years ago

#1195 Allow to specify an external url to load a plugin from

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 2.6 KB
RevLine 
[270]1<?php
[43]2/**
3 * The frame that contains the image to be edited.
[999]4 * @author $Author:ray $
5 * @version $Id:editorFrame.php 677 2007-01-19 22:24:36Z ray $
[43]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$imageInfo = $editor->processImage();
16
17?>
18
19<html>
20<head>
21        <title></title>
22<script type="text/javascript">
[111]23_backend_url = "<?php print $IMConfig['backend_url']; ?>";
[43]24</script>
25
[111]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>
[43]29<script type="text/javascript">
30
31if(window.top)
[60]32        HTMLArea = window.top.HTMLArea;
[43]33
34function i18n(str) {
[60]35    return HTMLArea._lc(str, 'ImageManager');
[419]36}
[43]37       
[111]38        var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure
[43]39
[111]40var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
[43]41
[111]42<?php if ($editor->isFileSaved() == 1) { ?>
[43]43        alert(i18n('File saved.'));
[256]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();
[111]53<?php } else if ($editor->isFileSaved() == -1) { ?>
[43]54        alert(i18n('File was not saved.'));
[111]55<?php } ?>
[43]56
57</script>
[111]58<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editorFrame.js"></script>
[43]59</head>
60
61<body>
62<div id="status"></div>
[111]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) { ?>
[43]65        <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
[111]66<?php } ?>
[43]67<table height="100%" width="100%">
68        <tr>
69                <td>
[111]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 { ?>
[43]73        <span class="error">No Image Available</span>
[111]74<?php } ?>
[43]75                </td>
76        </tr>
77</table>
78</body>
[419]79</html>
Note: See TracBrowser for help on using the repository browser.