Diff for /loncom/interface/loncommon.pm between versions 1.815 and 1.850

version 1.815, 2009/05/15 09:33:22 version 1.850, 2009/07/06 15:29:31
Line 407  sub studentbrowser_javascript { Line 407  sub studentbrowser_javascript {
           ) { return ''; }              ) { return ''; }  
    return (<<'ENDSTDBRW');     return (<<'ENDSTDBRW');
 <script type="text/javascript" language="Javascript">  <script type="text/javascript" language="Javascript">
   // <![CDATA[
     var stdeditbrowser;      var stdeditbrowser;
     function openstdbrowser(formname,uname,udom,roleflag,ignorefilter,courseadvonly) {      function openstdbrowser(formname,uname,udom,roleflag,ignorefilter,courseadvonly) {
         var url = '/adm/pickstudent?';          var url = '/adm/pickstudent?';
Line 429  sub studentbrowser_javascript { Line 430  sub studentbrowser_javascript {
         stdeditbrowser = open(url,title,options,'1');          stdeditbrowser = open(url,title,options,'1');
         stdeditbrowser.focus();          stdeditbrowser.focus();
     }      }
   // ]]>
 </script>  </script>
 ENDSTDBRW  ENDSTDBRW
 }  }
Line 461  sub selectstudent_link { Line 463  sub selectstudent_link {
 sub authorbrowser_javascript {  sub authorbrowser_javascript {
     return <<"ENDAUTHORBRW";      return <<"ENDAUTHORBRW";
 <script type="text/javascript" language="JavaScript">  <script type="text/javascript" language="JavaScript">
   // <![CDATA[
 var stdeditbrowser;  var stdeditbrowser;
   
 function openauthorbrowser(formname,udom) {  function openauthorbrowser(formname,udom) {
Line 473  function openauthorbrowser(formname,udom Line 476  function openauthorbrowser(formname,udom
     stdeditbrowser.focus();      stdeditbrowser.focus();
 }  }
   
   // ]]>
 </script>  </script>
 ENDAUTHORBRW  ENDAUTHORBRW
 }  }
Line 482  sub coursebrowser_javascript { Line 486  sub coursebrowser_javascript {
     my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');      my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');
    my $output = '     my $output = '
 <script type="text/javascript" language="JavaScript">  <script type="text/javascript" language="JavaScript">
   // <![CDATA[
     var stdeditbrowser;'."\n";      var stdeditbrowser;'."\n";
    $output .= <<"ENDSTDBRW";     $output .= <<"ENDSTDBRW";
     function opencrsbrowser(formname,uname,udom,desc,extra_element,multflag,crstype) {      function opencrsbrowser(formname,uname,udom,desc,extra_element,multflag,crstype) {
Line 568  ENDSTDBRW Line 573  ENDSTDBRW
         $output .= &setsec_javascript($sec_element,$formname);          $output .= &setsec_javascript($sec_element,$formname);
     }      }
     $output .= '      $output .= '
   // ]]>
 </script>';  </script>';
     return $output;      return $output;
 }  }
Line 829  sub linked_select_forms { Line 835  sub linked_select_forms {
     # output the javascript to do the changing      # output the javascript to do the changing
     my $result = '';      my $result = '';
     $result.='<script type="text/javascript" language="JavaScript">'."\n";      $result.='<script type="text/javascript" language="JavaScript">'."\n";
       $result.="// <![CDATA[\n";
     $result.="var select2data = new Object();\n";      $result.="var select2data = new Object();\n";
     $" = '","';      $" = '","';
     my $debug = '';      my $debug = '';
Line 874  function select1_changed() { Line 881  function select1_changed() {
         }          }
     }      }
 }  }
   // ]]>
 </script>  </script>
 END  END
     # output the initial values for the selection lists      # output the initial values for the selection lists
Line 1027  sub update_help_link { Line 1035  sub update_help_link {
     my $banner_link = "/adm/helpmenu?page=banner&amp;topic=$topic&amp;component_help=$component_help&amp;faq=$faq&amp;bug=$bug&amp;origurl=$origurl&amp;stamp=$timestamp&amp;stayonpage=$stayOnPage";      my $banner_link = "/adm/helpmenu?page=banner&amp;topic=$topic&amp;component_help=$component_help&amp;faq=$faq&amp;bug=$bug&amp;origurl=$origurl&amp;stamp=$timestamp&amp;stayonpage=$stayOnPage";
     my $output .= <<"ENDOUTPUT";      my $output .= <<"ENDOUTPUT";
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 banner_link = '$banner_link';  banner_link = '$banner_link';
   // ]]>
 </script>  </script>
 ENDOUTPUT  ENDOUTPUT
     return $output;      return $output;
Line 1394  sub resize_textarea_js { Line 1404  sub resize_textarea_js {
     my $geometry = &viewport_geometry_js();      my $geometry = &viewport_geometry_js();
     return <<"RESIZE";      return <<"RESIZE";
     <script type="text/javascript">      <script type="text/javascript">
   // <![CDATA[
 $geometry  $geometry
   
 function getX(element) {  function getX(element) {
Line 1432  function resize_textarea(textarea_id,bot Line 1443  function resize_textarea(textarea_id,bot
     }      }
     textarea.style.height=new_height+'px';      textarea.style.height=new_height+'px';
 }  }
   // ]]>
 </script>  </script>
 RESIZE  RESIZE
   
Line 2299  sub authform_internal{ Line 2311  sub authform_internal{
     $result = &mt      $result = &mt
         ('[_1] Internally authenticated (with initial password [_2])',          ('[_1] Internally authenticated (with initial password [_2])',
          '<label>'.$authtype,'</label>'.$autharg);           '<label>'.$authtype,'</label>'.$autharg);
     $result.="<label><input type=\"checkbox\" name=\"visible\" onClick='if (this.checked) { this.form.intarg.type=\"text\" } else { this.form.intarg.type=\"password\" }' />".&mt('Visible input').'</label>';      $result.="<label><input type=\"checkbox\" name=\"visible\" onclick='if (this.checked) { this.form.intarg.type=\"text\" } else { this.form.intarg.type=\"password\" }' />".&mt('Visible input').'</label>';
     return $result;      return $result;
 }  }
   
Line 4144  Returns: value of designparamter $which Line 4156  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);
         }          }
     }      }
     return $output;      return $output;
 }  }
   
   ##############################################
   =pod
   
   =item * &authorspace()
   
   Inputs: ./.
   
   Returns: Path to the Construction Space of the current user's
            accessed author space
            The author space will be that of the current user
            when accessing the own author space
            and that of the co-author/assistent co-author
            when accessing the co-author's/assistent co-author's
            space
   
   =cut
   
   sub authorspace {
       my $caname = '';
       if ($env{'request.role'} =~ /^ca|^aa/) {
           (undef,$caname) =
               ($env{'request.role'}=~/($match_domain)\/($match_username)$/);
       } else {
           $caname = $env{'user.name'};
       }
       return '/priv/'.$caname.'/';
   }
   
   ##############################################
   =pod
   
   =item * &head_subbox()
   
   Inputs: $content (contains HTML code with page functions, etc.)
   
   Returns: HTML div with $content
            To be included in page header
   
   =cut
   
   sub head_subbox {
       my ($content)=@_;
       my $output =
           '<div id="LC_head_subbox">'
          .$content
          .'</div>'
   }
   
   ##############################################
   =pod
   
   =item * &CSTR_pageheader()
   
   Inputs: ./.
   
   Returns: HTML div with CSTR path and recent box
            To be included on Construction Space pages
   
   =cut
   
   sub CSTR_pageheader {
       # this is for resources; directories have customtitle, and crumbs
               # and select recent are created in lonpubdir.pm  
       my ($uname,$thisdisfn)=
           ($env{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|);
       my $formaction='/priv/'.$uname.'/'.$thisdisfn;
       $formaction=~s/\/+/\//g;
   
       my $parentpath = '';
       my $lastitem = '';
       if ($thisdisfn =~ m-(.+/)([^/]*)$-) {
           $parentpath = $1;
           $lastitem = $2;
       } else {
           $lastitem = $thisdisfn;
       }
       return
            '<div>'
           .&Apache::loncommon::help_open_menu('','',3,'Authoring') #FIXME: Broken? Where is it?
           .'<b>'.&mt('Construction Space:').'</b> '
           .'<form name="dirs" method="post" action="'.$formaction
           .'" target="_top"><tt><b>' #FIXME lonpubdir: target="_parent"
           .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."$lastitem</b></tt><br />"
           #FIXME lonpubdir: &Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/','_top','/priv','','+1',1)."</b></tt><br />"
           .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
           .'</form>'
           .&Apache::lonmenu::constspaceform()
           .'</div>';
   }
   
 ###############################################  ###############################################
 ###############################################  ###############################################
   
Line 4211  Inputs: Line 4302  Inputs:
 =item * $forcereg, if page should register as content page (relevant for   =item * $forcereg, if page should register as content page (relevant for 
             text interface only)              text interface only)
   
 =item * $customtitle, alternate text to use instead of $title  
                       in the title box that appears, this text  
                       is not auto translated like the $title is  
   
 =item * $no_nav_bar, if true, keep the 'what is this' info but remove the  =item * $no_nav_bar, if true, keep the 'what is this' info but remove the
                      navigational links                       navigational links
   
 =item * $bgcolor, used to override the bgcolor on a webpage to a specific value  =item * $bgcolor, used to override the bgcolor on a webpage to a specific value
   
 =item * $notitle, if true keep the nav controls, but remove the title bar  
   
 =item * $no_inline_link, if true and in remote mode, don't show the   =item * $no_inline_link, if true and in remote mode, don't show the 
          'Switch To Inline Menu' link           'Switch To Inline Menu' link
   
Line 4241  other decorations will be returned. Line 4326  other decorations will be returned.
 =cut  =cut
   
 sub bodytag {  sub bodytag {
     my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,$customtitle,      my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
         $no_nav_bar,$bgcolor,$notitle,$no_inline_link,$args)=@_;          $no_nav_bar,$bgcolor,$no_inline_link,$args)=@_;
   
     if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }      if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
   
Line 4296  sub bodytag { Line 4381  sub bodytag {
  $name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'});   $name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'});
     }      }
           
     my $roleinfo=(<<ENDROLE);  
 <td class="LC_title_bar_who">  
 <div class="LC_title_bar_name">  
     $name  
     &nbsp;  
 </div>  
 <div class="LC_title_bar_role">  
 $role&nbsp;  
 </div>  
 <div class="LC_title_bar_realm">  
 $realm&nbsp;  
 </div>  
 </td>  
 ENDROLE  
   
     my $titleinfo = '<h1>'.$title.'</h1>';      my $titleinfo = '<h1>'.$title.'</h1>';
     if ($customtitle) {  
         $titleinfo = $customtitle;  
     }  
     #      #
     # Extra info if you are the DC      # Extra info if you are the DC
     my $dc_info = '';      my $dc_info = '';
Line 4327  ENDROLE Line 4394  ENDROLE
         $dc_info = '('.$dc_info.')';          $dc_info = '('.$dc_info.')';
     }      }
   
     if (($env{'environment.remote'} eq 'off') || ($args->{'suppress_header_logos'})) {      if ($env{'environment.remote'} eq 'off') {
         # No Remote          # No Remote
  if ($env{'request.state'} eq 'construct') {   if ($env{'request.state'} eq 'construct') {
     $forcereg=1;      $forcereg=1;
  }   }
   
  if (!$customtitle && $env{'request.state'} eq 'construct') {  #    if ($env{'request.state'} eq 'construct') {
     # this is for resources; directories have customtitle, and crumbs  #        $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
             # and select recent are created in lonpubdir.pm    #    }
     my ($uname,$thisdisfn)=  
  ($env{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|);          my $titletable = '<table id="LC_title_bar">'
     my $formaction='/priv/'.$uname.'/'.$thisdisfn;                          ."<tr><td> $titleinfo $dc_info</td>"
     $formaction=~s/\/+/\//g;                          .'</tr></table>';
   
     my $parentpath = '';  
     my $lastitem = '';  
     if ($thisdisfn =~ m-(.+/)([^/]*)$-) {  
  $parentpath = $1;  
  $lastitem = $2;  
     } else {  
  $lastitem = $thisdisfn;  
     }  
     $titleinfo =   
  &Apache::loncommon::help_open_menu('','',3,'Authoring')  
  .'<b>'.&mt('Construction Space').'</b>:&nbsp;'  
  .'<form name="dirs" method="post" action="'.$formaction  
  .'" target="_top"><tt><b>'  
  .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."<span class=\"LC_fontsize_big\">$lastitem</span></b></tt><br />"  
  .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')  
  .'</form>'  
  .&Apache::lonmenu::constspaceform();  
         }  
   
         my $titletable;  
  if (!$notitle) {  
     $titletable =  
  '<table id="LC_title_bar">'.  
                          "<tr><td> $titleinfo $dc_info</td>".$roleinfo.  
  '</tr></table>';  
  }  
  if ($no_nav_bar) {   if ($no_nav_bar) {
     $bodytag .= $titletable;      $bodytag .= $titletable;
  } else {   } else {
Line 4397  ENDROLE Line 4438  ENDROLE
     my $menu= ($no_inline_link?''      my $menu= ($no_inline_link?''
        :'<br /><a href="/adm/remote?action=collapse">'.&mt('Switch to Inline Menu Mode').'</a>');         :'<br /><a href="/adm/remote?action=collapse">'.&mt('Switch to Inline Menu Mode').'</a>');
     #      #
     if ($notitle) {  
  return $bodytag;  
     }  
     return(<<ENDBODY);      return(<<ENDBODY);
 $bodytag  $bodytag
 <table id="LC_title_bar" class="LC_with_remote">  <table id="LC_title_bar" class="LC_with_remote">
Line 4407  $bodytag Line 4445  $bodytag
     <td>$messages&nbsp;</td>      <td>$messages&nbsp;</td>
 </tr>  </tr>
 <tr><td>$titleinfo $dc_info $menu</td>  <tr><td>$titleinfo $dc_info $menu</td>
 $roleinfo  
 </tr>  </tr>
 </table>  </table>
 ENDBODY  ENDBODY
Line 4452  sub make_attr_string { Line 4489  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 4538  sub standard_css { Line 4566  sub standard_css {
   
     my $sans                 = 'Verdana,Arial,Helvetica,sans-serif';      my $sans                 = 'Verdana,Arial,Helvetica,sans-serif';
     my $mono                 = 'monospace';      my $mono                 = 'monospace';
     my $data_table_head      = $tabbg;      my $data_table_head      = $sidebg;
     my $data_table_light     = '#EEEEEE';      my $data_table_light     = '#FAFAFA';
     my $data_table_dark      = '#DDDDDD';      my $data_table_dark      = '#F0F0F0';
     my $data_table_darker    = '#CCCCCC';      my $data_table_darker    = '#CCCCCC';
     my $data_table_highlight = '#FFFF00';      my $data_table_highlight = '#FFFF00';
     my $mail_new             = '#FFBB77';      my $mail_new             = '#FFBB77';
Line 4577  a:focus { Line 4605  a:focus {
   background: yellow     background: yellow 
 }  }
   
   hr {
     clear: both;
     color: $tabbg;
     background-color: $tabbg;
     height: 3px;
     border: none;
   }
   
 form, .inline {   form, .inline { 
    display: inline;      display: inline; 
 }  }
Line 4657  div.LC_confirm_box .LC_success img { Line 4693  div.LC_confirm_box .LC_success img {
   
 .LC_disc_action_links_bar {  .LC_disc_action_links_bar {
    background: $tabbg;     background: $tabbg;
    font-family: $sans;  
    border: none;     border: none;
    margin: 4px;     margin: 4px;
 }  }
Line 4700  table#LC_nav_location { Line 4735  table#LC_nav_location {
 table#LC_title_bar a {  table#LC_title_bar a {
   color: $fontmenu;    color: $fontmenu;
 }  }
       
 table#LC_title_bar {  table#LC_title_bar {
   /*display: none;*/    clear: both;
     display: none;
 }  }
   
 table#LC_title_bar,  table#LC_title_bar,
Line 4714  table#LC_title_bar.LC_with_remote { Line 4750  table#LC_title_bar.LC_with_remote {
   border-width: $border;    border-width: $border;
   background: $pgbg;    background: $pgbg;
   color: $fontmenu;    color: $fontmenu;
   font-family: $sans;  
   border-collapse: collapse;  
   padding: 0;  
 }  
   
 table.LC_docs_path {  
   width: 100%;  
   border: 0;  
   background: $pgbg;  
   font-family: $sans;  
   border-collapse: collapse;    border-collapse: collapse;
   padding: 0;    padding: 0;
     margin: 0;
 }  }
   
 table#LC_title_bar td {  table#LC_title_bar td {
   background: $tabbg;    background: $tabbg;
 }  }
   
 table#LC_title_bar .LC_title_bar_who {  
   background: $tabbg;  
   color: $fontmenu;  
   font: small $sans;  
   text-align: right;  
   margin: 0;  
 }  
   
 table#LC_title_bar .LC_title_bar_name {  
   margin: 0;  
 }  
   
 table#LC_title_bar .LC_title_bar_role {  
   margin: 0;  
 }  
   
 table#LC_title_bar .LC_title_bar_realm {  
   margin: 0;  
 }  
   
 span.LC_metadata {  
   font-family: $sans;  
 }  
   
 table#LC_menubuttons img{  table#LC_menubuttons img{
   border: none;    border: none;
 }  }
Line 4771  table#LC_top_nav td { Line 4774  table#LC_top_nav td {
 table#LC_top_nav td a,  table#LC_top_nav td a,
 div#LC_top_nav a {  div#LC_top_nav a {
   color: $font;    color: $font;
   font-family: $sans;  
 }  }
   
 table#LC_top_nav td.LC_top_nav_logo {  table#LC_top_nav td.LC_top_nav_logo {
Line 4796  table#LC_top_nav td.LC_top_nav_login { Line 4798  table#LC_top_nav td.LC_top_nav_login {
   text-align: center;    text-align: center;
 }  }
   
 table.LC_breadcrumbs td,  .LC_breadcrumbs_component {
 table.LC_docs_path td  {      float: right;
   background: $tabbg;      margin: 0 1em;
   color: $fontmenu;  
   font-family: $sans;  
   font-size: smaller;  
 }  }
   .LC_breadcrumbs_component img {
 table.LC_breadcrumbs td.LC_breadcrumbs_component,      vertical-align: middle;
 table.LC_docs_path td.LC_docs_path_component {  
   background: $tabbg;  
   color: $fontmenu;  
   font-family: $sans;  
   font-size: larger;  
   text-align: right;  
 }  }
   
 td.LC_table_cell_checkbox {  td.LC_table_cell_checkbox {
Line 4825  table#LC_mainmenu td.LC_mainmenu_column Line 4818  table#LC_mainmenu td.LC_mainmenu_column
  font-size: 70%;   font-size: 70%;
 }  }
   
   #LC_breadcrumbs {
    clear:both;
    background: $sidebg;
    border-bottom: 1px solid $lg_border_color;
    line-height: 32px; 
    margin: 0;
    padding: 0;
   }
   /* Preliminary fix to hide breadcrumbs inside remote control window */
   #LC_remote #LC_breadcrumbs {
       display:none;
   }
   
   #LC_head_subbox {
    clear:both;
    background: #F8F8F8; /* $sidebg; */
    border-bottom: 1px solid $lg_border_color;
    margin: 0 0 10px 0;
    padding: 5px;
   }
   
 .LC_fontsize_medium {  .LC_fontsize_medium {
  font-size: 85%;   font-size: 85%;
 }  }
Line 4835  table#LC_mainmenu td.LC_mainmenu_column Line 4849  table#LC_mainmenu td.LC_mainmenu_column
   
 .LC_menubuttons_inline_text {  .LC_menubuttons_inline_text {
   color: $font;    color: $font;
   font-family: $sans;  
   font-size: 90%;    font-size: 90%;
   padding-left:3px;    padding-left:3px;
 }  }
Line 4847  table#LC_mainmenu td.LC_mainmenu_column Line 4860  table#LC_mainmenu td.LC_mainmenu_column
 .LC_menubuttons_category {  .LC_menubuttons_category {
   color: $font;    color: $font;
   background: $pgbg;    background: $pgbg;
   font-family: $sans;  
   font-size: larger;    font-size: larger;
   font-weight: bold;    font-weight: bold;
 }  }
Line 4857  td.LC_menubuttons_text { Line 4869  td.LC_menubuttons_text {
 }  }
   
 .LC_current_location {  .LC_current_location {
   font-family: $sans;  
   background: $tabbg;    background: $tabbg;
 }  }
   
 .LC_new_mail {  .LC_new_mail {
   font-family: $sans;  
   background: $tabbg;    background: $tabbg;
   font-weight: bold;    font-weight: bold;
 }  }
   
 .LC_preferences_labeltext {  
   font-family: $sans;  
   text-align: right;  
 }  
   
 .LC_roleslog_note {  .LC_roleslog_note {
   font-size: small;    font-size: small;
 }  }
   
 .LC_mail_functions {  
     font-weight: bold;  
 }  
   
 table.LC_data_table,  table.LC_data_table,
 table.LC_mail_list {  table.LC_mail_list {
   border: 1px solid #000000;    border: 1px solid #000000;
Line 5127  span.LC_current_location { Line 5128  span.LC_current_location {
   
 span.LC_parm_menu_item {  span.LC_parm_menu_item {
   font-size: larger;    font-size: larger;
   font-family: $sans;  
 }  }
   
 span.LC_parm_scope_all {  span.LC_parm_scope_all {
Line 5182  table#LC_helpmenu { Line 5182  table#LC_helpmenu {
   
 table#LC_helpmenu fieldset legend {  table#LC_helpmenu fieldset legend {
   font-size: larger;    font-size: larger;
   font-weight: bold;  
 }  }
   
 table#LC_helpmenu_links {  table#LC_helpmenu_links {
Line 5235  table.LC_pick_box { Line 5234  table.LC_pick_box {
 }  }
   
 table.LC_pick_box td.LC_pick_box_title {  table.LC_pick_box td.LC_pick_box_title {
   background: $tabbg;    background: $sidebg;
   font-weight: bold;    font-weight: bold;
   text-align: right;    text-align: right;
   vertical-align: top;    vertical-align: top;
Line 5370  table.LC_notify_front_page td { Line 5369  table.LC_notify_front_page td {
 }  }
   
 .LC_topic_bar {  .LC_topic_bar {
   font-family: $sans;  
   font-weight: bold;    font-weight: bold;
   width: 100%;    width: 100%;
   background: $tabbg;    background: $tabbg;
Line 5399  table.LC_status_selector td { Line 5397  table.LC_status_selector td {
   
 div.LC_feedback_link {  div.LC_feedback_link {
   clear: both;    clear: both;
   background: white;    background: $sidebg;
   width: 100%;    width: 100%;
     padding-bottom: 10px;
     border: 1px $tabbg solid;
     height: 22px;
     line-height: 22px;
     padding-top: 5px;
   }
   
   div.LC_feedback_link img {
     height: 22px;
   }
   
   div.LC_feedback_link a{
     text-decoration: none;
 }  }
   
 span.LC_feedback_link {  span.LC_feedback_link {
   background: $feedback_link_bg;    //background: $feedback_link_bg;
   font-size: larger;    font-size: larger;
 }  }
   
 span.LC_message_link {  span.LC_message_link {
   background: $feedback_link_bg;    //background: $feedback_link_bg;
   font-size: larger;    font-size: larger;
   position: absolute;    position: absolute;
   right: 1em;    right: 1em;
Line 5427  table.LC_prior_tries td { Line 5438  table.LC_prior_tries td {
   
 .LC_answer_correct {  .LC_answer_correct {
   background: lightgreen;    background: lightgreen;
   font-family: $sans;  
   color: darkgreen;    color: darkgreen;
   padding: 6px;    padding: 6px;
 }  }
   
 .LC_answer_charged_try {  .LC_answer_charged_try {
   background: #FFAAAA;    background: #FFAAAA;
   font-family: $sans;  
   color: darkred;    color: darkred;
   padding: 6px;    padding: 6px;
 }  }
Line 5443  table.LC_prior_tries td { Line 5452  table.LC_prior_tries td {
 .LC_answer_no_grade,  .LC_answer_no_grade,
 .LC_answer_late {  .LC_answer_late {
   background: lightyellow;    background: lightyellow;
   font-family: $sans;  
   color: black;    color: black;
   padding: 6px;    padding: 6px;
 }  }
   
 .LC_answer_previous {  .LC_answer_previous {
   background: lightblue;    background: lightblue;
   font-family: $sans;  
   color: darkblue;    color: darkblue;
   padding: 6px;    padding: 6px;
 }  }
   
 .LC_answer_no_message {  .LC_answer_no_message {
   background: #FFFFFF;    background: #FFFFFF;
   font-family: $sans;  
   color: black;    color: black;
   padding: 6px;    padding: 6px;
 }  }
   
 .LC_answer_unknown {  .LC_answer_unknown {
   background: orange;    background: orange;
   font-family: $sans;  
   color: black;    color: black;
   padding: 6px;    padding: 6px;
 }  }
Line 5702  div.LC_edit_problem_editxml_header div { Line 5707  div.LC_edit_problem_editxml_header div {
   margin-top: 5px;    margin-top: 5px;
 }  }
   
 div.LC_edit_problem_header_edit_row {  
   background: $tabbg;  
   padding: 3px;  
   margin-bottom: 5px;  
 }  
   
 div.LC_edit_problem_header_title {  div.LC_edit_problem_header_title {
   font-weight: bold;    font-weight: bold;
   font-size: larger;    font-size: larger;
Line 5737  div.LC_edit_problem_saves { Line 5736  div.LC_edit_problem_saves {
   padding-bottom: 5px;    padding-bottom: 5px;
 }  }
   
 hr.LC_edit_problem_divide {  
   clear: both;  
   color: $tabbg;  
   background-color: $tabbg;  
   height: 3px;  
   border: none;  
 }  
   
 img.stift{  img.stift{
   border-width: 0;    border-width: 0;
   vertical-align: middle;    vertical-align: middle;
Line 5763  table#LC_mainmenu td.LC_mainmenu_col_fie Line 5754  table#LC_mainmenu td.LC_mainmenu_col_fie
 .LC_mainmenu_fieldset_category {  .LC_mainmenu_fieldset_category {
   color: $font;    color: $font;
   background: $pgbg;    background: $pgbg;
   font-family: $sans;  
   font-size: small;    font-size: small;
   font-weight: bold;    font-weight: bold;
 }  }
Line 5809  h2,h3,h4,h5,h6 { Line 5799  h2,h3,h4,h5,h6 {
  border-bottom:solid 1px $lg_border_color;   border-bottom:solid 1px $lg_border_color;
 }  }
   
   .LC_Box > .LC_hcell {
       margin: 0 -10px 10px -10px;
   }
   
 .LC_noBorder {  .LC_noBorder {
         border: 0;          border: 0;
 }  }
   
   
 /* Main Header with discription of Person, Course, etc. */  
   
 .LC_Right {  .LC_Right {
         float: right;          float: right;
         margin: 0;          margin: 0;
Line 5844  dl,ul,div,fieldset { Line 5835  dl,ul,div,fieldset {
 /* overflow: hidden; */  /* overflow: hidden; */
 }  }
   
   fieldset > legend {
       font-weight: bold;
       padding: 0 5px 0 5px;
   }
   
 #LC_nav_bar {  #LC_nav_bar {
     float: left;      float: left;
     margin: 0;      margin: 0;
Line 5899  ul#LC_TabMainMenuContent li { Line 5895  ul#LC_TabMainMenuContent li {
     vertical-align: middle;      vertical-align: middle;
 }  }
   
 ul.LC_TabContent ,  ul.LC_TabContent {
 ul.LC_TabContentBigger {  
  display:block;   display:block;
    background: $sidebg;
    border-bottom: solid 1px $lg_border_color
  list-style:none;   list-style:none;
  margin: 0;   margin: -10px -10px 0 -10px;
  padding: 0;   padding: 0;
 }  }
   
   ul.LC_TabContentBigger {
           display:block;
           list-style:none;
           padding: 0;
   }
   
   
 ul.LC_TabContent li,  ul.LC_TabContent li,
 ul.LC_TabContentBigger li {  ul.LC_TabContentBigger li {
  display: inline;   display: inline;
Line 5922  ul#LC_TabMainMenuContent li a { Line 5926  ul#LC_TabMainMenuContent li a {
 }  }
   
 ul.LC_TabContent {  ul.LC_TabContent {
  min-height:1.6em;   min-height:1.5em;
 }  }
   
 ul.LC_TabContent li {  ul.LC_TabContent li {
Line 5932  ul.LC_TabContent li { Line 5936  ul.LC_TabContent li {
  border-bottom:solid 1px $lg_border_color;   border-bottom:solid 1px $lg_border_color;
 }  }
   
   ul.LC_TabContent .right {
    float:right;
   }
   
 ul.LC_TabContent li a, ul.LC_TabContent li {  ul.LC_TabContent li a, ul.LC_TabContent li {
  color:rgb(47,47,47);   color:rgb(47,47,47);
  text-decoration:none;   text-decoration:none;
Line 5942  ul.LC_TabContent li a, ul.LC_TabContent Line 5950  ul.LC_TabContent li a, ul.LC_TabContent
   
 ul.LC_TabContent li:hover, ul.LC_TabContent li.active {  ul.LC_TabContent li:hover, ul.LC_TabContent li.active {
         background:#FFFFFF url(/adm/lonIcons/open.gif) no-repeat scroll right center;          background:#FFFFFF url(/adm/lonIcons/open.gif) no-repeat scroll right center;
  border-bottom:solid 1px #FFFFFF;   border-bottom:solid 2px #FFFFFF;
  padding-right: 16px;   padding-right: 16px;
 }  }
   
Line 5952  ul.LC_TabContentBigger li { Line 5960  ul.LC_TabContentBigger li {
  border-left:solid 1px $lg_border_color;   border-left:solid 1px $lg_border_color;
  padding:5px 10px 5px 10px;   padding:5px 10px 5px 10px;
  margin-left:2px;   margin-left:2px;
  background:url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;   background: #d9d9d9;
   }
   
   #maincoursedoc {
    clear:both;
 }  }
   
 ul.LC_TabContentBigger li:hover,   ul.LC_TabContentBigger li:hover, 
 ul.LC_TabContentBigger li.active {  ul.LC_TabContentBigger li.active {
  background:url(/adm/lonIcons/lightGreyBG.png) repeat-x right bottom;   background: #ffffff;
 }  }
   
 ul.LC_TabContentBigger li,   ul.LC_TabContentBigger li, 
Line 5968  ul.LC_TabContentBigger li a { Line 5980  ul.LC_TabContentBigger li a {
   
 ol#LC_MenuBreadcrumbs,   ol#LC_MenuBreadcrumbs, 
 ol#LC_PathBreadcrumbs,   ol#LC_PathBreadcrumbs, 
 ul.LC_CourseBreadcrumbs {  ul#LC_CourseBreadcrumbs {
  border-top: solid 1px RGB(255, 255, 255);  
  height: 20px;  
  line-height: 20px;  
  vertical-align: bottom;  
  margin: 0 0 30px 0;  
  padding-left: 10px;   padding-left: 10px;
    margin: 0;
  list-style-position: inside;   list-style-position: inside;
  background: url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;  
 }  }
   
 ol#LC_MenuBreadcrumbs li,   ol#LC_MenuBreadcrumbs li, 
 ol#LC_PathBreadcrumbs li,   ol#LC_PathBreadcrumbs li, 
 ul.LC_CourseBreadcrumbs li {  ul#LC_CourseBreadcrumbs li {
 /*      display: inline;
  background: url(/adm/lonIcons/arrow_white.png) no-repeat left center;      white-space: nowrap;
 */  
  display: inline;  
  padding: 0 0 0 10px;  
 /* vertical-align: bottom; */  
  overflow:hidden;  
 }  }
   
 ol#LC_MenuBreadcrumbs li a, ul.LC_CourseBreadcrumbs li a {  ol#LC_MenuBreadcrumbs li a,
   ul#LC_CourseBreadcrumbs li a {
  text-decoration: none;   text-decoration: none;
  font-size:90%;   font-size:90%;
 }  }
Line 6002  ol#LC_PathBreadcrumbs li a { Line 6005  ol#LC_PathBreadcrumbs li a {
  font-weight:bold;   font-weight:bold;
 }  }
   
 .LC_BoxPadding {  .LC_Box {
  padding: 10px;      border: solid 1px $lg_border_color;
 }      padding: 0 10px 10px 10px;
   
 .LC_ContentBoxSpecial {  
  border: solid 1px $lg_border_color;  
 }  
   
 .LC_ContentBoxSpecialContactInfo {  
  border: solid 1px $lg_border_color;  
  max-width:25%;  
  min-width:25%;  
 }  }
   
 .LC_AboutMe_Image {  .LC_AboutMe_Image {
Line 6102  div.LC_columnSection>* { Line 6096  div.LC_columnSection>* {
  overflow:hidden;   overflow:hidden;
 }  }
   
 .ContentBoxSpecialTemplate {  
         border: solid 1px $lg_border_color;  
 }  
   
 .ContentBoxTemplate {  
         padding:10px;  
 }  
   
 div.LC_columnSection > .ContentBoxTemplate,  
 div.LC_columnSection > .ContentBoxSpecialTemplate {  
         width: 600px;  
 }  
   
 .clear {  .clear {
  clear: both;   clear: both;
  line-height: 0;   line-height: 0;
Line 6270  a.LC_toolbarItem { Line 6251  a.LC_toolbarItem {
  background-color:transparent;   background-color:transparent;
 }  }
   
 ul.LC_functionslist li {  ul.LC_funclist li {
   float: left;    float: left;
   white-space: nowrap;    white-space: nowrap;
   height: 35px; /* at least as high as heighest list item */    height: 35px; /* at least as high as heighest list item */
Line 6405  sub xml_begin { Line 6386  sub xml_begin {
             .'<html xmlns:math="http://www.w3.org/1998/Math/MathML" '               .'<html xmlns:math="http://www.w3.org/1998/Math/MathML" ' 
     .'xmlns="http://www.w3.org/1999/xhtml">';      .'xmlns="http://www.w3.org/1999/xhtml">';
     } else {      } else {
  $output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>';   $output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
              .'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
     }      }
     return $output;      return $output;
 }  }
Line 6481  $args - additional optional args support Line 6463  $args - additional optional args support
                                     a html attribute                                      a html attribute
              force_register -> if is true will turn on the &bodytag()               force_register -> if is true will turn on the &bodytag()
                                     $forcereg arg                                      $forcereg arg
              body_title     -> alternate text to use instead of $title  
                                     in the title box that appears, this text  
                                     is not auto translated like the $title is  
              frameset       -> if true will start with a <frameset>               frameset       -> if true will start with a <frameset>
                                     rather than <body>                                      rather than <body>
              no_title       -> if true the title bar won't be shown  
              skip_phases    -> hash ref of                skip_phases    -> hash ref of 
                                     head -> skip the <html><head> generation                                      head -> skip the <html><head> generation
                                     body -> skip all <body> generation                                      body -> skip all <body> generation
Line 6528  sub start_page { Line 6506  sub start_page {
     my $attr_string = &make_attr_string($args->{'force_register'},      my $attr_string = &make_attr_string($args->{'force_register'},
  $args->{'add_entries'});   $args->{'add_entries'});
     $result .= "\n<frameset $attr_string>\n";      $result .= "\n<frameset $attr_string>\n";
  } else {          } else {
     $result .=              $result .=
  &bodytag($title,                   &bodytag($title, 
  $args->{'function'},       $args->{'add_entries'},                           $args->{'function'},       $args->{'add_entries'},
  $args->{'only_body'},      $args->{'domain'},                           $args->{'only_body'},      $args->{'domain'},
  $args->{'force_register'}, $args->{'body_title'},                           $args->{'force_register'}, $args->{'no_nav_bar'},
  $args->{'no_nav_bar'},     $args->{'bgcolor'},                           $args->{'bgcolor'},        $args->{'no_inline_link'},
  $args->{'no_title'},       $args->{'no_inline_link'},                           $args);
  $args);          }
  }  
     }      }
   
     if ($args->{'js_ready'}) {      if ($args->{'js_ready'}) {
Line 6800  Returns either 'student','coordinator',' Line 6777  Returns either 'student','coordinator','
 ###############################################  ###############################################
 sub get_users_function {  sub get_users_function {
     my $function = 'norole';      my $function = 'norole';
       if ($env{'request.role'}=~/^(st)/) {
           $function='student';
       }
     if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {      if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
         $function='coordinator';          $function='coordinator';
     }      }
     if ($env{'request.role'}=~/^(su|dc|ad|li)/) {      if ($env{'request.role'}=~/^(su|dc|ad|li)/) {
         $function='admin';          $function='admin';
     }      }
     if (($env{'request.role'}=~/^(au|ca)/) ||      if (($env{'request.role'}=~/^(au|ca|aa)/) ||
         ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {          ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {
         $function='author';          $function='author';
     }      }
Line 6817  sub get_users_function { Line 6797  sub get_users_function {
   
 =pod  =pod
   
   =item * &show_course()
   
   Used by lonmenu.pm and lonroles.pm to determine whether to use the word
   'Courses' or 'Roles' in inline navigation and on screen displaying user's roles.
   
   Inputs:
   None
   
   Outputs:
   Scalar: 1 if 'Course' to be used, 0 otherwise.
   
   =cut
   
   ###############################################
   sub show_course {
       my $course = !$env{'user.adv'};
       if (!$env{'user.adv'}) {
           foreach my $env (keys(%env)) {
               next if ($env !~ m/^user\.priv\./);
               if ($env !~ m/^user\.priv\.(?:st|cm)/) {
                   $course = 0;
                   last;
               }
           }
       }
       return $course;
   }
   
   ###############################################
   
   =pod
   
 =item * &check_user_status()  =item * &check_user_status()
   
 Determines current status of supplied role for a  Determines current status of supplied role for a
Line 7560  ENDSCRIPT Line 7572  ENDSCRIPT
   
     my $output = <<"END_BLOCK";      my $output = <<"END_BLOCK";
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 function validateEntry(callingForm) {  function validateEntry(callingForm) {
   
     var checkok = 1;      var checkok = 1;
Line 7628  function validateEntry(callingForm) { Line 7641  function validateEntry(callingForm) {
   
 $newuserscript  $newuserscript
   
   // ]]>
 </script>  </script>
   
 $new_user_create  $new_user_create
Line 8522  sub csv_print_samples { Line 8536  sub csv_print_samples {
     $r->print(&mt('Samples').'<br />'.&start_data_table().      $r->print(&mt('Samples').'<br />'.&start_data_table().
               &start_data_table_header_row());                &start_data_table_header_row());
     foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) {       foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) { 
         $r->print('<th>'.&mt('Column&nbsp;[_1]',($sample+1)).'</th>'); }          $r->print('<th>'.&mt('Column [_1]',($sample+1)).'</th>'); }
     $r->print(&end_data_table_header_row());      $r->print(&end_data_table_header_row());
     foreach my $hash (@$samples) {      foreach my $hash (@$samples) {
  $r->print(&start_data_table_row());   $r->print(&start_data_table_row());
Line 10235  sub escape_url { Line 10249  sub escape_url {
     return join('/',@urlslices).'/'.$lastitem;      return join('/',@urlslices).'/'.$lastitem;
 }  }
   
 # -------------------------------------------------------- Initliaze user login  sub compare_arrays {
       my ($arrayref1,$arrayref2) = @_;
       my (@difference,%count);
       @difference = ();
       %count = ();
       if ((ref($arrayref1) eq 'ARRAY') && (ref($arrayref2) eq 'ARRAY')) {
           foreach my $element (@{$arrayref1}, @{$arrayref2}) { $count{$element}++; }
           foreach my $element (keys(%count)) {
               if ($count{$element} == 1) {
                   push(@difference,$element);
               }
           }
       }
       return @difference;
   }
   
   # -------------------------------------------------------- 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 10289  sub init_user_environment { Line 10319  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 10319  sub init_user_environment { Line 10336  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 10356  sub init_user_environment { Line 10371  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.815  
changed lines
  Added in v.1.850


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