Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lib / editor / htmlarea / popups / link.php
blobfd9b451520496b2268686c69471bae5b05b7bb90
1 <?php // $Id$
2 require("../../../../config.php");
4 $id = optional_param('id', SITEID, PARAM_INT);
6 require_course_login($id);
7 @header('Content-Type: text/html; charset=utf-8');
8 ?>
9 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
10 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
11 <html>
12 <head>
13 <title><?php print_string("insertlink","editor");?></title>
14 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
15 <script type="text/javascript">
16 //<![CDATA[
18 function onCancel() {
19 window.close();
20 return false;
23 function checkvalue(elm,formname) {
24 var el = document.getElementById(elm);
25 if(!el.value) {
26 alert("Nothing to do!");
27 el.focus();
28 return false;
32 function submit_form(dothis) {
33 if(dothis == "delete") {
34 window.fbrowser.document.dirform.action.value = "delete";
36 if(dothis == "move") {
37 window.fbrowser.document.dirform.action.value = "move";
39 if(dothis == "zip") {
40 window.fbrowser.document.dirform.action.value = "zip";
43 window.fbrowser.document.dirform.submit();
44 return false;
46 //]]>
47 </script>
48 <style type="text/css">
49 html, body { background-color: rgb(212,208,200); }
50 .title {
51 background-color: #ddddff;
52 padding: 5px;
53 border-bottom: 1px solid black;
54 font-family: Tahoma, sans-serif;
55 font-weight: bold;
56 font-size: 14px;
57 color: black;
59 input,select { font-family: Tahoma, sans-serif; font-size: 11px; }
60 legend { font-family: Tahoma, sans-serif; font-size: 11px; }
61 p { margin-left: 10px;
62 background-color: transparent; font-family: Tahoma, sans-serif;
63 font-size: 11px; color: black; }
64 td { font-family: Tahoma, sans-serif; font-size: 11px; }
65 button { width: 70px; font-family: Tahoma, sans-serif; font-size: 11px; }
66 #imodified,#itype,#isize {
67 background-color: rgb(212,208,200);
68 border: none;
69 font-family: Tahoma, sans-serif;
70 font-size: 11px;
71 color: black;
73 .space { padding: 2px; }
74 form { margin-bottom: 1px; margin-top: 1px; }
75 </style>
76 </head>
77 <body>
78 <div class="title"><?php print_string("insertlink","editor");?></div>
79 <table width="450" border="0" cellspacing="0" cellpadding="2">
80 <tr>
81 <td width="450" valign="top"><fieldset>
82 <legend><?php
83 if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) {
84 print_string("filebrowser","editor");
85 } else {
86 print "";
87 }?></legend>
89 <div class="space"></div>
90 <?php print(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id)))?
91 "<iframe id=\"fbrowser\" name=\"fbrowser\" src=\"../coursefiles.php?id=".$id."\" width=\"420\" height=\"180\"></iframe>":
92 ""; ?>
93 <p>
94 </p>
95 <div class="space"></div>
96 </fieldset>&nbsp;</td>
97 </tr>
98 </table>
99 <table width="100%" border="0" cellpadding="0" cellspacing="0">
100 <tr>
101 <td>
102 <table border="0" cellpadding="2" cellspacing="0">
103 <tr><td><?php print_string("selection","editor");?>: </td>
104 <td><form id="idelete">
105 <input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
106 <td><form id="imove">
107 <input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></form></td>
108 <td><form id="izip">
109 <input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
110 <td><form id="irename" method="post" action="../coursefiles.php" target="fbrowser">
111 <input type="hidden" name="id" value="<?php print($id);?>" />
112 <input type="hidden" name="wdir" value="" />
113 <input type="hidden" name="file" value="" />
114 <input type="hidden" name="action" value="rename" />
115 <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
116 <input name="btnRename" type="submit" id="btnRename" value="<?php print_string("rename","editor");?>" /></form></td>
117 </tr>
118 </table>
119 </td>
120 <td>
121 <button type="button" name="close" onclick="return onCancel();"><?php print_string("close","editor");?></button>
122 </td>
123 </tr>
124 </table>
125 <table border="0" cellpadding="1" cellspacing="1">
126 <tr>
127 <td height="22"><?php
128 if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
129 <form id="cfolder" action="../coursefiles.php" method="post" target="fbrowser">
130 <input type="hidden" name="id" value="<?php print($id);?>" />
131 <input type="hidden" name="wdir" value="" />
132 <input type="hidden" name="action" value="mkdir" />
133 <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
134 <input name="name" type="text" id="foldername" size="35" />
135 <input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
136 </form>
137 <form action="../coursefiles.php?id=<?php print($id);?>" method="post" enctype="multipart/form-data" target="fbrowser" id="uploader">
138 <input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
139 <input type="hidden" name="id" VALUE="<?php print($id);?>" />
140 <input type="hidden" name="wdir" value="" />
141 <input type="hidden" name="action" value="upload" />
142 <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
143 <input type="file" name="userfile" id="userfile" size="35" />
144 <input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="<?php print_string("upload","editor");?>" />
145 </form>
146 <?php
147 } else {
148 print "";
149 } ?>
150 </td>
151 </tr>
152 </table>
153 <p>&nbsp;</p>
154 </body>
155 </html>