Return to publisher.html CVS log | Up to [LON-CAPA] / loncom / publisher |
- adds back in delete - fixes form submission, del,copy,rename,new subdir work
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=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"> 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="newdir">New subdirectory:</option> 127: <option value="rename">Rename current file to:</option> 128: <option value="copy">Copy current file to:</option> 129: </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();" /> 130: </nobr> 131: </td> 132: </form> 133: </td> 134: </form> 135: </tr> 136: </table> 137: </th> 138: </tr> 139: </table> 140: </font> 141: </body> 142: </html>