--- rat/lonsequence.pm 2006/04/04 15:32:12 1.26 +++ rat/lonsequence.pm 2007/01/16 21:19:11 1.30 @@ -2,7 +2,7 @@ # # Sequence Handler # -# $Id: lonsequence.pm,v 1.26 2006/04/04 15:32:12 albertel Exp $ +# $Id: lonsequence.pm,v 1.30 2007/01/16 21:19:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,8 +26,6 @@ # # http://www.lon-capa.org/ # -# (Handler to resolve ambiguous file locations -# package Apache::lonsequence; @@ -35,11 +33,11 @@ use strict; use Apache::lonnet; use Apache::Constants qw(:common :http REDIRECT); use GDBM_File; -use Apache::lonratedt; -use Apache::lonratsrv; -use Apache::lonpageflip; -use Apache::loncommon; +use LONCAPA::map(); +use Apache::lonpageflip(); +use Apache::loncommon(); use Apache::lonlocal; +use HTML::Entities(); my %selhash; my $successtied; @@ -50,7 +48,7 @@ sub attemptread { my $fn=shift; &Apache::lonnet::repcopy($fn); if (-e $fn) { - return &Apache::lonratedt::attemptread($fn); + return &LONCAPA::map::attemptread($fn); } else { return (); } @@ -60,7 +58,7 @@ sub mapread { my $fn=shift; &Apache::lonnet::repcopy($fn); if (-e $fn) { - return &Apache::lonratedt::mapread($fn,''); + return &LONCAPA::map::mapread($fn,''); } else { return (); } @@ -108,7 +106,7 @@ onClick="javascript:select_group()"> ENDSELECT my $diropendb = - "/home/httpd/perl/tmp/$env{'user.domain'}\_$env{'user.name'}_groupsec.db"; + "/home/httpd/perl/tmp/$env{'user.domain'}\_$env{'user.name'}_sel_res.db"; if (tie(%selhash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { if ($env{'form.launch'} eq '1') { &start_fresh_session(); @@ -116,7 +114,7 @@ ENDSELECT $successtied=1; # - Evaluate actions from previous page (both cumulatively and chronologically) - if ($env{'form.catalogmode'} eq 'groupimport') { + if ($env{'form.catalogmode'} eq 'import') { my $acts=$env{'form.acts'}; my @Acts=split(/b/,$acts); my %ahash; @@ -172,10 +170,15 @@ ENDSELECT $r->print('
'); } my ($title,$url)=split(/\:/,$_); - $title=~s/\&colon\;/\:/g; - $url=~s/\&colon\;/\:/g; - unless ($title) { $title=(split(/\//,$url))[-1] }; - unless ($title) { $title=''.&mt('Empty').''; } + $title = &LONCAPA::map::qtescape($title); + unless ($title) { $title=(split(/\//,$url))[-1] }; + my $enc_title = &HTML::Entities::encode($title,'\'"<>&'); + unless ($title) { + $title=''.&mt('Empty').''; + $enc_title = &mt('Empty'); + } + $url = &LONCAPA::map::qtescape($url); + my $enc_url = &HTML::Entities::encode($url,'\'"<>&'); if ($url) { if ($successtied) { my $checked=''; @@ -184,16 +187,17 @@ ENDSELECT } $selhash{"pre_${idx}_link"}=$url; $selhash{"pre_${idx}_title"}=$title; - + + $url = &HTML::Entities::encode($url, '\'"<>&'); $r->print(< - +value='$enc_url' onClick='javascript:queue("form$idx")'$checked /> + ENDCHECKBOX } - $r->print(''); + $r->print(''); } - $r->print(&Apache::lonratsrv::qtescape($title)); + $r->print($enc_title); if ($url) { $r->print(''); } if ($successtied) { $r->print('');