[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Wed, 07 Apr 2004 21:40:21 -0000
This is a MIME encoded message
--albertel1081374021
Content-Type: text/plain
albertel Wed Apr 7 17:40:21 2004 EDT
Modified files:
/loncom/interface londocs.pm
Log:
- BUG#1331, okay all of the main/supp buttons work for nested folders, however they don't currently work on the the main folders, need to debug why
--albertel1081374021
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20040407174021.txt"
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.114 loncom/interface/londocs.pm:1.115
--- loncom/interface/londocs.pm:1.114 Wed Apr 7 16:36:54 2004
+++ loncom/interface/londocs.pm Wed Apr 7 17:40:21 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.114 2004/04/07 20:36:54 albertel Exp $
+# $Id: londocs.pm,v 1.115 2004/04/07 21:40:21 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -472,24 +472,23 @@
'dw' => 'Move Down',
'rm' => 'Remove',
'rn' => 'Rename');
- my ($foldername,$htmlfoldername);
- if ($ENV{'form.foldername'}) {
- $foldername='&foldername='.
- &Apache::lonnet::escape($ENV{'form.foldername'});
- $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
+ my $folderpath;
+ if ($ENV{'form.folderpath'}) {
+ $folderpath=&Apache::lonnet::escape($ENV{'form.folderpath'});
+ # $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
}
$line.=(<<END);
<td><table border='0' cellspacing='2' cellpadding='0'>
<tr><td bgcolor="#DDDDDD">
-<a href='/adm/coursedocs?folder=$folder&cmd=up_$index$foldername'>
+<a href='/adm/coursedocs?cmd=up_$index&folderpath=$folderpath'>
<img src="${iconpath}move_up.gif" alt='$lt{'up'}' border='0' /></a></td></tr>
<tr><td bgcolor="#DDDDDD">
-<a href='/adm/coursedocs?folder=$folder&cmd=down_$index$foldername'>
+<a href='/adm/coursedocs?cmd=down_$index&folderpath=$folderpath'>
<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' border='0' /></a></td></tr>
</table></td><td bgcolor="#DDDDDD">
-<a href='javascript:removeres("$folder","$index","$renametitle","$htmlfoldername");'>
+<a href='javascript:removeres("$folderpath","$index","$renametitle");'>
<font size="-2" color="#990000">$lt{'rm'}</font></a>
-<a href='javascript:changename("$folder","$index","$renametitle","$htmlfoldername");'>
+<a href='javascript:changename("$folderpath","$index","$renametitle");'>
<font size="-2" color="#009900">$lt{'rn'}</font></a></td>
END
}
@@ -696,7 +695,6 @@
foreach (keys %ENV) {
if ($_=~/^form\.set_version_(.+)$/) {
my $src=$1;
- &Apache::lonnet::logthis('Found: '.$1.' '.$ENV{$_});
if (($ENV{$_}) && ($ENV{$_} ne $setversions{$src})) {
$newsetversions{$src}=$ENV{$_};
}
@@ -1088,22 +1086,20 @@
'";this.document.forms.'+form+'.submit();');
}
-function changename(folder,index,oldtitle,foldername) {
+function changename(folderpath,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.foldername.value=foldername;
+ this.document.forms.renameform.folderpath.value=folderpath;
this.document.forms.renameform.submit();
}
}
-function removeres(folder,index,oldtitle,foldername) {
+function removeres(folderpath,index,oldtitle) {
if (confirm('Remove "'+oldtitle+'"?')) {
this.document.forms.renameform.cmd.value='del_'+index;
- this.document.forms.renameform.folder.value=folder;
- this.document.forms.renameform.foldername.value=foldername;
+ this.document.forms.renameform.folderpath.value=folderpath;
this.document.forms.renameform.submit();
}
}
@@ -1155,13 +1151,11 @@
<form name="renameform" method="post" action="/adm/coursedocs">
<input type="hidden" name="title" />
<input type="hidden" name="cmd" />
-<input type="hidden" name="folder" />
-<input type="hidden" name="foldername" />
+<input type="hidden" name="folderpath" />
</form>
<form name="simpleedit" method="post" action="/adm/coursedocs">
<input type=hidden name="importdetail" value="">
-<input type="hidden" name="folder" />
-<input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
</form>
<form action="/adm/coursedocs" method="post" name="courseverify">
<table bgcolor="#AAAAAA" width="100%" cellspacing="4" cellpadding="4">
@@ -1177,7 +1171,7 @@
&mt('Editing the Table of Contents for your Course')));
}
# --------------------------------------------------------- Standard documents
- my $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
+ #my $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
$r->print('<table border=2 cellspacing=4 cellpadding=4>');
if (($standard) && ($allowed) && (!$forcesupplement)) {
$r->print('<tr><td bgcolor="#BBBBBB"><h2>'.&mt('Main Course Documents').
@@ -1212,8 +1206,7 @@
<br />
$lt{'title'}:<br />
<input type="text" size="50" name="comment">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type="hidden" name="cmd" value="upload_default">
<input type="submit" value="$lt{'upld'}">
<nobr>
@@ -1223,13 +1216,10 @@
</td>
<td bgcolor="#DDDDDD">
<form action="/adm/coursedocs" method="post" name="simpleeditdefault">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
-<input type=button onClick=
-"javascript:document.forms.simpleedit.folder.value='$folder';groupsearch()" value="$lt{'srch'}">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type=button onClick="javascript:groupsearch()" value="$lt{'srch'}">
<nobr>
-<input type=button onClick=
-"javascript:document.forms.simpleedit.folder.value='$folder';groupimport();" value="$lt{'impo'}">
+<input type=button onClick="javascript:groupimport();" value="$lt{'impo'}">
$help{'Importing_LON-CAPA_Resource'}
</nobr>
<p>
@@ -1243,8 +1233,7 @@
</form>
</td><td bgcolor="#DDDDDD">
<form action="/adm/coursedocs" method="post" name="newfolder">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newfolder" type="button"
@@ -1253,8 +1242,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newext">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newext" type="button" onClick="javascript:makenewext('newext');"
@@ -1262,8 +1250,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newsyl">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail"
value="Syllabus=/public/$coursedom/$coursenum/syllabus">
<nobr>
@@ -1272,8 +1259,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newnav">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail"
value="Navigate Content=/adm/navmaps">
<nobr>
@@ -1282,8 +1268,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newsmppg">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newsmppg" type="button" value="$lt{'sipa'}"
@@ -1291,8 +1276,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newsmpproblem">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newsmpproblem" type="button" value="$lt{'sipr'}"
@@ -1300,8 +1284,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newexamupload">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newexamupload" type="button" value="$lt{'scuf'}"
@@ -1310,8 +1293,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newbul">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newbulletin" type="button" value="$lt{'bull'}"
@@ -1320,8 +1302,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newaboutme">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail"
value="$plainname=/adm/$udom/$uname/aboutme">
<nobr>
@@ -1330,8 +1311,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="newaboutsomeone">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newaboutsomeone" type="button" value="$lt{'abou'}"
@@ -1339,7 +1319,7 @@
</nobr>
</form>
<form action="/adm/imsimportdocs" method="post" name="ims">
-<input type="hidden" name="folder" value="$folder" />
+<input type="hidden" name="folder" value="$ENV{'form.folder'}" />
<input name="imsimport" type="button" value="$lt{'imsf'}" onClick="javascript:makeims();" />
</nobr>
</form>
@@ -1372,8 +1352,8 @@
<br />$lt{'comment'}:<br />
<textarea cols=50 rows=4 name='comment'>
</textarea>
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<br />
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type="hidden" name="cmd" value="upload_supplemental">
<nobr>
<input type="submit" value="$lt{'upld'}">
@@ -1383,8 +1363,7 @@
</td>
<td bgcolor="#DDDDDD">
<form action="/adm/coursedocs" method="post" name="supnewfolder">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newfolder" type="button"
@@ -1393,8 +1372,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="supnewext">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail" value="">
<nobr>
<input name="newext" type="button"
@@ -1403,8 +1381,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="supnewsyl">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail"
value="Syllabus=/public/$coursedom/$coursenum/syllabus">
<nobr>
@@ -1413,8 +1390,7 @@
</nobr>
</form>
<form action="/adm/coursedocs" method="post" name="subnewaboutme">
-<input type="hidden" name="folder" value="$folder">
-<input type="hidden" name="foldername" value="$htmlfoldername">
+<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
<input type=hidden name="importdetail"
value="$plainname=/adm/$udom/$uname/aboutme">
<nobr>
--albertel1081374021--