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 $
3
3
include("../../../config.php");
7
7
if (!$course = get_record("course", "id", $id)) {
8
8
$course->fullname = ""; // Just to keep display happy, though browsing may fail
11
$upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
15
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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;
22
26
var param = window.dialogArguments;
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);
168
171
.space { padding: 2px; }
169
172
form { margin-bottom: 0px; margin-top: 0px; }
171
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
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");
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
"<iframe id=\"ibrowser\" name=\"ibrowser\" src=\"".$CFG->wwwroot."/lib/editor/coursefiles.php?usecheckboxes=1&id=".$course->id."\" style=\"width: 100%; height: 200px;\"></iframe>":
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>
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>
305
307
<div class="space"></div>
306
308
<?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>
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>
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');" />
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");?>" />