--- rat/lonratedt.pm 2002/05/21 18:18:07 1.25 +++ rat/lonratedt.pm 2002/05/22 20:39:59 1.27 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Edit Handler for RAT Maps # -# $Id: lonratedt.pm,v 1.25 2002/05/21 18:18:07 www Exp $ +# $Id: lonratedt.pm,v 1.27 2002/05/22 20:39:59 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -263,6 +263,7 @@ ENDDOCUMENT # ---------------------------------------------------------------- Make buttons sub buttons { + if ($ENV{'form.forceselect'}) { return ''; } my $adv=shift; my $output='
'; if ($adv==1) { @@ -353,11 +354,11 @@ sub smpedt { my @targetselect=(); undef @importselect; undef @targetselect; - if (defined($ENV{'form.import'})) { - if (ref($ENV{'form.import'})) { - @importselect=sort(@{$ENV{'form.import'}}); + if (defined($ENV{'form.importsel'})) { + if (ref($ENV{'form.importsel'})) { + @importselect=sort(@{$ENV{'form.importsel'}}); } else { - @importselect=($ENV{'form.import'}); + @importselect=($ENV{'form.importsel'}); } } if (defined($ENV{'form.target'})) { @@ -683,7 +684,7 @@ function idxcheck(mode) { function viewimport() { openview((document.forms.simpleedit.curimpdetail.value.split('&')) - [document.forms.simpleedit.import.selectedIndex+1]); + [document.forms.simpleedit.importsel.selectedIndex+1]); } @@ -720,7 +721,7 @@ after selected
- $importwindow @@ -734,7 +735,7 @@ Copy selected
Paste after selected
- $targetwindow @@ -764,23 +765,73 @@ ENDNODIR sub viewmap { my ($r,$url,$adv,$errtext)=@_; - $r->print(''.&buttons($adv)); + $r->print(''); + if ($ENV{'form.forceselect'}) { $r->print(< + +function select_group() { + window.location="/adm/groupsort?catalogmode=groupimport&mode=rat&acts="+document.forms.fileattr.acts.value; +} + +function queue(val) { + if (eval("document.forms."+val+".filelink.checked")) { + var l=val.length; + var v=val.substring(4,l); + document.forms.fileattr.acts.value+='1a'+v+'b'; + } + else { + var l=val.length; + var v=val.substring(4,l); + document.forms.fileattr.acts.value+='0a'+v+'b'; + } +} + + + + +ENDSCRIPT + } + $r->print(''.&buttons($adv)); + if ($ENV{'form.forceselect'}) { $r->print(< + + + +ENDSELECT + } if ($errtext) { $r->print($errtext.'
'); } + my $idx=0; foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) { if (defined($_)) { + $idx++; + if ($ENV{'form.forceselect'}) { + $r->print('
'); + } my ($title,$url)=split(/\:/,$_); $title=~s/\&colon\;/\:/g; $url=~s/\&colon\;/\:/g; unless ($title) { $title=(split(/\//,$url))[-1] }; unless ($title) { $title='Empty'; } if ($url) { + if ($ENV{'form.forceselect'}) { + $r->print(< + +ENDCHECKBOX + } $r->print(''); } $r->print(&Apache::lonratsrv::qtescape($title)); if ($url) { $r->print(''); } - $r->print('
'); + if ($ENV{'form.forceselect'}) { + $r->print(''); + } else { + $r->print('
'); + } } } $r->print(''); @@ -794,6 +845,9 @@ sub handler { $r->send_http_header; return OK if $r->header_only; + + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['forceselect']); my $url=$r->uri; my $fn=&Apache::lonnet::filelocation('',$url);