--- loncom/interface/loncommon.pm 2006/12/11 03:43:15 1.490 +++ loncom/interface/loncommon.pm 2007/01/15 18:04:12 1.500 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.490 2006/12/11 03:43:15 raeburn Exp $ +# $Id: loncommon.pm,v 1.500 2007/01/15 18:04:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,6 +59,7 @@ use Apache::lonnet; use GDBM_File; use POSIX qw(strftime mktime); use Apache::lonmenu(); +use Apache::lonenc(); use Apache::lonlocal; use HTML::Entities; use Apache::lonhtmlcommon(); @@ -515,8 +516,8 @@ function setSect(sectionlist) { sub selectcourse_link { my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_; - return "".&mt('Select [_1]',$selecttype).""; + return "".&mt('Select Course').""; } sub check_uncheck_jscript { @@ -2690,7 +2691,9 @@ sub get_student_answers { } $moreenv{'grade_target'}='answer'; %moreenv=(%form,%moreenv); - my $userview=&Apache::lonnet::ssi('/res/'.$feedurl,%moreenv); + $feedurl = &Apache::lonnet::clutter($feedurl); + &Apache::lonenc::check_encrypt(\$feedurl); + my $userview=&Apache::lonnet::ssi($feedurl,%moreenv); return $userview; } @@ -3009,7 +3012,7 @@ sub blockcheck { } # if they have the evb priv and are currently not playing student next if (($no_ownblock) && - ($env{'request.role'} !~ m{^st\./$cdom/$cnum})); + ($env{'request.role'} !~ m{^st\./\Q$cdom\E/\Q$cnum\E})); next if ($no_userblock); # Retrieve blocking times and identity of blocker for course @@ -3037,11 +3040,11 @@ sub get_blocks { if ($blocks->{$activity} eq 'on') { push(@{$$setters{$course}{'staff'}},[$staff_name,$staff_dom]); push(@{$$setters{$course}{'times'}}, [$start,$end]); - if ( ($startblock == 0) || ($startblock > $1) ) { - $startblock = $1; + if ( ($startblock == 0) || ($startblock > $start) ) { + $startblock = $start; } - if ( ($endblock == 0) || ($endblock < $2) ) { - $endblock = $2; + if ( ($endblock == 0) || ($endblock < $end) ) { + $endblock = $end; } } } @@ -3341,7 +3344,7 @@ sub bodytag { my ($role,$realm) = split(/\./,$env{'request.role'},2); if ($role eq 'ca') { my ($rdom,$rname) = ($realm =~ m{^/($match_domain)/($match_username)$}); - $realm = &plainname($rname,$rdom).':'.$rdom; + $realm = &plainname($rname,$rdom); } # realm if ($env{'request.course.id'}) { @@ -3925,6 +3928,11 @@ table.LC_mail_list tr.LC_mail_other { table.LC_mail_list tr.LC_mail_other:hover { background-color: $mail_other_hover; } +table.LC_mail_list tr.LC_mail_even { +} +table.LC_mail_list tr.LC_mail_odd { +} + table#LC_portfolio_actions { width: auto; @@ -4468,6 +4476,11 @@ Inputs: $args - additional optio a html attribute frameset -> if true will start with a rather than + dicsussion -> if true will get discussion from + lonxml::xmlend + (you can pass the target and parser arguments + through optional 'target' and 'parser' args + to this routine) =cut @@ -6064,16 +6077,19 @@ Returns: both routines return nothing ####################################################### ####################################################### sub store_course_settings { + return &store_settings($env{'request.course.id'},@_); +} + +sub store_settings { # save to the environment # appenv the same items, just to be safe - my $courseid = $env{'request.course.id'}; my $udom = $env{'user.domain'}; my $uname = $env{'user.name'}; - my ($prefix,$Settings) = @_; + my ($context,$prefix,$Settings) = @_; my %SaveHash; my %AppHash; while (my ($setting,$type) = each(%$Settings)) { - my $basename = join('.','internal',$courseid,$prefix,$setting); + my $basename = join('.','internal',$context,$prefix,$setting); my $envname = 'environment.'.$basename; if (exists($env{'form.'.$setting})) { # Save this value away @@ -6113,11 +6129,14 @@ sub store_course_settings { } sub restore_course_settings { - my $courseid = $env{'request.course.id'}; - my ($prefix,$Settings) = @_; + return &restore_settings($env{'request.course.id'},@_); +} + +sub restore_settings { + my ($context,$prefix,$Settings) = @_; while (my ($setting,$type) = each(%$Settings)) { next if (exists($env{'form.'.$setting})); - my $envname = 'environment.internal.'.$courseid.'.'.$prefix. + my $envname = 'environment.internal.'.$context.'.'.$prefix. '.'.$setting; if (exists($env{$envname})) { if ($type eq 'scalar') {