--- loncom/interface/londocs.pm 2002/10/20 18:42:53 1.34
+++ loncom/interface/londocs.pm 2002/10/25 13:39:36 1.36
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.34 2002/10/20 18:42:53 www Exp $
+# $Id: londocs.pm,v 1.36 2002/10/25 13:39:36 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');
@@ -183,7 +195,10 @@ sub entryline {
 |
-Remove |
+
+Remove
+
+Rename
END
}
# Figure out what kind of a resource this is
@@ -265,18 +280,13 @@ sub checkonthis {
if (&Apache::loncommon::fileembstyle($1) eq 'ssi') {
$r->print('
');
$r->rflush();
- my $default='';
- if ($1=~/(problem|exam|quiz|assess|survey|form|library)/) {
- $default=&Apache::lonnet::getfile(
- '/home/httpd/html/res/adm/includes/default_homework.lcpm');
- }
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)),$default);
+ &Apache::lonnet::filelocation('',$url)));
if (($Apache::lonxml::errorcount) ||
($Apache::lonxml::warningcount)) {
if ($Apache::lonxml::errorcount) {
@@ -522,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