source: trunk/plugins/ExtendedFileManager/editorFrame.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: 2.9 KB
Line 
1<?php
2/**
3 * ExtendedFileManager editorframe.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$imageInfo = $editor->processImage();
20
21?>
22
23<html>
24<head>
25        <title></title>
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    var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&";
31
32    if(window.top)
33        Xinha = window.top.Xinha;
34
35    function i18n(str) {
36        return Xinha._lc(str, 'ImageManager');
37    }
38
39        var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure
40
41var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
42
43<?php if ($editor->isFileSaved() == 1) { ?>
44        alert(i18n('File saved.'));
45
46    window.parent.opener.parent.refresh();
47    window.parent.opener.selectImage
48    (
49        '<?php echo $imageInfo['saveFile'] ?>',
50        '<?php echo $imageInfo['saveFile'] ?>'.replace(/^.*\/?([^\/]*)$/, '$1'),
51        <?php echo $imageInfo['width'] ?>,
52        <?php echo $imageInfo['height'] ?>
53        );
54        window.parent.close();
55       
56<?php } else if ($editor->isFileSaved() == -1) { ?>
57        alert(i18n('File was not saved.'));
58<?php } ?>
59
60</script>
61<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editorFrame.js"></script>
62</head>
63
64<body>
65<div id="status"></div>
66<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>
67<?php if ($editor->isGDEditable() == -1) { ?>
68        <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
69<?php } ?>
70<table height="100%" width="100%">
71        <tr>
72                <td>
73<?php if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
74        <span id="imgCanvas" class="crop"><img src="<?php echo $imageInfo['src']; ?>" <?php echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span>
75<?php } else { ?>
76        <span class="error">No Image Available</span>
77<?php } ?>
78                </td>
79        </tr>
80</table>
81</body>
82</html>
Note: See TracBrowser for help on using the repository browser.