--- loncom/interface/londocs.pm 2002/10/18 13:47:57 1.32
+++ loncom/interface/londocs.pm 2002/11/18 15:21:31 1.37
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.32 2002/10/18 13:47:57 www Exp $
+# $Id: londocs.pm,v 1.37 2002/11/18 15:21:31 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -127,6 +127,18 @@ sub editor {
$Apache::lonratedt::order[$idx+1]=
$Apache::lonratedt::order[$idx];
$Apache::lonratedt::order[$idx]=$i;
+ } elsif ($cmd eq 'rename') {
+ my ($rtitle,@rrest)=split(/\:/,
+ $Apache::lonratedt::resources[
+ $Apache::lonratedt::order[$idx]]);
+ my $comment=$ENV{'form.title'};
+ $comment=~s/\\<\;/g;
+ $comment=~s/\>/\>\;/g;
+ $comment=~s/\:/\:/g;
+ $Apache::lonratedt::resources[
+ $Apache::lonratedt::order[$idx]]=
+ $comment.':'.join(':',@rrest);
+
}
# Store the changed version
&storemap($coursenum,$coursedom,$folder.'.sequence');
@@ -161,7 +173,7 @@ sub editor {
foreach (@Apache::lonratedt::order) {
my ($name,$url)=split(/\:/,$Apache::lonratedt::resources[$_]);
unless ($name) { $name=(split(/\//,$url))[-1]; }
- unless ($name) { $name='EMPTY'; }
+ unless ($name) { $name='NO RESOURCE'; $url='/adm/notfound.html'; }
$r->print(&entryline($idx,$name,$url,$folder,$allowed));
$idx++;
}
@@ -183,7 +195,10 @@ sub entryline {
![DOWN](${iconpath}move_down.gif) |
-Remove |
+
+Remove
+
+Rename
END
}
# Figure out what kind of a resource this is
@@ -260,6 +275,33 @@ sub checkonthis {
if ($result==OK) {
$r->print('ok');
$r->rflush();
+ &Apache::lonnet::countacc($url);
+ $url=~/\.(\w+)$/;
+ if (&Apache::loncommon::fileembstyle($1) eq 'ssi') {
+ $r->print('
');
+ $r->rflush();
+ for (my $i=0;$i<=$level*5;$i++) {
+ $r->print(' ');
+ }
+ $r->print('- Rendering: ');
+ &Apache::lonxml::xmlparse($r,'web',
+ &Apache::lonnet::getfile(
+ &Apache::lonnet::filelocation('',$url)));
+ if (($Apache::lonxml::errorcount) ||
+ ($Apache::lonxml::warningcount)) {
+ if ($Apache::lonxml::errorcount) {
+ $r->print(''.
+ $Apache::lonxml::errorcount.' error(s) ');
+ }
+ if ($Apache::lonxml::warningcount) {
+ $r->print(''.
+ $Apache::lonxml::warningcount.' warning(s)');
+ }
+ } else {
+ $r->print('ok');
+ }
+ $r->rflush();
+ }
my $dependencies=
&Apache::lonnet::metadata($url,'dependencies');
foreach (split(/\,/,$dependencies)) {
@@ -377,7 +419,14 @@ ENDHEADERS
$r->print('Version '.$prevvers.' ('.
localtime(&Apache::lonnet::metadata($url,'lastrevisiondate')).
- ')
');
+ ')');
+ if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') {
+ $r->print(' Diffs');
+ }
+ $r->print('
');
}
$r->print('');
}
@@ -483,7 +532,22 @@ function finishpick() {
('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+
'";this.document.forms.'+form+'.submit();');
}
+
+function changename(folder,index,oldtitle) {
+ var title=prompt('New Title',oldtitle);
+ if (title) {
+ this.document.forms.renameform.title.value=title;
+ this.document.forms.renameform.cmd.value='rename_'+index;
+ this.document.forms.renameform.folder.value=folder;
+ this.document.forms.renameform.submit();
+ }
+}
+
ENDNEWSCRIPT
}
# -------------------------------------------------------------------- Body tag