File:  [LON-CAPA] / loncom / publisher / publisher.html
Revision 1.28: download - view: text, annotated - select for diffs
Thu May 29 21:44:53 2003 UTC (20 years, 11 months ago) by albertel
Branches: MAIN
CVS tags: version_0_99_2, version_0_99_1, conference_2003, HEAD
- Fixes #1522, spaces in dirnames doesn't causes list directory to have issues

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>