Diff for /loncom/interface/lonparmset.pm between versions 1.301 and 1.306

version 1.301, 2006/05/09 20:25:06 version 1.306, 2006/05/16 20:43:57
Line 63  use Apache::lonhomework; Line 63  use Apache::lonhomework;
 use Apache::lonxml;  use Apache::lonxml;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonnavmaps;  use Apache::lonnavmaps;
   use Apache::lonrss;
   
 # --- Caches local to lonparmset  # --- Caches local to lonparmset
   
Line 90  Inputs:  $what - a parameter spec (inclu Line 91  Inputs:  $what - a parameter spec (inclu
   
 Returns:  A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 14 possible levels  Returns:  A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 14 possible levels
   
 14 - General Course  14- General Course
 13 - Map or Folder level in course  13- Map or Folder level in course
 12- resource default  12- resource default
 11- map default  11- map default
 10 - resource level in course  10- resource level in course
 9 - General for section  9 - General for section
 8 - Map or Folder level for section  8 - Map or Folder level for section
 7 - resource level in section  7 - resource level in section
Line 125  sub parmval_by_symb { Line 126  sub parmval_by_symb {
     my @outpar=();      my @outpar=();
 # ----------------------------------------------------- Cascading lookup scheme  # ----------------------------------------------------- Cascading lookup scheme
     my $map=(&Apache::lonnet::decode_symb($symb))[0];          my $map=(&Apache::lonnet::decode_symb($symb))[0];    
       $map = &Apache::lonnet::deversion($map);
   
     my $symbparm=$symb.'.'.$what;      my $symbparm=$symb.'.'.$what;
     my $mapparm=$map.'___(all).'.$what;      my $mapparm=$map.'___(all).'.$what;
Line 403  sub storeparm_by_symb_inner { Line 405  sub storeparm_by_symb_inner {
 # ---------------------------------------------------------- Construct prefixes  # ---------------------------------------------------------- Construct prefixes
     $spnam=~s/\_([^\_]+)$/\.$1/;      $spnam=~s/\_([^\_]+)$/\.$1/;
     my $map=(&Apache::lonnet::decode_symb($symb))[0];          my $map=(&Apache::lonnet::decode_symb($symb))[0];    
       $map = &Apache::lonnet::deversion($map);
   
     my $symbparm=$symb.'.'.$spnam;      my $symbparm=$symb.'.'.$spnam;
     my $mapparm=$map.'___(all).'.$spnam;      my $mapparm=$map.'___(all).'.$spnam;
   
Line 1508  sub assessparms { Line 1512  sub assessparms {
             @usersgroups = &Apache::lonnet::get_users_groups(              @usersgroups = &Apache::lonnet::get_users_groups(
                                        $udom,$uname,$env{'request.course.id'});                                         $udom,$uname,$env{'request.course.id'});
             if (@usersgroups > 0) {              if (@usersgroups > 0) {
                 unless (grep/^\Q$cgroup\E$/,@usersgroups) {                  unless (grep(/^\Q$cgroup\E$/,@usersgroups)) {
                     $cgroup = $usersgroups[0];                      $cgroup = $usersgroups[0];
                 }                  }
             }              }
Line 1926  ENDMAPONE Line 1930  ENDMAPONE
             }              }
                           
             if ($csec) {$r->print(&mt("Section")."<font color=\"red\"> <i>$csec</i></font>\n")};              if ($csec) {$r->print(&mt("Section")."<font color=\"red\"> <i>$csec</i></font>\n")};
             if ($cgroup) {$r->print(&mt("Group")."<font color=\"red\"> <i>$csec</i></font>\n")};              if ($cgroup) {$r->print(&mt("Group")."<font color=\"red\"> <i>$cgroup</i></font>\n")};
             $r->print("</h4>\n");              $r->print("</h4>\n");
 #---------------------------------------------------------------- print table  #---------------------------------------------------------------- print table
             $r->print('<p><table border="2">');              $r->print('<p><table border="2">');
Line 2073  sub crsenv { Line 2077  sub crsenv {
     }      }
 # ------------------------- Re-init course environment entries for this session  # ------------------------- Re-init course environment entries for this session
   
     &Apache::lonnet::coursedescription($env{'request.course.id'}      &Apache::lonnet::coursedescription($env{'request.course.id'},
        {'freshen_cache' => 1});         {'freshen_cache' => 1});
   
 # -------------------------------------------------------- Get parameters again  # -------------------------------------------------------- Get parameters again
Line 3305  sub components { Line 3309  sub components {
  $issection='';   $issection='';
     }      }
     my $realm='<font color="red">'.&mt('All Resources').'</font>';      my $realm='<font color="red">'.&mt('All Resources').'</font>';
       my $realmdescription=&mt('all resources'); 
     if ($middle=~/^(.+)\_\_\_\(all\)$/) {      if ($middle=~/^(.+)\_\_\_\(all\)$/) {
  $realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><font color="#aaaaaa" size="-2">('.$1.')</font></font>';   $realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><font color="#aaaaaa" size="-2">('.$1.')</font></font>';
     } elsif ($middle) {    $realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1);
      } elsif ($middle) {
  my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);   my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
  $realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><font color="#aaaaaa" size="-2">('.$url.' in '.$map.' id: '.$id.')</font></font>';   $realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><font color="#aaaaaa" size="-2">('.$url.' in '.$map.' id: '.$id.')</font></font>';
    $realmdescription=&mt('resource').' '.&Apache::lonnet::gettitle($middle);
     }      }
     my $what=$part.'.'.$name;      my $what=$part.'.'.$name;
     return ($realm,$section,$name,$part,$typeflag,      return ($realm,$section,$name,$part,$typeflag,
     $what,$middle,$uname,$udom,$issection);      $what,$middle,$uname,$udom,$issection,$realmdescription);
 }  }
   
 sub standard_parameter_names {  sub standard_parameter_names {
Line 3379  sub parm_change_log { Line 3386  sub parm_change_log {
  my %istype=();   my %istype=();
  foreach my $changed (reverse(sort(@changes))) {   foreach my $changed (reverse(sort(@changes))) {
             my $value=$parmlog{$id}{'logentry'}->{$changed};              my $value=$parmlog{$id}{'logentry'}->{$changed};
             my ($realm,$section,$parmname,$part,$typeflag,$what,$middle,$uname,$udom,$issection)=              my ($realm,$section,$parmname,$part,$typeflag,$what,$middle,$uname,$udom,$issection,$realmdescription)=
  &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'});   &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'});
     if ($typeflag) { $istype{$parmname}=$value; }      if ($typeflag) { $istype{$parmname}=$value; }
     if ($makenewrow) { $r->print($row_start); } else { $makenewrow=1; }      if ($makenewrow) { $r->print($row_start); } else { $makenewrow=1; }
Line 3409  sub parm_change_log { Line 3416  sub parm_change_log {
     }      }
     $r->print('</td>');      $r->print('</td>');
     if ($stillactive) {      if ($stillactive) {
    my $title=&mt('Changed [_1]',&standard_parameter_names($parmname));
                   my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription,
       (&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value));
  if (($uname) && ($udom)) {   if (($uname) && ($udom)) {
     $r->print('<td>Notify Link</td>');      $r->print('<td>'.
         &Apache::loncommon::messagewrapper('Notify User',$uname,$udom,$title,$description).
         '</td>');
  } else {   } else {
     $r->print('<td>Blog Link</td>');      $r->print('<td>'.
         &Apache::lonrss::course_blog_link($id,$title,$description).
         '</td>');
  }   }
     } else {      } else {
  $r->print('<td>&nbsp;</td>');   $r->print('<td>&nbsp;</td>');

Removed from v.1.301  
changed lines
  Added in v.1.306


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>