~ubuntu-branches/ubuntu/hoary/moodle/hoary

« back to all changes in this revision

Viewing changes to lib/editor/popups/insert_image.php

  • Committer: Bazaar Package Importer
  • Author(s): Isaac Clerencia
  • Date: 2004-12-29 00:49:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041229004952-gliyqzpj2w3e7clx
Tags: 1.4.3-1
* Urgency high as upstream release fixes several security bugs
* New upstream release
* Write database creation errors and warn the user about it, 
closes: #285842, #285842

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php // $Id: insert_image.php,v 1.9 2004/03/07 14:40:39 julmis Exp $
 
1
<?php // $Id: insert_image.php,v 1.10.2.2 2004/11/04 16:23:13 moodler Exp $
2
2
 
3
3
    include("../../../config.php");
4
4
 
5
 
        require_variable($id);
 
5
    require_variable($id);
6
6
 
7
7
    if (!$course = get_record("course", "id", $id)) {
8
8
        $course->fullname = "";   // Just to keep display happy, though browsing may fail
9
9
    }
10
 
    
 
10
 
 
11
    $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
 
12
 
11
13
?>
 
14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
15
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
12
16
<html>
13
17
<head>
14
18
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
15
19
<title><?php print_string("insertimage","editor");?></title>
16
 
<script type="text/javascript" src="popup.js"></script>
17
 
<script type="text/javascript">
 
20
<script language="javascript" type="text/javascript" src="popup.js"></script>
 
21
<script language="javascript" type="text/javascript">
18
22
var preview_window = null;
19
23
 
20
24
function Init() {
21
25
  __dlg_init();
22
26
  var param = window.dialogArguments;
23
27
  if (param) {
 
28
      var alt = param["f_url"].substring(param["f_url"].lastIndexOf('/') + 1);
24
29
      document.getElementById("f_url").value = param["f_url"];
25
 
      document.getElementById("f_alt").value = param["f_alt"];
26
 
      document.getElementById("f_border").value = param["f_border"];
 
30
      document.getElementById("f_alt").value = param["f_alt"] ? param["f_alt"] : alt;
 
31
      document.getElementById("f_border").value = parseInt(param["f_border"] || 0);
27
32
      document.getElementById("f_align").value = param["f_align"];
28
 
      document.getElementById("f_vert").value = param["f_vert"];
29
 
      document.getElementById("f_horiz").value = param["f_horiz"];
 
33
      document.getElementById("f_vert").value = param["f_vert"] != -1 ? param["f_vert"] : 0;
 
34
      document.getElementById("f_horiz").value = param["f_horiz"] != -1 ? param["f_horiz"] : 0;
30
35
      document.getElementById("f_width").value = param["f_width"];
31
36
      document.getElementById("f_height").value = param["f_height"];
32
37
      window.ipreview.location.replace('preview.php?id='+ <?php print($course->id);?> +'&imageurl='+ param.f_url);
144
149
</script>
145
150
<style type="text/css">
146
151
html, body {
147
 
width: 730;
148
 
height: 540;
149
152
margin: 2px;
150
153
background-color: rgb(212,208,200);
151
154
font-family: Tahoma, Verdana, sans-serif;
168
171
.space { padding: 2px; }
169
172
form { margin-bottom: 0px; margin-top: 0px; }
170
173
</style>
171
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
172
174
</head>
173
 
 
174
175
<body onload="Init()">
175
176
  <div class="title"><?php print_string("insertimage","editor");?></div>
176
177
  <div class="space"></div>
264
265
          print_string("filebrowser","editor");
265
266
      } else {
266
267
          print "";
267
 
      }?><br>
 
268
      }?><br />
268
269
      <?php print(isteacher($id))?
269
 
          "<iframe id=\"ibrowser\" name=\"ibrowser\" src=\"".$CFG->wwwroot."/lib/editor/coursefiles.php?usecheckboxes=true&id=".$course->id."\" style=\"width: 100%; height: 200px;\"></iframe>":
270
 
          "";?>
 
270
      "<iframe id=\"ibrowser\" name=\"ibrowser\" src=\"".$CFG->wwwroot."/lib/editor/coursefiles.php?usecheckboxes=1&id=".$course->id."\" style=\"width: 100%; height: 200px;\"></iframe>":
 
271
      "";?>
271
272
      </td>
272
 
      <td width="45%" valign="top"><?php print_string("preview","editor");?>:<br>
273
 
          <iframe id="ipreview" name="ipreview" src="about:blank" style="width: 100%; height: 200px;"></iframe>
 
273
      <td width="45%" valign="top"><?php print_string("preview","editor");?>:<br />
 
274
      <iframe id="ipreview" name="ipreview" src="about:blank" style="width: 100%; height: 200px;"></iframe>
274
275
      </td>
275
276
    </tr>
276
277
  </table>
291
292
          <input type="hidden" name="wdir" value="" />
292
293
          <input type="hidden" name="file" value="" />
293
294
          <input type="hidden" name="action" value="rename" />
 
295
          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
294
296
          <input name="btnRename" type="submit" id="btnRename" value="<?php print_string("rename","editor");?>" /></form></td>
295
297
          <tr></table>
296
 
          <br>
 
298
          <br />
297
299
          <?php 
298
300
          } else {
299
301
              print "";
305
307
          <div class="space"></div>
306
308
          &nbsp;&nbsp;<?php print_string("size","editor");?>: 
307
309
          <input type="text" id="isize" name="isize" size="10" style="background: transparent; border: none;" />
308
 
          <?php print_string("type","editor");?>: <input type="text" id="itype" name="itype" size="10" style="background: transparent; border: none;" />
309
 
          <div class="space"></div>
310
 
          <div class="space"></div>
311
 
          </fieldset></td>
 
310
      <?php print_string("type","editor");?>: <input type="text" id="itype" name="itype" size="10" style="background: transparent; border: none;" />
 
311
      <div class="space"></div>
 
312
      <div class="space"></div>
 
313
      </fieldset></td>
312
314
    </tr>
313
315
    <tr> 
314
316
      <td height="22"><?php
317
319
          <input type="hidden" name="id" value="<?php print($course->id);?>" />
318
320
          <input type="hidden" name="wdir" value="" />
319
321
          <input type="hidden" name="action" value="mkdir" />
 
322
          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
320
323
          <input name="name" type="text" id="foldername" size="35" />
321
324
          <input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
322
325
          </form>
323
326
          <div class="space"></div>
324
327
          <form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" name="uploader" target="ibrowser" id="uploader">
325
 
                  <input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
 
328
          <input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
326
329
          <input type="hidden" name="id" VALUE="<?php print($course->id);?>" />
327
330
          <input type="hidden" name="wdir" value="" />
328
331
          <input type="hidden" name="action" value="upload" />
 
332
          <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
329
333
          <input type="file" name="userfile" id="userfile" size="35" />
330
334
          <input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="<?php print_string("upload","editor");?>" />
331
335
          </form>
336
340
          </td>
337
341
    </tr>
338
342
  </table>
339
 
  <p>&nbsp; </p>
 
343
  <p>&nbsp;</p>
340
344
</body>
341
345
</html>