Diff for /loncom/interface/loncommon.pm between versions 1.1431 and 1.1456

version 1.1431, 2024/05/21 02:57:15 version 1.1456, 2025/02/17 18:48:06
Line 1174  sub linked_select_forms { Line 1174  sub linked_select_forms {
         $menuorder,          $menuorder,
         $onchangefirst,          $onchangefirst,
         $onchangesecond,          $onchangesecond,
         $suffix          $suffix,
           $haslabel
         ) = @_;          ) = @_;
     my $second = "document.$formname.$secondselectname";      my $second = "document.$formname.$secondselectname";
     my $first = "document.$formname.$firstselectname";      my $first = "document.$formname.$firstselectname";
Line 1240  END Line 1241  END
         $result.=">".&mt($hashref->{$value}->{'text'})."</option>\n";          $result.=">".&mt($hashref->{$value}->{'text'})."</option>\n";
     }      }
     $result .= "</select>\n";      $result .= "</select>\n";
       if ($haslabel) {
           $result .= '</label>';
       }
     my %select2;      my %select2;
     if (ref($hashref->{$firstdefault}) eq 'HASH') {      if (ref($hashref->{$firstdefault}) eq 'HASH') {
         if (ref($hashref->{$firstdefault}->{'select2'}) eq 'HASH') {          if (ref($hashref->{$firstdefault}->{'select2'}) eq 'HASH') {
             %select2 = %{$hashref->{$firstdefault}->{'select2'}};              %select2 = %{$hashref->{$firstdefault}->{'select2'}};
         }          }
     }      }
     $result .= $middletext;      if ($middletext ne '') {
           $result .= '<label>'.$middletext;
       }
     $result .= "<select size=\"1\" name=\"$secondselectname\"";      $result .= "<select size=\"1\" name=\"$secondselectname\"";
     if ($onchangesecond) {      if ($onchangesecond) {
         $result .= ' onchange="'.$onchangesecond.'"';          $result .= ' onchange="'.$onchangesecond.'"';
Line 1264  END Line 1270  END
         $result.=">".&mt($select2{$value})."</option>\n";          $result.=">".&mt($select2{$value})."</option>\n";
     }      }
     $result .= "</select>\n";      $result .= "</select>\n";
       if ($middletext ne '') {
           $result .= '</label>';
       }
     #    return $debug;      #    return $debug;
     return $result;      return $result;
 }   #  end of sub linked_select_forms {  }   #  end of sub linked_select_forms {
Line 2300  sub import_crsauthor_form { Line 2309  sub import_crsauthor_form {
         dire => 'Directory',          dire => 'Directory',
         se   => 'Select',          se   => 'Select',
     );      );
     $output = $lt{'dire'}.':&nbsp;'.      $output = '<label>'.$lt{'dire'}.':&nbsp;'.
               '<select id="'.$firstselectname.'" name="'.$firstselectname.'" '.                '<select id="'.$firstselectname.'" name="'.$firstselectname.'" '.
               'onchange="populateCrsSelects(this.form,'."'$firstselectname','$secondselectname',1,'$js_only',0,1,0,0,0".');">'.                'onchange="populateCrsSelects(this.form,'."'$firstselectname','$secondselectname',1,'$js_only',0,1,0,0,0".');">'.
               '<option value="" selected="selected">'.$lt{'se'}.'</option>';                '<option value="" selected="selected">'.$lt{'se'}.'</option>';
Line 2311  sub import_crsauthor_form { Line 2320  sub import_crsauthor_form {
         next if ($key eq '/');          next if ($key eq '/');
         $output .= '<option value="'.$key.'">'.$key.'</option>'."\n";          $output .= '<option value="'.$key.'">'.$key.'</option>'."\n";
     }      }
     $output .= '</select><br />'."\n".      $output .= '</select></label><br /><label>'."\n".
                $lt{'fnam'}.':&nbsp;<select id="'.$secondselectname.'" name="'.$secondselectname.'">'."\n".                 $lt{'fnam'}.':&nbsp;<select id="'.$secondselectname.'" name="'.$secondselectname.'">'."\n".
                '<option value="" selected="selected"></option>'."\n".                 '<option value="" selected="selected"></option>'."\n".
                '</select>'."\n".                 '</select></label>'."\n".
                '<input type="hidden" id="crsres_include_'.$suffix.'" value="'.$only.'" />';                 '<input type="hidden" id="crsres_include_'.$suffix.'" value="'.$only.'" />';
     return ($numdirs,$output);      return ($numdirs,$output);
 }  }
Line 2476  END Line 2485  END
 <domain>$cdom</domain>  <domain>$cdom</domain>
 <highestgradelevel>0</highestgradelevel>  <highestgradelevel>0</highestgradelevel>
 <keywords></keywords>  <keywords></keywords>
 <language>notset </language>  <language>notset</language>
 <lastrevisiondate>$now</lastrevisiondate>  <lastrevisiondate>$now</lastrevisiondate>
 <lowestgradelevel>0</lowestgradelevel>  <lowestgradelevel>0</lowestgradelevel>
 <mime>rights</mime>  <mime>rights</mime>
Line 3066  sub select_level_form { Line 3075  sub select_level_form {
   
 =pod  =pod
   
 =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms,$excdoms,$disabled)  =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms,$excdoms,$disabled,$id)
   
 Returns a string containing a <select name='$name' size='1'> form to   Returns a string containing a <select name='$name' size='1'> form to 
 allow a user to select the domain to preform an operation in.    allow a user to select the domain to preform an operation in.  
Line 3085  The optional $excdoms is a reference to Line 3094  The optional $excdoms is a reference to
   
 The optional $disabled argument, if true, adds the disabled attribute to the select tag.  The optional $disabled argument, if true, adds the disabled attribute to the select tag.
   
   The option $id argument is the value (if any) to set as the (unique) id attribute for the select tag.
   
 =cut  =cut
   
 #-------------------------------------------  #-------------------------------------------
 sub select_dom_form {  sub select_dom_form {
     my ($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms,$excdoms,$disabled) = @_;      my ($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms,$excdoms,$disabled,$id) = @_;
     if ($onchange) {      if ($onchange) {
         $onchange = ' onchange="'.$onchange.'"';          $onchange = ' onchange="'.$onchange.'"';
     }      }
     if ($disabled) {      if ($disabled) {
         $disabled = ' disabled="disabled"';          $disabled = ' disabled="disabled"';
     }      }
       if ($id ne '') {
           $id = ' id="'.$id.'"';
       }
     my (@domains,%exclude);      my (@domains,%exclude);
     if (ref($incdoms) eq 'ARRAY') {      if (ref($incdoms) eq 'ARRAY') {
         @domains = sort {lc($a) cmp lc($b)} (@{$incdoms});          @domains = sort {lc($a) cmp lc($b)} (@{$incdoms});
Line 3106  sub select_dom_form { Line 3120  sub select_dom_form {
     if (ref($excdoms) eq 'ARRAY') {      if (ref($excdoms) eq 'ARRAY') {
         map { $exclude{$_} = 1; } @{$excdoms};           map { $exclude{$_} = 1; } @{$excdoms}; 
     }      }
     my $selectdomain = "<select name=\"$name\" size=\"1\"$onchange$disabled>\n";      my $selectdomain = "<select name=\"$name\" size=\"1\"$onchange$disabled$id>\n";
     foreach my $dom (@domains) {      foreach my $dom (@domains) {
         next if ($exclude{$dom});          next if ($exclude{$dom});
         $selectdomain.="<option value=\"$dom\" ".          $selectdomain.="<option value=\"$dom\" ".
Line 3950  sub passwd_validation_js { Line 3964  sub passwd_validation_js {
         } else {          } else {
             $alertmsg = &mt('A secret did not satisfy requirement(s):').'\n\n';              $alertmsg = &mt('A secret did not satisfy requirement(s):').'\n\n';
         }          }
       } elsif ($context eq 'ltitools') {
           my %domconfig = &Apache::lonnet::get_dom('configuration',['toolsec'],$domain);
           if (ref($domconfig{'toolsec'}) eq 'HASH') {
               if (ref($domconfig{'toolsec'}{'rules'}) eq 'HASH') {
                   %passwdconf = %{$domconfig{'toolsec'}{'rules'}};
               }
           }
           if ($id eq 'add') {
               $alertmsg = &mt('Secret for added external tool did not satisfy requirement(s):').'\n\n';
           } elsif ($id =~ /^\d+$/) {
               my $pos = $id+1;
               $alertmsg = &mt('Secret for external tool [_1] did not satisfy requirement(s):','#'.$pos).'\n\n';
           } else {
               $alertmsg = &mt('A secret did not satisfy requirement(s):').'\n\n';
           }
     } else {      } else {
         %passwdconf = &Apache::lonnet::get_passwdconf($domain);          %passwdconf = &Apache::lonnet::get_passwdconf($domain);
         $alertmsg = &mt('Initial password did not satisfy requirement(s):').'\n\n';          $alertmsg = &mt('Initial password did not satisfy requirement(s):').'\n\n';
Line 5676  sub blockcheck { Line 5705  sub blockcheck {
             }              }
             unless ($has_evb) {              unless ($has_evb) {
                 if (($activity eq 'printout') || ($activity eq 'grades') || ($activity eq 'search') ||                  if (($activity eq 'printout') || ($activity eq 'grades') || ($activity eq 'search') ||
                     ($activity eq 'boards') || ($activity eq 'groups') || ($activity eq 'chat')) {                      ($activity eq 'index') || ($activity eq 'boards') || ($activity eq 'groups') || 
                       ($activity eq 'chat')) {
                     if ($udom eq $cdom) {                      if ($udom eq $cdom) {
                         $check_ipaccess = 1;                          $check_ipaccess = 1;
                     }                      }
Line 5767  sub blockcheck { Line 5797  sub blockcheck {
   
     if (($activity eq 'boards' || $activity eq 'chat' ||      if (($activity eq 'boards' || $activity eq 'chat' ||
          $activity eq 'groups' || $activity eq 'printout' ||           $activity eq 'groups' || $activity eq 'printout' ||
          $activity eq 'search' || $activity eq 'reinit' ||           $activity eq 'search' || $activity eq 'index' ||
          $activity eq 'alert') &&           $activity eq 'reinit' || $activity eq 'alert') &&
         ($env{'request.course.id'})) {          ($env{'request.course.id'})) {
         foreach my $key (keys(%live_courses)) {          foreach my $key (keys(%live_courses)) {
             if ($key ne $env{'request.course.id'}) {              if ($key ne $env{'request.course.id'}) {
Line 6103  END_MYBLOCK Line 6133  END_MYBLOCK
         $text = &mt('Gradebook Blocked');          $text = &mt('Gradebook Blocked');
     } elsif ($activity eq 'search') {      } elsif ($activity eq 'search') {
         $text = &mt('Search Blocked');          $text = &mt('Search Blocked');
       } elsif ($activity eq 'index') {
           $text = &mt('Content Index Blocked');
     } elsif ($activity eq 'alert') {      } elsif ($activity eq 'alert') {
         $text = &mt('Checking Critical Messages Blocked');          $text = &mt('Checking Critical Messages Blocked');
     } elsif ($activity eq 'reinit') {      } elsif ($activity eq 'reinit') {
Line 6536  Input: (optional) filename from which br Line 6568  Input: (optional) filename from which br
        If page header is being requested for use in a frameset, then         If page header is being requested for use in a frameset, then
        the second (option) argument -- frameset will be true, and         the second (option) argument -- frameset will be true, and
        the target attribute set for links should be target="_parent".         the target attribute set for links should be target="_parent".
        If $title is supplied as the thitd arg, that will be used to          If $title is supplied as the third arg, that will be used to 
        the left of the breadcrumbs tail for the current path.         the left of the breadcrumbs tail for the current path.
   
 Returns: HTML div with CSTR path and recent box  Returns: HTML div with CSTR path and recent box
Line 6862  sub bodytag { Line 6894  sub bodytag {
     my $hostname = $args->{'hostname'};      my $hostname = $args->{'hostname'};
   
     $function = &get_users_function() if (!$function);      $function = &get_users_function() if (!$function);
     my $img =    &designparm($function.'.img',$domain);  
     my $font =   &designparm($function.'.font',$domain);      my $font =   &designparm($function.'.font',$domain);
     my $pgbg   = $bgcolor || &designparm($function.'.pgbg',$domain);      my $pgbg   = $bgcolor || &designparm($function.'.pgbg',$domain);
   
Line 6916  sub bodytag { Line 6947  sub bodytag {
         $role = &Apache::lonnet::plaintext($role);          $role = &Apache::lonnet::plaintext($role);
     }      }
   
     if (!$realm) { $realm='&nbsp;'; }  
   
     my $extra_body_attr = &make_attr_string($forcereg,\%design);      my $extra_body_attr = &make_attr_string($forcereg,\%design);
   
 # construct main body tag  # construct main body tag
Line 6941  sub bodytag { Line 6970  sub bodytag {
                 undef($role);                  undef($role);
             }              }
             unless ($ltimenu->{'coursetitle'}) {              unless ($ltimenu->{'coursetitle'}) {
                 $realm='&nbsp;';  
                 $showcrstitle = 0;                  $showcrstitle = 0;
             }              }
         }          }
Line 6951  sub bodytag { Line 6979  sub bodytag {
                 undef($role);                  undef($role);
             }              }
             unless ($menuref->{'crs'}) {              unless ($menuref->{'crs'}) {
                 $realm='&nbsp;';  
                 $showcrstitle = 0;                  $showcrstitle = 0;
             }              }
         }          }
Line 6985  sub bodytag { Line 7012  sub bodytag {
         #        $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls          #        $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
         #    }          #    }
   
         $bodytag .= Apache::lonhtmlcommon::scripttag(          my $need_endlcint;
             Apache::lonmenu::utilityfunctions($httphost), 'start');          unless ($args->{'switchserver'}) {
               $bodytag .= Apache::lonhtmlcommon::scripttag(
                   Apache::lonmenu::utilityfunctions($httphost), 'start');
               $need_endlcint = 1;
           }
   
         my $collapsible;          my $collapsible;
         if ($args->{'collapsible_header'} ne '') {          if ($args->{'collapsible_header'} ne '') {
Line 7015  END Line 7046  END
                                                               $args->{'links_disabled'},                                                                $args->{'links_disabled'},
                                                               $args->{'links_target'},                                                                $args->{'links_target'},
                                                               $collapsible);                                                                $collapsible);
               my $labeltext = &HTML::Entities::encode(&mt('Primary links'));
             if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {              if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
                 if ($dc_info) {                  if ($dc_info) {
                     $dc_info = qq|<span class="LC_cusr_subheading">$dc_info</span>|;                      $dc_info = qq|<span class="LC_cusr_subheading">$dc_info</span>|;
                 }                  }
                 $bodytag .= qq|<div id="LC_nav_bar">$left $role<br />                  $bodytag .= qq|<div id="LC_nav_bar" role="navigation" aria-label="$labeltext">$left $role</div>|;
                                <em>$realm</em> $dc_info</div>|;                  unless (($realm eq '') && ($dc_info eq '')) {
                       $bodytag .= qq|<div id="LC_realm" role="complementary"><em>$realm</em> $dc_info</div>|;
                   }
                   if ($need_endlcint) {
                       $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
                   }
                 return $bodytag;                  return $bodytag;
             }              }
   
               $bodytag .= '<div class="LC_landmark" role="navigation" aria-label="'.$labeltext.'">';
             unless ($env{'request.symb'} =~ m/\.page___\d+___/) {              unless ($env{'request.symb'} =~ m/\.page___\d+___/) {
                 $bodytag .= qq|<div id="LC_nav_bar">$left $role</div>|;                  $bodytag .= qq|<div id="LC_nav_bar">$left $role</div>|;
             }              }
   
             $bodytag .= $right;              $bodytag .= $right.'</div>';
   
             if ($dc_info) {              if ($dc_info) {
                 $dc_info = &dc_courseid_toggle($dc_info);                  $dc_info = &dc_courseid_toggle($dc_info);
             }              }
             $bodytag .= qq|<div id="LC_realm">$realm $dc_info</div>|;              unless (($realm eq '') && ($dc_info eq '')) {
                   $bodytag .= qq|<div id="LC_realm">$realm $dc_info</div>|;
               }
         }          }
   
         #if directed to not display the secondary menu, don't.            #if directed to not display the secondary menu, don't.  
         if ($args->{'no_secondary_menu'}) {          if ($args->{'no_secondary_menu'}) {
               if ($need_endlcint) {
                   $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
               }
             return $bodytag;              return $bodytag;
         }          }
         #don't show menus for public users          #don't show menus for public users
Line 7051  END Line 7093  END
                                                             $args->{'links_target'});                                                              $args->{'links_target'});
             }              }
             $bodytag .= Apache::lonmenu::serverform();              $bodytag .= Apache::lonmenu::serverform();
             $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');              if ($need_endlcint) {
                   $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
               }
             if ($env{'request.state'} eq 'construct') {              if ($env{'request.state'} eq 'construct') {
                 $bodytag .= &Apache::lonmenu::innerregister($forcereg,                  $bodytag .= &Apache::lonmenu::innerregister($forcereg,
                                 $args->{'bread_crumbs'},'','',$hostname,                                  $args->{'bread_crumbs'},'','',$hostname,
Line 7067  END Line 7111  END
                                                         $args->{'bread_crumbs'},                                                          $args->{'bread_crumbs'},
                                                         $advtoolsref,'',$hostname);                                                          $advtoolsref,'',$hostname);
             }              }
         }else{          } else {
             # this is to seperate menu from content when there's no secondary              # this is to separate menu from content when there's no secondary
             # menu. Especially needed for public accessible ressources.              # menu. Especially needed for publicly accessible resources.
             $bodytag .= '<hr style="clear:both" />';              $bodytag .= '<hr style="clear:both" />';
             $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');               if ($need_endlcint) {
                   $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
               }
         }          }
         if ($args->{'collapsible_header'} ne '') {          if ($args->{'collapsible_header'} ne '') {
             $bodytag .= $args->{'collapsible_header'}.              $bodytag .= $args->{'collapsible_header'}.
Line 7206  Inputs: (all optional) Line 7252  Inputs: (all optional)
 sub standard_css {  sub standard_css {
     my ($function,$domain,$bgcolor) = @_;      my ($function,$domain,$bgcolor) = @_;
     $function  = &get_users_function() if (!$function);      $function  = &get_users_function() if (!$function);
     my $img    = &designparm($function.'.img',   $domain);  
     my $tabbg  = &designparm($function.'.tabbg', $domain);      my $tabbg  = &designparm($function.'.tabbg', $domain);
     my $font   = &designparm($function.'.font',  $domain);      my $font   = &designparm($function.'.font',  $domain);
     my $fontmenu = &designparm($function.'.fontmenu', $domain);      my $fontmenu = &designparm($function.'.fontmenu', $domain);
Line 7259  body { Line 7304  body {
   line-height:130%;    line-height:130%;
   font-size:0.83em;    font-size:0.83em;
   color:$font;    color:$font;
     background-color: $pgbg_or_bgcolor;
 }  }
   
 a:focus,  a:focus,
Line 7270  form, .inline { Line 7316  form, .inline {
   display: inline;    display: inline;
 }  }
   
   .LC_landmark {
     margin: 0;
     padding: 0;
     border: none;
   }
   
   .LC_visually_hidden:not(:focus):not(:active) {
       clip-path: inset(50%);
       height: 1px;
       overflow: hidden;
       position: absolute;
       white-space: nowrap;
       width: 1px;
       display: inline;
   }
   
   .LC_heading_2 {
     font-size: 1.17em;
   }
   
 .LC_menus_content.shown{  .LC_menus_content.shown{
   display: block;    display: block;
 }  }
Line 7282  form, .inline { Line 7348  form, .inline {
   text-align:right;    text-align:right;
 }  }
   
   .LC_center {
     text-align:center;
   }
   
 .LC_middle {  .LC_middle {
   vertical-align:middle;    vertical-align:middle;
 }  }
Line 7934  table#LC_helpmenu fieldset legend { Line 8004  table#LC_helpmenu fieldset legend {
   font-size: larger;    font-size: larger;
 }  }
   
 table#LC_helpmenu_links {  .LC_helpdesk_headbox {
   width: 100%;    border: 2px groove threedface;
   border: 1px solid black;    padding: 1em;
   }
   
   h1.LC_helpdesk_legend {
     float: left;
     margin: -1.7em 0 0;
     padding: 0 .5em;
   background: $pgbg;    background: $pgbg;
     font-size: 1em;
     font-weight: bold;
   }
   
   h1.LC_helpdesk_title {
     display: inline;
     font-size: 1em;
     line-height: 2.5em;
     margin: 0;
   padding: 0;    padding: 0;
   border-spacing: 1px;    vertical-align: bottom;
 }  }
   
 table#LC_helpmenu_links tr td {  .LC_helpdesk_links {
   padding: 1px;    border: 1px solid black;
     padding: 3px;
   background: $tabbg;    background: $tabbg;
   text-align: center;    text-align: center;
   font-weight: bold;    font-weight: bold;
     display: inline;
     margin-right: -6px;
 }  }
   
 table#LC_helpmenu_links a:link,  .LC_helpdesk_img,
 table#LC_helpmenu_links a:visited,  .LC_helpdesk_text {
 table#LC_helpmenu_links a:active {    padding: 0;
     margin: 0;
     border: 0;
     display: inline;
   }
   
   .LC_helpdesk_img a:link,
   .LC_helpdesk_img a:visited,
   .LC_helpdesk_img a:active,
   .LC_helpdesk_text a:link,
   .LC_helpdesk_text a:visited,
   .LC_helpdesk_text a:active {
   text-decoration: none;    text-decoration: none;
   color: $font;    color: $font;
 }  }
   
 table#LC_helpmenu_links a:hover {  div.LC_helpdesk_text a:hover {
   text-decoration: underline;    text-decoration: underline;
   color: $vlink;    color: $vlink;
 }  }
Line 7983  table.LC_pick_box { Line 8082  table.LC_pick_box {
   border-spacing: 1px;    border-spacing: 1px;
 }  }
   
 table.LC_pick_box td.LC_pick_box_title {  table.LC_pick_box th.LC_pick_box_title {
   background: $sidebg;    background: $sidebg;
   font-weight: bold;    font-weight: bold;
   text-align: left;    text-align: left;
Line 8186  table.LC_prior_tries td { Line 8285  table.LC_prior_tries td {
   padding: 6px;    padding: 6px;
 }  }
   
   .LC_prob_status {
     margin-top: 5px;
     padding-top: 0;
     padding-left: 0;
     padding-bottom: 0;
     padding-right: 5px;
   }
   
   .LC_mail_actions {
     float: left;
     padding: 0;
     margin: 6px;
   }
   
   .LC_vertical_line {
     width: 1px;
     background-color: black;
     height: 4em;
     float: left;
     margin: 0;
     padding: 0;
   }
   
 span.LC_prior_numerical,  span.LC_prior_numerical,
 span.LC_prior_string,  span.LC_prior_string,
 span.LC_prior_custom,  span.LC_prior_custom,
Line 9076  ul#LC_toolbar { Line 9198  ul#LC_toolbar {
   padding: 0;    padding: 0;
   margin: 2px;    margin: 2px;
   list-style:none;    list-style:none;
   position:relative;    display:inline;
   background-color:white;    background-color:white;
   overflow: auto;    overflow: auto;
 }  }
Line 9104  a.LC_toolbarItem { Line 9226  a.LC_toolbarItem {
   background-color:transparent;    background-color:transparent;
 }  }
   
   .LC_navtools {
     display: inline-block;
     padding: 0;
     margin: 2px;
     vertical-align: middle;
   }
   
 ul.LC_funclist {  ul.LC_funclist {
     margin: 0;      margin: 0;
     padding: 0.5em 1em 0.5em 0;      padding: 0.5em 1em 0.5em 0;
Line 9410  sub headtag { Line 9539  sub headtag {
         $inhibitprint = &print_suppression();          $inhibitprint = &print_suppression();
     }      }
   
     if (!$args->{'frameset'}) {      if (!$args->{'frameset'} && !$args->{'switchserver'}) {
  $result .= &Apache::lonhtmlcommon::htmlareaheaders();   $result .= &Apache::lonhtmlcommon::htmlareaheaders();
     }      }
     if ($args->{'force_register'} && $env{'request.noversionuri'} !~ m{^/res/adm/pages/}) {      if ($args->{'force_register'} && $env{'request.noversionuri'} !~ m{^/res/adm/pages/}) {
Line 9418  sub headtag { Line 9547  sub headtag {
     }      }
     if (!$args->{'no_nav_bar'}       if (!$args->{'no_nav_bar'} 
  && !$args->{'only_body'}   && !$args->{'only_body'}
  && !$args->{'frameset'}) {   && !$args->{'frameset'}
    && !$args->{'switchserver'}) {
  $result .= &help_menu_js($httphost);   $result .= &help_menu_js($httphost);
         $result.=&modal_window();          $result.=&modal_window();
         $result.=&togglebox_script();          $result.=&togglebox_script();
Line 9614  OFFLOAD Line 9744  OFFLOAD
  $title = 'The LearningOnline Network with CAPA';   $title = 'The LearningOnline Network with CAPA';
     }      }
     if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }      if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
     $result .= '<title> LON-CAPA '.$title.'</title>'      if ($title =~ /^LON-CAPA\s+/) {
  .'<link rel="stylesheet" type="text/css" href="'.$url.'"';          $result .= '<title> '.$title.'</title>';
       } else {
           $result .= '<title> LON-CAPA '.$title.'</title>';
       }
       $result .= "\n".'<link rel="stylesheet" type="text/css" href="'.$url.'"';
     if (!$args->{'frameset'}) {      if (!$args->{'frameset'}) {
         $result .= ' /';          $result .= ' /';
     }      }
Line 9630  OFFLOAD Line 9764  OFFLOAD
     }      }
     if ($clientmobile) {      if ($clientmobile) {
         $result .= '          $result .= '
 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta name="apple-mobile-web-app-capable" content="yes" />';  <meta name="apple-mobile-web-app-capable" content="yes" />';
     }      }
     $result .= '<meta name="google" content="notranslate" />'."\n";      $result .= '<meta name="google" content="notranslate"';
       if (!$args->{'frameset'}) {
           $result .= ' /';
       }
       $result .= '>'."\n";
     return $result.'</head>';      return $result.'</head>';
 }  }
   
Line 9814  $args - additional optional args support Line 9952  $args - additional optional args support
              no_auto_mt_title -> prevent &mt()ing the title arg               no_auto_mt_title -> prevent &mt()ing the title arg
              bread_crumbs ->             Array containing breadcrumbs               bread_crumbs ->             Array containing breadcrumbs
              bread_crumbs_component ->  if exists show it as headline else show only the breadcrumbs               bread_crumbs_component ->  if exists show it as headline else show only the breadcrumbs
                bread_crumbs_style -> breadcrumbs are contained within <div id="LC_breadcrumbs">,
                                      and &standard_css() contains CSS for #LC_breadcrumbs, if you want
                                      to override those values, or add to them, specify the value to
                                      include in the style attribute to include in the div tag by using
                                      bread_crumbs_style (e.g., overflow: visible)
              bread_crumbs_nomenu -> if true will pass false as the value of $menulink               bread_crumbs_nomenu -> if true will pass false as the value of $menulink
                                     to lonhtmlcommon::breadcrumbs                                      to lonhtmlcommon::breadcrumbs
              group          -> includes the current group, if page is for a                group          -> includes the current group, if page is for a 
Line 9982  sub start_page { Line 10125  sub start_page {
                 }                  }
  #if bread_crumbs_component exists show it as headline else show only the breadcrumbs   #if bread_crumbs_component exists show it as headline else show only the breadcrumbs
  if(exists($args->{'bread_crumbs_component'})){   if(exists($args->{'bread_crumbs_component'})){
  $result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'},'',$menulink);   $result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'},
                                                                          '',$menulink,'',
                                                                          $args->{'bread_crumbs_style'});
                 } else {                  } else {
  $result .= &Apache::lonhtmlcommon::breadcrumbs('','',$menulink);   $result .= &Apache::lonhtmlcommon::breadcrumbs('','',$menulink,'',
                                                                          $args->{'bread_crumbs_style'});
  }   }
         }          }
     }      }
Line 18966  sub needs_coursereinit { Line 19112  sub needs_coursereinit {
                     $update = 'supp';                      $update = 'supp';
                 }                  }
             }              }
             return ($update);  
         }          }
           return ($update);
     }      }
     return ();      return ();
 }  }
Line 19498  sub create_captcha { Line 19644  sub create_captcha {
         if (-e $Apache::lonnet::perlvar{'lonCaptchaDir'}.'/'.$md5sum.'.png') {          if (-e $Apache::lonnet::perlvar{'lonCaptchaDir'}.'/'.$md5sum.'.png') {
             $output = '<input type="hidden" name="crypt" value="'.$md5sum.'" />'."\n".              $output = '<input type="hidden" name="crypt" value="'.$md5sum.'" />'."\n".
                       '<span class="LC_nobreak">'.                        '<span class="LC_nobreak">'.
                       &mt('Type in the letters/numbers shown below').'&nbsp;'.                        '<label>'.&mt('Type in the letters/numbers shown below').'&nbsp;'.
                       '<input type="text" size="5" name="code" value="" autocomplete="new-password" />'.                        '<input type="text" size="5" name="code" value="" autocomplete="new-password" />'.
                       '</span><br />'.                        '</label></span><br />'.
                       '<img src="'.$captcha_params{'www_output_dir'}.'/'.$md5sum.'.png" alt="captcha" />';                        '<img src="'.$captcha_params{'www_output_dir'}.'/'.$md5sum.'.png" alt="captcha" />';
             last;              last;
         }          }

Removed from v.1.1431  
changed lines
  Added in v.1.1456


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