--- rat/lonratedt.pm 2002/05/22 20:39:59 1.27 +++ rat/lonratedt.pm 2002/05/25 18:50:46 1.29 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Edit Handler for RAT Maps # -# $Id: lonratedt.pm,v 1.27 2002/05/22 20:39:59 www Exp $ +# $Id: lonratedt.pm,v 1.29 2002/05/25 18:50:46 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -129,7 +129,9 @@ sub mapread { } # ---------------------------------------------- Read a map as well as possible - +# Also used by the sequence handler +# Call lonsequence::attemptread to read from resource space +# sub attemptread { my $fn=shift; @@ -263,7 +265,6 @@ ENDDOCUMENT # ---------------------------------------------------------------- Make buttons sub buttons { - if ($ENV{'form.forceselect'}) { return ''; } my $adv=shift; my $output='
'; if ($adv==1) { @@ -539,7 +540,9 @@ sub smpedt { # ------------------------------------------------------------ Assemble windows my $idx=-1; - my $importwindow=join("\n",map { + my $importwindow= + ''. + join("\n",map { $idx++; if ($_) { my ($name,$url)=split(/\=/,$_); @@ -551,7 +554,9 @@ sub smpedt { } split(/\&/,$importdetail)); $idx=0; - my $targetwindow=join("\n",map { + my $targetwindow= + ''. + join("\n",map { my ($name,$url)=split(/\:/,$resources[$_]); unless ($name) { $name=(split(/\//,$url))[-1]; } unless ($name) { $name='EMPTY'; } @@ -692,6 +697,7 @@ function idxcheck(mode) { $buttons $errtext +

$url

@@ -765,41 +771,7 @@ ENDNODIR sub viewmap { my ($r,$url,$adv,$errtext)=@_; - $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 - } + $r->print(''.&buttons($adv)); if ($errtext) { $r->print($errtext.'
'); } @@ -807,31 +779,17 @@ ENDSELECT 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(''); } - if ($ENV{'form.forceselect'}) { - $r->print(''); - } else { - $r->print('
'); - } + $r->print('
'); } } $r->print(''); @@ -845,9 +803,6 @@ 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);