1: <html>
2: <head>
3: <title>LON-CAPA Publishing Frame</title>
4: <script language="JavaScript">
5:
6: function frameloc() {
7: if (parent.LONCAPAToBePublished.location.pathname.indexOf("/~")!=-1) {
8: parent.lastknownpriv=parent.LONCAPAToBePublished.location.pathname;
9: }
10: // alert ('We are at '+parent.lastknownpriv);
11: return unescape(parent.lastknownpriv);
12: }
13:
14: function getfilename() {
15: document.publisher.filename.value=frameloc();
16: if ((document.publisher.filename.value.charAt(
17: document.publisher.filename.value.length-1)!='/') &&
18: (document.publisher.filename.value.indexOf('/adm/pubdir')==-1)) {
19: document.publisher.submit();
20: } else {
21: alert('Cannot publish directory');
22: }
23: }
24:
25: function getdfilename() {
26: document.dpublisher.filename.value=frameloc();
27: if (document.dpublisher.filename.value.indexOf('/adm/pubdir')==-1) {
28: document.dpublisher.submit();
29: }
30: }
31:
32: function getufilename() {
33: document.upublisher.filename.value=frameloc();
34: if (document.upublisher.filename.value.indexOf('/adm/pubdir')!=-1) {
35: document.upublisher.filename.value=document.dpublisher.filename.value;
36: }
37: document.upublisher.submit();
38: }
39:
40: function getrfilename() {
41: document.rpublisher.filename.value=frameloc();
42: if ((document.rpublisher.filename.value.charAt(
43: document.rpublisher.filename.value.length-1)!='/') &&
44: (document.rpublisher.filename.value.indexOf('/adm/pubdir')==-1)) {
45: document.rpublisher.submit();
46: } else {
47: alert('Cannot retrieve directory');
48: }
49: }
50:
51: function getactionfilename() {
52: document.fileaction.filename.value=frameloc();
53: var test=document.fileaction.action.selectedIndex;
54: if (test == 4) { // trying to create a directory
55: if (document.fileaction.filename.value.indexOf('/adm/pubdir')!=-1) {
56: document.fileaction.filename.value=document.dpublisher.filename.value;
57: }
58: if ((document.fileaction.filename.value.charAt(
59: document.fileaction.filename.value.length-1)!='/') &&
60: (document.fileaction.filename.value.indexOf('/adm/pubdir')==-1)) {
61: alert('Must create new subdirectory inside a directory');
62: return;
63: }
64: }
65: document.fileaction.submit();
66: }
67:
68: function getdelfilename() {
69: document.del.filename.value=frameloc();
70: document.del.submit();
71: }
72:
73: function getpostdata() {
74: document.printout.postdata.value=frameloc();
75: document.printout.submit();
76: }
77: </script>
78: </head>
79: <body bgcolor="#ccffdd" text='#002200' link='#003333' vlink='#006666'>
80: <font size="-2">
81: <table border="0" align="center"><tr><th bgcolor="#004400" height="20">
82: <table border="0" cellspacing="2" cellpadding="2"><tr valign="middle">
83: <form name="publisher" action="/adm/publish" target="_parent" method="post">
84: <td bgcolor="#ccddaa" align="center">
85: <input type="hidden" name="filename" value="" />
86: <input type="button" value="Publish this Resource" onClick="getfilename();" />
87: </td>
88: </form>
89: <form name="dpublisher" action="/adm/pubdir" target="LONCAPAToBePublished" method="post">
90: <td bgcolor="#ccddaa" align="center">
91: <input type="hidden" name="filename" value="" />
92: <input type="button" value="List Directory" onClick="getdfilename();" />
93: </td>
94: </form>
95: <form name="upublisher" action="/adm/upload" target="_parent"
96: method="post" enctype="multipart/form-data">
97: <td bgcolor="#ccddaa" valign="top" align="center">
98: <input type="hidden" name="filename" value="" />
99: <input type="file" name="upfile" size="20" />
100: <input type="button" value="Upload file" onClick="getufilename();" />
101: </td>
102: </form>
103: <form name="printout" target="_parent" action="/adm/printout" target="LONCAPAToBePublished" method="post" onSubmit="getpostdata();">
104: <td rowspan="2" bgcolor="#ccddaa" align="center">
105: <input type="hidden" name="postdata" value="" />
106: <input type="button" value="Print" onClick="getpostdata();" />
107: </td>
108: </form>
109:
110: </tr>
111: <tr valign="middle">
112: <form name="rpublisher" action="/adm/retrieve" target="_parent" method="post">
113: <td bgcolor="#ccddaa" align="center">
114: <input type="hidden" name="filename" value="" />
115: <input type="button" value="Retrieve Old Version" onClick="getrfilename();" />
116: </td>
117: </form>
118: <form name="del" action="/adm/cfile" target="_parent" method="post">
119: <td bgcolor="#ccddaa">
120: <input type="hidden" name="filename" value="" />
121: <input type="hidden" name="action" value="delete" />
122: <input type="button" value="Delete" onClick="getdelfilename();" />
123: </td>
124: </form>
125: <form name="fileaction" action="/adm/cfile" target="_parent" method="post" onSubmit="getactionfilename();">
126: <td bgcolor="#ccddaa" align="center">
127: <nobr>
128: <input type="hidden" name="filename" value="" />
129: <select name="action">
130: <option>Select Action</option>
131: <option value="newfile">New file:</option>
132: <option value="newhtmlfile">New HTML file:</option>
133: <option value="newproblemfile">New problem:</option>
134: <option value="newpagefile">New assembled page:</option>
135: <option value="newsequencefile">New assembled sequence:</option>
136: <option value="newrightsfile">New custom rights file:</option>
137: <option value="newstyfile">New style file:</option>
138: <option value="newdir">New subdirectory:</option>
139: <option value="rename">Rename current file to:</option>
140: <option value="copy">Copy current file to:</option>
141: </select> <input type="text" name="newfilename" value="Type Name Here" onFocus="if (this.value == 'Type Name Here') this.value=''" /> <input type="button" value="Go" onClick="getactionfilename();" />
142: </nobr>
143: </td>
144: </form>
145: </td>
146: </form>
147: </tr>
148: </table>
149: </th>
150: </tr>
151: </table>
152: </font>
153: </body>
154: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>