version 1.15, 2002/09/02 15:27:08
|
version 1.16, 2002/09/04 13:06:20
|
Line 68 sub editor {
|
Line 68 sub editor {
|
$r->print('<p><font color="red">'.$errtext.'</font></p>'); |
$r->print('<p><font color="red">'.$errtext.'</font></p>'); |
} else { |
} else { |
# ------------------------------------------------------------ Process commands |
# ------------------------------------------------------------ Process commands |
if ($allowed) { |
# ---------------- if they are for this folder and user allowed to make changes |
|
if (($allowed) && ($ENV{'form.folder'} eq $folder)) { |
# upload a file, if present |
# upload a file, if present |
if (($ENV{'form.uploaddoc.filename'}) && |
if (($ENV{'form.uploaddoc.filename'}) && |
($ENV{'form.cmd'}=~/^upload_(\w+)/)) { |
($ENV{'form.cmd'}=~/^upload_(\w+)/)) { |
Line 135 sub editor {
|
Line 136 sub editor {
|
# Store the changed version |
# Store the changed version |
&storemap($coursenum,$coursedom,$folder.'.sequence'); |
&storemap($coursenum,$coursedom,$folder.'.sequence'); |
} |
} |
} |
} |
|
# ---------------------------------------------------------------- End commands |
# ---------------------------------------------------------------- Print screen |
# ---------------------------------------------------------------- Print screen |
my $idx=0; |
my $idx=0; |
$r->print('<table>'); |
$r->print('<table>'); |
Line 167 sub entryline {
|
Line 169 sub entryline {
|
<a href='/adm/coursedocs?folder=$folder&cmd=del_$index'>Remove</td> |
<a href='/adm/coursedocs?folder=$folder&cmd=del_$index'>Remove</td> |
END |
END |
} |
} |
# URL |
# Figure out what kind of a resource this is |
if ($url=~/^\/*uploaded\//) { |
my ($extension)=($url=~/\.(\w+)$/); |
$url=&Apache::lonnet::tokenwrapper($url); |
my $uploaded=($url=~/^\/*uploaded\//); |
|
my $icon='unknown'; |
|
if (-e "/home/httpd/html/adm/lonIcons/$extension.gif") { |
|
$icon=$extension; |
} |
} |
$line.='<td><a href="'.$url.'">View</a></td>'; |
if ($uploaded) { |
|
if ($extension eq 'sequence') { |
|
$icon='folder_closed'; |
|
$url=~/\/(\w+)\.sequence/; |
|
$url='/adm/coursedocs?folder='.$1; |
|
} else { |
|
$url=&Apache::lonnet::tokenwrapper($url); |
|
} |
|
} |
|
$line.='<td bgcolor="#FFFFBB"><a href="'.$url.'"><img src="/adm/lonIcons/'. |
|
$icon.'.gif" border="0"></a></td>'; |
# Title |
# Title |
$title=&Apache::lonnet::unescape($title); |
$title=&Apache::lonnet::unescape($title); |
if ($title=~ |
if ($title=~ |
Line 179 END
|
Line 194 END
|
) { $title='<i>'.localtime($1).'</i> '.$2.' at '.$3.': <br>'. |
) { $title='<i>'.localtime($1).'</i> '.$2.' at '.$3.': <br>'. |
&Apache::lontexconvert::msgtexconverted($4); |
&Apache::lontexconvert::msgtexconverted($4); |
} |
} |
$line.="<td>$title</td>"; |
$line.="<td bgcolor='#FFFFBB'><a href='$url'>$title</a></td>"; |
$line.='</tr>'; |
$line.='</tr>'; |
return $line; |
return $line; |
} |
} |
Line 240 sub handler {
|
Line 255 sub handler {
|
<html> |
<html> |
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
<script>$script</script> |
<script> |
|
$script |
|
|
|
function makenewfolder(targetform,folderseq) { |
|
var foldername=prompt('Name of New Folder','New Folder'); |
|
if (foldername) { |
|
targetform.importdetail.value=foldername+"="+folderseq; |
|
targetform.submit(); |
|
} |
|
} |
|
|
|
function makenewext(targetform) { |
|
} |
|
</script> |
</head> |
</head> |
ENDDOCUMENT |
ENDDOCUMENT |
$r->print(&Apache::loncommon::bodytag('Course Documents','',$events)); |
$r->print(&Apache::loncommon::bodytag('Course Documents','',$events)); |
Line 250 $r->print(&Apache::loncommon::bodytag('C
|
Line 278 $r->print(&Apache::loncommon::bodytag('C
|
my $folder=$ENV{'form.folder'}; |
my $folder=$ENV{'form.folder'}; |
unless ($folder=~/^default/) { $folder='default'; } |
unless ($folder=~/^default/) { $folder='default'; } |
&editor($r,$coursenum,$coursedom,$folder,$allowed); |
&editor($r,$coursenum,$coursedom,$folder,$allowed); |
|
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
|
'.sequence'; |
$r->print(<<ENDFORM); |
$r->print(<<ENDFORM); |
<table><tr> |
<table cellspacing=2><tr> |
<th>Upload a new main course document</th> |
<th bgcolor="#DDDDDD">Upload a new main course document</th> |
<th>Import a published document</th> |
<th bgcolor="#DDDDDD">Import a published document</th> |
<th>Special documents</th> |
<th bgcolor="#DDDDDD">Special documents</th> |
</tr> |
</tr> |
<tr><td> |
<tr><td bgcolor="#DDDDDD"> |
File:<br /> |
File:<br /> |
<form action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
<form action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
<input type="file" name="uploaddoc" size="50"> |
<input type="file" name="uploaddoc" size="50"> |
Line 268 Title:<br />
|
Line 298 Title:<br />
|
<input type="submit" value="Upload Document"> |
<input type="submit" value="Upload Document"> |
</form> |
</form> |
</td> |
</td> |
<td> |
<td bgcolor="#DDDDDD"> |
<form action="/adm/coursedocs" method="post" name="simpleedit"> |
<form action="/adm/coursedocs" method="post" name="simpleedit"> |
|
<input type="hidden" name="folder" value="$folder"> |
<input type=hidden name="importdetail" value=""> |
<input type=hidden name="importdetail" value=""> |
<input type=button onClick= |
<input type=button onClick= |
"javascript:groupsearch()" value="Group Search"> |
"javascript:groupsearch()" value="Search"> |
<input type=button onClick= |
<input type=button onClick= |
"javascript:groupimport();" value="Group Import"> |
"javascript:groupimport();" value="Import"> |
</form> |
</form> |
</td><td> |
</td><td bgcolor="#DDDDDD"> |
<form action="/adm/coursedocs" method="post" name="newfolder"> |
<form action="/adm/coursedocs" method="post" name="newfolder"> |
|
<input type="hidden" name="folder" value="$folder"> |
<input type=hidden name="importdetail" value=""> |
<input type=hidden name="importdetail" value=""> |
<input name="newfolder" type="button" onClick="javascript:newfolder();" |
<input name="newfolder" type="button" |
|
onClick="javascript:makenewfolder(this.form,'$folderseq');" |
value="New Folder" /> |
value="New Folder" /> |
</form> |
</form> |
<form action="/adm/coursedocs" method="post" name="newext"> |
<form action="/adm/coursedocs" method="post" name="newext"> |
|
<input type="hidden" name="folder" value="$folder"> |
<input type=hidden name="importdetail" value=""> |
<input type=hidden name="importdetail" value=""> |
<input name="newext" type="button" onClick="javascript:newext();" |
<input name="newext" type="button" onClick="javascript:makenewext(this.form);" |
value="External Resource" /> |
value="External Resource" /> |
</form> |
</form> |
<form action="/adm/coursedocs" method="post" name="newsyl"> |
<form action="/adm/coursedocs" method="post" name="newsyl"> |
|
<input type="hidden" name="folder" value="$folder"> |
<input type=hidden name="importdetail" |
<input type=hidden name="importdetail" |
value="Syllabus=/public/$coursedom/$coursenum/syllabus"> |
value="Syllabus=/public/$coursedom/$coursenum/syllabus"> |
<input name="newsyl" type="submit" value="Syllabus" /> |
<input name="newsyl" type="submit" value="Syllabus" /> |
Line 298 value="Navigate Content=/adm/navmaps">
|
Line 333 value="Navigate Content=/adm/navmaps">
|
<input name="newsyl" type="submit" value="Navigate Content" /> |
<input name="newsyl" type="submit" value="Navigate Content" /> |
</form> |
</form> |
<form action="/adm/coursedocs" method="post" name="newaboutme"> |
<form action="/adm/coursedocs" method="post" name="newaboutme"> |
|
<input type="hidden" name="folder" value="$folder"> |
<input type=hidden name="importdetail" |
<input type=hidden name="importdetail" |
value="$plainname=/adm/$udom/$uname/aboutme"> |
value="$plainname=/adm/$udom/$uname/aboutme"> |
<input name="newaboutme" type="submit" onClick="javascript:newaboutme();" |
<input name="newaboutme" type="submit" value="My Personal Info" /> |
value="My Personal Info" /> |
|
</form> |
</form> |
</td></tr> |
</td></tr> |
</table> |
</table> |