--- loncom/interface/lonindexer.pm 2004/05/11 23:27:35 1.107 +++ loncom/interface/lonindexer.pm 2004/05/18 15:53:58 1.108 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.107 2004/05/11 23:27:35 albertel Exp $ +# $Id: lonindexer.pm,v 1.108 2004/05/18 15:53:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -130,14 +130,20 @@ sub handler { } #Hijack lonindexer to verify a title and be close down. if ($ENV{'form.launch'} eq '2') { - #$r->content_type('text/html'); - my $verify_title = &Apache::lonnet::gettitle($ENV{'form.acts'}); - $r->print(<content_type('text/html'); + my $extra=''; + if (defined($ENV{'form.titleelement'})) { + my $verify_title = &Apache::lonnet::gettitle($ENV{'form.acts'}); + &Apache::lonnet::logthis("Hrrm $ENV{'form.acts'} -- $verify_title"); + $verify_title=~s/'/\\'/g; + $extra='window.opener.document.forms["'.$ENV{'form.form'}.'"].elements["'.$ENV{'form.titleelement'}.'"].value=\''.$verify_title.'\';'; + } + $r->print(< @@ -145,7 +151,7 @@ sub handler { ENDSUBM - return OK; + return OK; } # -------------------- refresh environment with user database values (in %hash) @@ -227,21 +233,13 @@ END $location .= "mode=".$mode."&"; $location .= "acts="; $catalogmodefunctions=<<"END"; -function select_data(title,url) { - changeTitle(title); +function select_data(url) { changeURL(url); self.close(); } function select_group() { window.location="$location"+document.forms.fileattr.acts.value; } -function changeTitle(val) { - if (opener.inf) { - if (opener.inf.document.forms.resinfo.elements.t) { - opener.inf.document.forms.resinfo.elements.t.value=val; - } - } -} function changeURL(val) { if (opener.inf) { if (opener.inf.document.forms.resinfo.elements.u) { @@ -255,8 +253,8 @@ END $location .= "form=$form&element=$element&mode=edit&acts="; $catalogmodefunctions=<&"'); - $titleesc=~s/\'/\\'/; #' (clean up this spare quote) $r->print(""); + $filelink,"')\">"); $r->print("". "\n"); $r->print(""); } elsif ($ENV{'form.catalogmode'} eq 'groupimport') { - $title=$listname; - $title = &Apache::lonnet::metadata($filelink,'title') - if ($metafile == 1); - $title=$listname unless $title; - my $titleesc=&HTML::Entities::encode($title,'<>&"'); $r->print("
\n"); $r->print("\n"); $r->print("
\n"); $r->print(""); $hash{"pre_${fnum}_link"}=$filelink; - $hash{"pre_${fnum}_title"}=$titleesc; $fnum++; } # Form to open or close sequences