Diff for /loncom/interface/loncommon.pm between versions 1.692.2.12 and 1.695

version 1.692.2.12, 2009/01/12 04:39:30 version 1.695, 2008/11/28 14:36:50
Line 943  ENDTEMPLATE Line 943  ENDTEMPLATE
 # This is a quicky function for Latex cheatsheet editing, since it   # This is a quicky function for Latex cheatsheet editing, since it 
 # appears in at least four places  # appears in at least four places
 sub helpLatexCheatsheet {  sub helpLatexCheatsheet {
     my ($topic,$text,$not_author) = @_;      my $other = shift;
     my $out;  
     my $addOther = '';      my $addOther = '';
     if ($topic) {      if ($other) {
  $addOther = Apache::loncommon::help_open_topic($topic,$text,   $addOther = Apache::loncommon::help_open_topic($other, shift,
        undef, undef, 600).         undef, undef, 600) .
  '</td><td>';     '</td><td>';
     }      }
     $out = '<table><tr><td>'.      return '<table><tr><td>'.
    $addOther.   $addOther .
    &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),   &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),
        undef,undef,600).      undef,undef,600)
    '</td><td>'.   .'</td><td>'.
    &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),   &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),
        undef,undef,600).      undef,undef,600)
    '</td>';   .'</td><td>'.
     unless ($not_author) {   &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),
         $out .= '<td>'.                                      undef,undef,600)
         &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),   .'</td></tr></table>';
                                             undef,undef,600).  
         '</td>';  
     }  
     $out .= '</tr></table>';  
     return $out;  
 }  }
   
 sub general_help {  sub general_help {
Line 2723  sub flush_email_cache { Line 2717  sub flush_email_cache {
     &Apache::lonnet::devalidate_cache_new('emailscache',$id);      &Apache::lonnet::devalidate_cache_new('emailscache',$id);
 }  }
   
 # -------------------------------------------------------------------- getlangs  
   
 =pod  
   
 =item * &getlangs($uname,$udom)  
   
 Gets a user's language preference and returns it as a hash with key:  
 language.  
   
 =cut  
   
 sub getlangs {  
     my ($uname,$udom) = @_;  
     if (!$udom)  { $udom =$env{'user.domain'}; }  
     if (!$uname) { $uname=$env{'user.name'};   }  
     my $id=$uname.':'.$udom;  
     my ($langs,$cached)=&Apache::lonnet::is_cached_new('userlangs',$id);  
     if ($cached) {  
         return %{$langs};  
     } else {  
         my %loadlangs=&Apache::lonnet::get('environment',['languages'],  
                                            $udom,$uname);  
         &Apache::lonnet::do_cache_new('userlangs',$id,\%loadlangs);  
         return %loadlangs;  
     }  
 }  
   
 sub flush_langs_cache {  
     my ($uname,$udom)=@_;  
     if (!$udom)  { $udom =$env{'user.domain'}; }  
     if (!$uname) { $uname=$env{'user.name'};   }  
     return if ($udom eq 'public' && $uname eq 'public');  
     my $id=$uname.':'.$udom;  
     &Apache::lonnet::devalidate_cache_new('userlangs',$id);  
 }  
   
 # ------------------------------------------------------------------ Screenname  # ------------------------------------------------------------------ Screenname
   
 =pod  =pod
Line 3213  sub relative_to_absolute { Line 3171  sub relative_to_absolute {
     }      }
     $thisdir=~s-/[^/]*$--;      $thisdir=~s-/[^/]*$--;
     foreach my $link (@rlinks) {      foreach my $link (@rlinks) {
  unless (($link=~/^https?\:\/\//i) ||   unless (($link=~/^http:\/\//i) ||
  ($link=~/^\//) ||   ($link=~/^\//) ||
  ($link=~/^javascript:/i) ||   ($link=~/^javascript:/i) ||
  ($link=~/^mailto:/i) ||   ($link=~/^mailto:/i) ||
Line 3922  sub get_domainconf { Line 3880  sub get_domainconf {
         if (ref($domconfig{'login'}) eq 'HASH') {          if (ref($domconfig{'login'}) eq 'HASH') {
             if (keys(%{$domconfig{'login'}})) {              if (keys(%{$domconfig{'login'}})) {
                 foreach my $key (keys(%{$domconfig{'login'}})) {                  foreach my $key (keys(%{$domconfig{'login'}})) {
                     if (ref($domconfig{'login'}{$key}) eq 'HASH') {                      $designhash{$udom.'.login.'.$key}=$domconfig{'login'}{$key};
                         foreach my $img (keys(%{$domconfig{'login'}{$key}})) {  
                             $designhash{$udom.'.login.'.$key.'_'.$img} =  
                                 $domconfig{'login'}{$key}{$img};  
                         }  
                     } else {  
                         $designhash{$udom.'.login.'.$key}=$domconfig{'login'}{$key};  
                     }  
                 }                  }
             } else {              } else {
                 $legacy{'login'} = 1;                  $legacy{'login'} = 1;
Line 4640  table#LC_mainmenu td.LC_mainmenu_column Line 4591  table#LC_mainmenu td.LC_mainmenu_column
 .LC_menubuttons_link {  .LC_menubuttons_link {
   text-decoration: none;    text-decoration: none;
 }  }
 /*2008--9-5: new menu style sheet.Changed category*/  #2008--9-5: new menu style sheet.Changed category
 .LC_menubuttons_category {  .LC_menubuttons_category {
   color: $font;    color: $font;
   background: $pgbg;    background: $pgbg;
Line 4711  td.LC_menubuttons_img { Line 4662  td.LC_menubuttons_img {
   font-size: smaller;    font-size: smaller;
 }  }
   
 .LC_mail_functions {  
     font-weight: bold;  
 }  
   
 table.LC_aboutme_port {  table.LC_aboutme_port {
   border: 0px;    border: 0px;
   border-collapse: collapse;    border-collapse: collapse;
Line 4747  table.LC_prior_tries tr th { Line 4694  table.LC_prior_tries tr th {
   background-color: $data_table_head;    background-color: $data_table_head;
   font-size: smaller;    font-size: smaller;
 }  }
 table.LC_data_table tr.LC_info_row > td {  
   background-color: #CCC;  
   font-weight: bold;  
   text-align: left;  
 }  
 table.LC_data_table tr.LC_odd_row > td,   table.LC_data_table tr.LC_odd_row > td, 
 table.LC_aboutme_port tr td {  table.LC_aboutme_port tr td {
   background-color: $data_table_light;    background-color: $data_table_light;
Line 5528  fieldset#LC_mainmenu_fieldset { Line 5470  fieldset#LC_mainmenu_fieldset {
   margin:0px 10px 10px 0px;    margin:0px 10px 10px 0px;
   
 }  }
   /* ---- Remove when done ----
   # The following styles is part of the redesign of LON-CAPA and are
   # subject to change during this project.
   # Don't rely on their current functionality as they might be 
   # changed or removed.
   # --------------------------*/
   
   
   body {
    font-family: Tahoma, Arial,Helvetica,sans-serif;
    font-size: 0.85em;
    line-height: 130%;
    color: RGB(45, 45, 45);
   }
   
   a:link,a:visited {
    /*color: RGB(0, 118, 127);*/
    /*text-decoration: underline;*/
   }
   
   a:hover{
    text-decoration:none;
   }
   /*a:hover,
   UL.smallMenu A:hover,
   UL.MenuBreadcrumbs A:hover,
   UL#TabMainMenuContent A:hover{
    color: rgb(200, 10, 50);
   }*/
   
   h1 { 
    padding:5px 10px 5px 20px;
    line-height:130%;
   }
   h2,h4,h6 {
    /*color: RGB(0, 118, 127);*/
   }
   h2,h3,h4,h5,h6
   {
   margin:5px 0px 5px 0px;
   line-height:130%;
   }
   
   .right {
    text-align: right;
   }
   
   .center {
    text-align: center;
   }
   
   .left {
    text-align: left;
   }
   
   
   .HeadRight {
    text-align: right;
    float: right;
    margin: 0px;
    padding: 0px;
    right:0;
           position:absolute;
   }
   
   img {
   /* border: 0px; */
   }
   
   .personalBgColor {
    background: RGB(237, 239, 0) url(images/headHighlight.png) repeat-y left top;
   }
   
   p {
    padding: 10px;
   }
   DL,UL,Div,Fieldset {
    /*margin: 10px;*/
    overflow:hidden;
   }
   OL.smallMenu {
    margin: 0px 0px 0px 0px;
   }
   
   OL.smallMenu li {
    display: inline;
    padding: 5px 5px 0px 10px;
    vertical-align: top;
   }
   
   OL.smallMenu li img {
    vertical-align: bottom;
   }
   
   OL.smallMenu A {
    font-size: 90%;
    color: RGB(80, 80, 80);
    text-decoration: none;
   }
   
   OL#TabMainMenuContent {
   
    margin: 0px 0px 10px 0px;
    padding: 0px;
   }
   
   OL#TabMainMenuContent LI {
    display: inline;
    vertical-align: bottom;
    border-bottom: solid 1px RGB(175, 175, 175);
    border-right: solid 1px RGB(175, 175, 175);
    padding: 5px 15px 5px 15px;
    margin-right:4px;
    line-height: 140%;
    font-weight: bold;
    overflow:hidden;
    background: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left top;
   }
   
 div.LC_createcourse {  OL#TabMainMenuContent LI A {
     margin: 10px 10px 10px 10px;   color: RGB(47, 47, 47);
    text-decoration: none;
 }  }
   
   OL#TabMainMenuContent DIV.columnSection {
    margin-bottom: 0px;
   }
   
   OL#MenuBreadcrumbs {
    border-top: solid 1px RGB(255, 255, 255);
    height: 20px;
    line-height: 20px;
    vertical-align: bottom;
    margin: 0px 0px 30px 0px;
    padding-left: 10px;
    list-style-position: inside;
    background: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left
    top;
   }
   
   OL#MenuBreadcrumbs li {
    background: url(images/pfeil_white.png) no-repeat left center;
    display: inline;
    padding: 0px 0px 0px 10px;
    vertical-align: bottom;
    overflow:hidden;
   }
   
   OL#MenuBreadcrumbs LI A {
    text-decoration: none;
    font-size:90%;
   }
   
   h4.hcell {
    padding: 3px 10px 3px 10px;
    margin: 0px;
    background: RGB(0, 118, 127);
    color: white;
    border: outset 1px;
   }
   
   DIV.DivContentBoxSpecial
   {
    border: solid 1px RGB(100, 100, 100);
   }
   
   FIELDSET
   {
    /*width:78%;*/
   }
   DIV.DivContentBox,
   DIV.DivContentBoxSpecial {
    width: 80%;
    margin:10px;
   }
   
   FIELDSET legend,DL DT {
    font-weight: bold;
    font-size: 110%;
    /*padding-left: 0px;*/
   /* margin-left: 0px;*/
   }
   
   DIV.DivImportant {
    background: url(images/important.png) no-repeat center top;
    padding: 100px 10px 10px 10px;
    width: 200px;
    border: double 4px RGB(200, 200, 200);
   }
   
   
   
   DL.ListStyleClean DT {
    padding-right: 5px;
    display: table-header-group;
   }
   
   DL.ListStyleClean DD {
    display: table-row;
   }
   
   .ListStyleClean,
   .ListStyleSimple,
   .ListStyleNormal,
   .ListStyleNormal_Border,
   .ListStyleSpecial
    {
    /*display:block; */
    width: 400px;
    list-style-position: inside;
    list-style-type: none;
    overflow: hidden;
    padding: 0px;
   }
   
   .ListStyleClean li,
   .ListStyleSimple li,
   .ListStyleSimple DD,
   .ListStyleNormal li,
   .ListStyleNormal DD,
   .ListStyleSpecial li,
   .ListStyleSpecial DD
    {
    margin: 0px;
    padding: 5px 5px 5px 10px;
    clear: both;
    /*display:block;*/
   }
   
   .ListStyleClean LI,
   .ListStyleClean DD {
    padding-top: 0px;
    padding-bottom: 0px;
   }
   
   .ListStyleSimple DD,
   .ListStyleSimple LI{
    border-bottom: solid 1px RGB(150, 150, 150);
   }
   
   .ListStyleSpecial LI,
   .ListStyleSpecial DD {
    list-style-type: none;
    background-color: RGB(220, 220, 220);
    margin-bottom: 4px;
   }
   
   table.SimpleTable *{
    padding:10px;
    }
   
   table.SimpleTable td {
    vertical-align:top;
    border:solid 1px RGB(210,210,210);
   }
   table.SimpleTable thead{
    background:rgb(210,210,210);
   }
   
   DIV.columnSection {
    display: block;
    clear: both;
    overflow: hidden;
    margin:0px;
   }
   
   DIV.columnSection>* {
    float: left;
    margin: 10px 20px 10px 0px;
    overflow:hidden;
   }
   
   DIV.columnSection>FIELDSET,
   DIV.columnSection>DIV.DivContentBox,
   DIV.columnSection>DIV.DivContentBoxSpecial
    {
    width: 480px;
   
   }
   
   .LC_loginpage_container {
    text-align:left;
    margin : 0 auto;
    width:65%;
    padding: 10px;
    height: auto;
    background-color:#FFFFFF;
    border:1px solid #CCCCCC;
   }
   
   
   .LC_loginpage_loginContainer {
    float:left;
    width:60%;
   }
   
   .LC_loginpage_loginInfo {
    margin-top:20px;
    margin-left:20px;
    float:left;
    width:30%;
    border:1px solid #CCCCCC;
    padding:10px;
   }
   
   .LC_loginpage_space {
    clear:both;
    margin-bottom:20px;
    border-bottom: 1px solid #CCCCCC;
   }
   
   .LC_loginpage_fieldset{
    border: 1px solid #CCCCCC;
    margin: 0 auto;
   }
   
   .LC_loginpage_legend{
    padding: 2px;
    margin: 0px;
    font-size:14px;
    font-weight:bold;
   }
   
   
   
 END  END
 }  }
   
Line 6563  sub default_quota { Line 6825  sub default_quota {
         if ($inststatus ne '') {          if ($inststatus ne '') {
             my @statuses = split(/:/,$inststatus);              my @statuses = split(/:/,$inststatus);
             foreach my $item (@statuses) {              foreach my $item (@statuses) {
                 if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {                  if ($quotahash{'quotas'}{$item} ne '') {
                     if ($quotahash{'quotas'}{'defaultquota'}{$item} ne '') {                      if ($defquota eq '') {
                         if ($defquota eq '') {                          $defquota = $quotahash{'quotas'}{$item};
                             $defquota = $quotahash{'quotas'}{'defaultquota'}{$item};                          $settingstatus = $item;
                             $settingstatus = $item;                      } elsif ($quotahash{'quotas'}{$item} > $defquota) {
                         } elsif ($quotahash{'quotas'}{'defaultquota'}{$item} > $defquota) {                          $defquota = $quotahash{'quotas'}{$item};
                             $defquota = $quotahash{'quotas'}{'defaultquota'}{$item};                          $settingstatus = $item;
                             $settingstatus = $item;  
                         }  
                     }  
                 } else {  
                     if ($quotahash{'quotas'}{$item} ne '') {  
                         if ($defquota eq '') {  
                             $defquota = $quotahash{'quotas'}{$item};  
                             $settingstatus = $item;  
                         } elsif ($quotahash{'quotas'}{$item} > $defquota) {  
                             $defquota = $quotahash{'quotas'}{$item};  
                             $settingstatus = $item;  
                         }  
                     }                      }
                 }                  }
             }              }
         }          }
         if ($defquota eq '') {          if ($defquota eq '') {
             if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {              $defquota = $quotahash{'quotas'}{'default'};
                 $defquota = $quotahash{'quotas'}{'defaultquota'}{'default'};  
             } else {  
                 $defquota = $quotahash{'quotas'}{'default'};  
             }  
             $settingstatus = 'default';              $settingstatus = 'default';
         }          }
     } else {      } else {
Line 9072  sub construct_course { Line 9318  sub construct_course {
                    'policy.email',                     'policy.email',
                    'comment.email',                     'comment.email',
                    'pch.users.denied',                     'pch.users.denied',
                    'plc.users.denied',                     'plc.users.denied'],
                    'hidefromcat',  
                    'categories'],  
                    $$crsudom,$$crsunum);                     $$crsudom,$$crsunum);
     }      }
   
Line 9532  sub init_user_environment { Line 9776  sub init_user_environment {
     }      }
  }   }
   
         foreach my $tool ('aboutme','blog','portfolio') {  
             $userenv{'availabletools.'.$tool} =   
                 &Apache::lonnet::usertools_access($username,$domain,$tool,'reload');  
         }  
   
  $env{'user.environment'} = "$lonids/$cookie.id";   $env{'user.environment'} = "$lonids/$cookie.id";
   
  if (tie(my %disk_env,'GDBM_File',"$lonids/$cookie.id",   if (tie(my %disk_env,'GDBM_File',"$lonids/$cookie.id",
Line 9575  sub _add_to_env { Line 9814  sub _add_to_env {
 # --- Get the symbolic name of a problem and the url  # --- Get the symbolic name of a problem and the url
 sub get_symb {  sub get_symb {
     my ($request,$silent) = @_;      my ($request,$silent) = @_;
     (my $url=$env{'form.url'}) =~ s-^https?\://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;      (my $url=$env{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
     my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url)));      my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url)));
     if ($symb eq '') {      if ($symb eq '') {
         if (!$silent) {          if (!$silent) {
Line 9602  sub get_annotation { Line 9841  sub get_annotation {
 }  }
   
 sub clean_symb {  sub clean_symb {
     my ($symb,$delete_enc) = @_;      my ($symb) = @_;
   
     &Apache::lonenc::check_decrypt(\$symb);      &Apache::lonenc::check_decrypt(\$symb);
     my $enc = $env{'request.enc'};      my $enc = $env{'request.enc'};
     if ($delete_enc) {      delete($env{'request.enc'});
         delete($env{'request.enc'});  
     }  
   
     return ($symb,$enc);      return ($symb,$enc);
 }  }

Removed from v.1.692.2.12  
changed lines
  Added in v.1.695


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