source: trunk/plugins/ImageManager/manager.php @ 111

Last change on this file since 111 was 111, checked in by niko, 9 years ago

#225
several ImageManager fixes, see #225 for details

File size: 6.3 KB
Line 
1<?php
2/**
3 * The main GUI for the ImageManager.
4 * @author $Author: Wei Zhuo $
5 * @version $Id: manager.php 26 2004-03-31 02:35:21Z Wei Zhuo $
6 * @package ImageManager
7 */
8
9        require_once('config.inc.php');
10        require_once('ddt.php');
11        require_once('Classes/ImageManager.php');
12       
13        $manager = new ImageManager($IMConfig);
14        $dirs = $manager->getDirs();
15
16?>
17<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
18
19<html>
20<head>
21        <title>Insert Image</title>
22<script type="text/javascript">
23
24<?php // temporary. An ImageManager rewrite will take care of this kludge. ?>
25
26_backend_url = "<?php print $IMConfig['backend_url']; ?>";
27</script>
28  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29 <link href="<?php print $IMConfig['base_url'];?>assets/manager.css" rel="stylesheet" type="text/css" />       
30<script type="text/javascript" src="../../popups/popup.js"></script>
31<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script>
32<script type="text/javascript">
33/*<![CDATA[*/
34        window.resizeTo(600, 460);
35
36        if(window.opener)
37                HTMLArea = window.opener.HTMLArea;
38
39        var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
40        var base_url = "<?php echo $manager->getImagesURL(); ?>";
41/*]]>*/
42</script>
43<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/manager.js"></script>
44</head>
45<body>
46<div class="title">Insert Image</div>
47<form action="<?php print $IMConfig['backend_url'] ?>" id="uploadForm" method="post" enctype="multipart/form-data">
48
49<?php // we have to propagate our values through forms ?>
50
51<input type="hidden" name="__plugin" value="ImageManager">
52<input type="hidden" name="__function" value="images">
53
54<fieldset><legend>Image Manager</legend>
55<div class="dirs">
56        <label for="dirPath">Directory</label>
57        <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
58        <option value="/">/</option>
59<?php foreach($dirs as $relative=>$fullpath) { ?>
60                <option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
61<?php } ?>
62        </select>
63        <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="<?php print $IMConfig['base_url']; ?>img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
64<?php if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
65        <a href="#" onclick="newFolder();" title="New Folder"><img src="<?php print $IMConfig['base_url']; ?>img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
66<?php } ?>
67        <div id="messages" style="display: none;"><span id="message"></span><img SRC="<?php print $IMConfig['base_url']; ?>img/dots.gif" width="22" height="12" alt="..." /></div>
68        <iframe src="<?php print $IMConfig['backend_url']; ?>__function=images" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
69</div>
70</fieldset>
71<!-- image properties -->
72        <table class="inputTable">
73                <tr>
74                        <td align="right"><label for="f_url">Image File</label></td>
75                        <td><input type="text" id="f_url" class="largelWidth" value="" /></td>
76                        <td rowspan="3" align="right">&nbsp;</td>
77                        <td align="right"><label for="f_width">Width</label></td>
78                        <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td>
79                        <td rowspan="2" align="right"><img src="<?php print $IMConfig['base_url']; ?>img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td>
80                        <td rowspan="3" align="right">&nbsp;</td>
81                        <td align="right"><label for="f_vert">V Space</label></td>
82                        <td><input type="text" id="f_vert" class="smallWidth" value="" /></td>
83                </tr>           
84                <tr>
85                        <td align="right"><label for="f_alt">Alt</label></td>
86                        <td><input type="text" id="f_alt" class="largelWidth" value="" /></td>
87                        <td align="right"><label for="f_height">Height</label></td>
88                        <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td>
89                        <td align="right"><label for="f_horiz">H Space</label></td>
90                        <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
91                </tr>
92                <tr>
93<?php if($IMConfig['allow_upload'] == true) { ?>
94                        <td align="right"><label for="upload">Upload</label></td>
95                        <td>
96                                <table cellpadding="0" cellspacing="0" border="0">
97                  <tr>
98                    <td><input type="file" name="upload" id="upload"/></td>
99                    <td>&nbsp;<button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td>
100                  </tr>
101                </table>
102                        </td>
103<?php } else { ?>
104                        <td colspan="2"></td>
105<?php } ?>
106                        <td align="right"><label for="f_align">Alignment:</label></td>
107                        <td colspan="2">
108                                <select size="1" id="f_align"  title="Positioning of this image">
109                                  <option value=""                             >Not set</option>
110                                  <option value="left"                         >Left</option>
111                                  <option value="right"                        >Right</option>
112                                  <option value="texttop"                      >Texttop</option>
113                                  <option value="absmiddle"                    >Absmiddle</option>
114                                  <option value="baseline" selected="selected" >Baseline</option>
115                                  <option value="absbottom"                    >Absbottom</option>
116                                  <option value="bottom"                       >Bottom</option>
117                                  <option value="middle"                       >Middle</option>
118                                  <option value="top"                          >Top</option>
119                                </select>
120                        </td>
121                        <td align="right"><label for="f_border">Border</label></td>
122                        <td><input type="text" id="f_border" class="smallWidth" value="" /></td>
123                </tr>
124                <tr>
125         <td colspan="4" align="right">
126                                <input type="hidden" id="orginal_width" />
127                                <input type="hidden" id="orginal_height" />
128            <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" />
129          </td>
130          <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td>
131      </tr>
132        </table>
133<!--// image properties -->     
134        <div style="text-align: right;">
135          <hr />
136                  <button type="button" class="buttons" onclick="return refresh();">Refresh</button>
137          <button type="button" class="buttons" onclick="return onOK();">OK</button>
138          <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
139    </div>
140</form>
141</body>
142</html>
Note: See TracBrowser for help on using the repository browser.