Diff for /loncom/interface/loncommon.pm between versions 1.816 and 1.817

version 1.816, 2009/05/15 14:48:42 version 1.817, 2009/05/15 18:06:13
Line 4144  Returns: value of designparamter $which Line 4144  Returns: value of designparamter $which
 ##############################################  ##############################################
 sub designparm {  sub designparm {
     my ($which,$domain)=@_;      my ($which,$domain)=@_;
     if ($env{'browser.blackwhite'} eq 'on') {  
  if ($which=~/\.(font|alink|vlink|link|textcol)$/) {  
     return '#000000';  
  }  
  if ($which=~/\.(pgbg|sidebg|bgcol)$/) {  
     return '#FFFFFF';  
  }  
  if ($which=~/\.tabbg$/) {  
     return '#CCCCCC';  
  }  
     }  
     if (exists($env{'environment.color.'.$which})) {      if (exists($env{'environment.color.'.$which})) {
  return $env{'environment.color.'.$which};          return $env{'environment.color.'.$which};
     }      }
     $domain=&determinedomain($domain);      $domain=&determinedomain($domain);
     my %domdesign = &get_domainconf($domain);      my %domdesign = &get_domainconf($domain);
     my $output;      my $output;
     if ($domdesign{$domain.'.'.$which} ne '') {      if ($domdesign{$domain.'.'.$which} ne '') {
  $output = $domdesign{$domain.'.'.$which};          $output = $domdesign{$domain.'.'.$which};
     } else {      } else {
         $output = $defaultdesign{$which};          $output = $defaultdesign{$which};
     }      }
     if (($which =~ /^(student|coordinator|author|admin)\.img$/) ||      if (($which =~ /^(student|coordinator|author|admin)\.img$/) ||
         ($which =~ /login\.(img|logo|domlogo|login)/)) {          ($which =~ /login\.(img|logo|domlogo|login)/)) {
         if ($output =~ m{^/(adm|res)/}) {          if ($output =~ m{^/(adm|res)/}) {
     if ($output =~ m{^/res/}) {              if ($output =~ m{^/res/}) {
  my $local_name = &Apache::lonnet::filelocation('',$output);                  my $local_name = &Apache::lonnet::filelocation('',$output);
  &Apache::lonnet::repcopy($local_name);                  &Apache::lonnet::repcopy($local_name);
     }              }
             $output = &lonhttpdurl($output);              $output = &lonhttpdurl($output);
         }          }
     }      }
Line 4444  sub make_attr_string { Line 4433  sub make_attr_string {
  $attr_ref->{'style'}=$style.'; font-size: x-large;';   $attr_ref->{'style'}=$style.'; font-size: x-large;';
     }      }
   
     if ($env{'browser.blackwhite'} eq 'on') {  
  delete($attr_ref->{'font'});  
  delete($attr_ref->{'link'});  
  delete($attr_ref->{'alink'});  
  delete($attr_ref->{'vlink'});  
  delete($attr_ref->{'bgcolor'});  
  delete($attr_ref->{'background'});  
     }  
   
     my $attr_string;      my $attr_string;
     foreach my $attr (keys(%$attr_ref)) {      foreach my $attr (keys(%$attr_ref)) {
  $attr_string .= " $attr=\"".$attr_ref->{$attr}.'" ';   $attr_string .= " $attr=\"".$attr_ref->{$attr}.'" ';
Line 10226  sub escape_url { Line 10206  sub escape_url {
     return join('/',@urlslices).'/'.$lastitem;      return join('/',@urlslices).'/'.$lastitem;
 }  }
   
 # -------------------------------------------------------- Initliaze user login  # -------------------------------------------------------- Initialize user login
 sub init_user_environment {  sub init_user_environment {
     my ($r, $username, $domain, $authhost, $form, $args) = @_;      my ($r, $username, $domain, $authhost, $form, $args) = @_;
     my $lonids=$Apache::lonnet::perlvar{'lonIDsDir'};      my $lonids=$Apache::lonnet::perlvar{'lonIDsDir'};
Line 10280  sub init_user_environment { Line 10260  sub init_user_environment {
     my ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,      my ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,
         $clientunicode,$clientos) = &decode_user_agent($r);          $clientunicode,$clientos) = &decode_user_agent($r);
   
 # -------------------------------------- Any accessibility options to remember?  
     if (($form->{'interface'}) && ($form->{'remember'} eq 'true')) {  
  foreach my $option ('imagesuppress','appletsuppress',  
     'embedsuppress','fontenhance','blackwhite') {  
     if ($form->{$option} eq 'true') {  
  &Apache::lonnet::put('environment',{$option => 'on'},  
      $domain,$username);  
     } else {  
  &Apache::lonnet::del('environment',[$option],  
      $domain,$username);  
     }  
  }  
     }  
 # ------------------------------------------------------------- Get environment  # ------------------------------------------------------------- Get environment
   
     my %userenv = &Apache::lonnet::dump('environment',$domain,$username);      my %userenv = &Apache::lonnet::dump('environment',$domain,$username);
Line 10310  sub init_user_environment { Line 10277  sub init_user_environment {
     if ($userenv{'texengine'} eq 'ttm') { $clientmathml=1; }      if ($userenv{'texengine'} eq 'ttm') { $clientmathml=1; }
   
 # --------------- Do not trust query string to be put directly into environment  # --------------- Do not trust query string to be put directly into environment
     foreach my $option ('imagesuppress','appletsuppress',      foreach my $option ('interface','localpath','localres') {
  'embedsuppress','fontenhance','blackwhite',          $form->{$option}=~s/[\n\r\=]//gs;
  'interface','localpath','localres') {  
  $form->{$option}=~s/[\n\r\=]//gs;  
     }      }
 # --------------------------------------------------------- Write first profile  # --------------------------------------------------------- Write first profile
   
Line 10347  sub init_user_environment { Line 10312  sub init_user_environment {
     $form->{'interface'}=~s/\W//gs;      $form->{'interface'}=~s/\W//gs;
     $initial_env{"browser.interface"} = $form->{'interface'};      $initial_env{"browser.interface"} = $form->{'interface'};
     $env{'browser.interface'}=$form->{'interface'};      $env{'browser.interface'}=$form->{'interface'};
     foreach my $option ('imagesuppress','appletsuppress',  
  'embedsuppress','fontenhance','blackwhite') {  
  if (($form->{$option} eq 'true') ||  
     ($userenv{$option} eq 'on')) {  
     $initial_env{"browser.$option"} = "on";  
  }  
     }  
  }   }
   
         foreach my $tool ('aboutme','blog','portfolio') {          foreach my $tool ('aboutme','blog','portfolio') {

Removed from v.1.816  
changed lines
  Added in v.1.817


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