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

Last change on this file since 886 was 830, checked in by gogo, 13 years ago

Add config item to allow the advanced image options to be hidden from the user.
ticket:1023

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 7.0 KB
Line 
1<?php
2/**
3 * The main GUI for the ImageManager.
4 * @author $Author$
5 * @version $Id$
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    // temporary. An ImageManager rewrite will take care of this kludge.
24    _backend_url = "<?php print $IMConfig['backend_url']; ?>";
25    _resized_prefix = "<?php echo $IMConfig['resized_prefix']; ?>";
26    _resized_dir = "<?php echo $IMConfig['resized_dir']; ?>";
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="assets/popup.js"></script>
32<script type="text/javascript" src="../../modules/ColorPicker/ColorPicker.js"></script>
33<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script>
34<script type="text/javascript">
35/*<![CDATA[*/
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<?php
45  if(!$IMConfig['show_full_options'])
46  {
47    ?>
48    <style type="text/css">
49      .fullOptions { visibility:hidden; }
50    </style>
51    <?php
52  }
53?>
54</head>
55<body>
56
57<form action="<?php print $IMConfig['backend_url'] ?>" id="uploadForm" method="post" enctype="multipart/form-data">
58
59<input type="hidden" name="__plugin" value="ImageManager">
60<input type="hidden" name="__function" value="images">
61
62<fieldset>
63  <legend>Image Manager</legend>
64  <table width="100%">
65    <tr>
66      <th><label for="dirPath">Directory</label></th>
67      <td>
68        <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
69          <option value="/">/</option>
70          <?php
71            foreach($dirs as $relative=>$fullpath)
72            {
73              ?>
74              <option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
75              <?php
76            }
77          ?>
78        </select>
79      </td>
80      <td>
81        <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>
82
83        <?php
84          if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir'])
85          {
86            ?>
87            <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>
88            <?php
89          }
90          ?>
91      </td>
92    </tr>
93    <?php
94      if($IMConfig['allow_upload'] == TRUE)
95      {
96        ?>
97        <tr>
98          <th align="left">Upload:</th>
99          <td colspan="2">
100            <input type="file" name="upload" id="upload" />
101            <input name="Upload" type="submit" id="Upload" value="Upload" onclick="doUpload();" />
102          </td>
103        </tr>
104        <?php
105      }
106    ?>
107
108  </table>
109
110  <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>
111
112  <iframe src="<?php print $IMConfig['backend_url']; ?>__function=images" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
113
114</fieldset>
115
116<!-- image properties -->
117
118<table  border="0" cellspacing="0" cellpadding="0" width="100%">
119  <tr>
120    <th align="left">Description:</th>
121    <td colspan="6">
122      <input type="text" id="f_alt" style="width:95%"/>
123    </td>
124    <td rowspan="4" width="100" height="100" valign="middle" style="padding:4px;background-color:#CCC;border:1px inset;">
125      <img src="" id="f_preview" />
126    </td>
127  </tr>
128
129  <tr>
130    <th align="left">Width:</th>
131    <td >
132      <input id="f_width" type="text" name="f_width" size="4" onchange="javascript:checkConstrains('width');" />
133    </td>
134    <td rowspan="2">
135      <div  style="position:relative">
136        <img src="<?php print $IMConfig['base_url']; ?>img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" valign="middle" /><input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" style="position:absolute;top:8px;left:0px;" />
137      </div>
138    </td>
139    <th align="left" class="fullOptions">Margin:</th>
140    <td colspan="3" class="fullOptions">
141      <input name="f_margin" type="text" id="f_margin" size="3" />
142      px </td>
143  </tr>
144
145  <tr>
146    <th align="left">Height:</th>
147    <td>
148      <input name="f_height" type="text" id="f_height" size="4" />
149    </td>
150    <th align="left"  class="fullOptions">Padding:</th>
151    <td  class="fullOptions">
152      <input name="f_padding" type="text" id="f_padding" size="3" />
153      px </td>
154    <th align="left"  class="fullOptions">Color:</th>
155    <td  class="fullOptions">
156      <input name="f_backgroundColor" type="text" id="f_backgroundColor" size="7" />
157     
158    </td>
159  </tr>
160
161
162  <tr class="fullOptions">
163    <th align="left">Alignment:</th>
164    <td colspan="2">
165      <select size="1" id="f_align"  title="Positioning of this image">
166        <option value=""                             >Not set</option>
167        <option value="left"                         >Left</option>
168        <option value="right"                        >Right</option>
169        <option value="texttop"                      >Texttop</option>
170        <option value="absmiddle"                    >Absmiddle</option>
171        <option value="baseline" selected="selected" >Baseline</option>
172        <option value="absbottom"                    >Absbottom</option>
173        <option value="bottom"                       >Bottom</option>
174        <option value="middle"                       >Middle</option>
175        <option value="top"                          >Top</option>
176      </select>
177    </td>
178    <th align="left">Border:</th>
179    <td>
180      <input name="f_border" type="text" id="f_border" size="3" />
181      px </td>
182    <th align="left">Color:</th>
183    <td>
184      <input name="f_borderColor" type="text" id="f_borderColor" size="7" />
185     
186    </td>
187  </tr>
188
189</table>
190
191<div style="text-align: right;">
192  <hr />
193  <button type="button" class="buttons" onclick="return refresh();">Refresh</button>
194  <button type="button" class="buttons" onclick="return onOK();">OK</button>
195  <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
196</div>
197
198<!--// image properties -->
199<input type="hidden" id="orginal_width" />
200<input type="hidden" id="orginal_height" />
201<input type="hidden" id="f_url" class="largelWidth" value="" />
202</form>
203</body>
204</html>
Note: See TracBrowser for help on using the repository browser.