Diff for /loncom/interface/loncommon.pm between versions 1.948.2.6 and 1.948.2.7

version 1.948.2.6, 2010/05/18 03:48:44 version 1.948.2.7, 2010/08/14 04:32:03
Line 900  sub select_language { Line 900  sub select_language {
             $langchoices{$code} = &plainlanguagedescription($id);              $langchoices{$code} = &plainlanguagedescription($id);
         }          }
     }      }
     return &select_form($selected,$name,%langchoices);      return &select_form($selected,$name,\%langchoices);
 }  }
   
 =pod  =pod
Line 1072  END Line 1072  END
   
 =pod  =pod
   
 =item * &help_open_topic($topic,$text,$stayOnPage,$width,$height)  =item * &help_open_topic($topic,$text,$stayOnPage,$width,$height,$imgid)
   
 Returns a string corresponding to an HTML link to the given help  Returns a string corresponding to an HTML link to the given help
 $topic, where $topic corresponds to the name of a .tex file in  $topic, where $topic corresponds to the name of a .tex file in
Line 1095  be useful for certain help topics with b Line 1095  be useful for certain help topics with b
 =cut  =cut
   
 sub help_open_topic {  sub help_open_topic {
     my ($topic, $text, $stayOnPage, $width, $height) = @_;      my ($topic, $text, $stayOnPage, $width, $height, $imgid) = @_;
     $text = "" if (not defined $text);      $text = "" if (not defined $text);
     $stayOnPage = 0 if (not defined $stayOnPage);      $stayOnPage = 0 if (not defined $stayOnPage);
     $width = 350 if (not defined $width);      $width = 350 if (not defined $width);
Line 1124  sub help_open_topic { Line 1124  sub help_open_topic {
     # (Always) Add the graphic      # (Always) Add the graphic
     my $title = &mt('Online Help');      my $title = &mt('Online Help');
     my $helpicon=&lonhttpdurl("/adm/help/help.png");      my $helpicon=&lonhttpdurl("/adm/help/help.png");
       if ($imgid ne '') {
           $imgid = ' id="'.$imgid.'"';
       }
     $template.=' <a target="_top" href="'.$link.'" title="'.$title.'">'      $template.=' <a target="_top" href="'.$link.'" title="'.$title.'">'
               .'<img src="'.$helpicon.'" border="0"'                .'<img src="'.$helpicon.'" border="0"'
               .' alt="'.&mt('Help: [_1]',$topic).'"'                .' alt="'.&mt('Help: [_1]',$topic).'"'
               .' title="'.$title.'" style="vertical-align:middle;"'                 .' title="'.$title.'" style="vertical-align:middle;"'.$imgid
               .' /></a>';                .' /></a>';
     if ($text ne "") {      if ($text ne "") {
         $template.='</span>';          $template.='</span>';
     }      }
     return $template;      return $template;
Line 1800  sub domain_select { Line 1803  sub domain_select {
  return &multiple_select_form($name,$value,4,\%domains);   return &multiple_select_form($name,$value,4,\%domains);
     } else {      } else {
  $domains{'select_form_order'} = [sort {lc($a) cmp lc($b) } (keys(%domains))];   $domains{'select_form_order'} = [sort {lc($a) cmp lc($b) } (keys(%domains))];
  return &select_form($name,$value,%domains);   return &select_form($name,$value,\%domains);
     }      }
 }  }
   
Line 1862  sub multiple_select_form { Line 1865  sub multiple_select_form {
   
 =pod  =pod
   
 =item * &select_form($defdom,$name,%hash)  =item * &select_form($defdom,$name,$hashref,$onchange)
   
 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 options from a hash option_name => displayed text.    allow a user to select options from a ref to a hash containing:
   option_name => displayed text. An optional $onchange can include
   a javascript onchange item, e.g., onchange="this.form.submit();"
   
 See lonrights.pm for an example invocation and use.  See lonrights.pm for an example invocation and use.
   
 =cut  =cut
   
 #-------------------------------------------  #-------------------------------------------
 sub select_form {  sub select_form {
     my ($def,$name,%hash) = @_;      my ($def,$name,$hashref,$onchange) = @_;
     my $selectform = "<select name=\"$name\" size=\"1\">\n";      return unless (ref($hashref) eq 'HASH');
       if ($onchange) {
           $onchange = ' onchange="'.$onchange.'"';
       }
       my $selectform = "<select name=\"$name\" size=\"1\"$onchange>\n";
     my @keys;      my @keys;
     if (exists($hash{'select_form_order'})) {      if (exists($hashref->{'select_form_order'})) {
  @keys=@{$hash{'select_form_order'}};          @keys=@{$hashref->{'select_form_order'}};
     } else {      } else {
  @keys=sort(keys(%hash));          @keys=sort(keys(%{$hashref}));
     }      }
     foreach my $key (@keys) {      foreach my $key (@keys) {
         $selectform.=          $selectform.=
     '<option value="'.&HTML::Entities::encode($key,'"<>&').'" '.      '<option value="'.&HTML::Entities::encode($key,'"<>&').'" '.
             ($key eq $def ? 'selected="selected" ' : '').              ($key eq $def ? 'selected="selected" ' : '').
                 ">".$hash{$key}."</option>\n";                  ">".$hashref->{$key}."</option>\n";
     }      }
     $selectform.="</select>";      $selectform.="</select>";
     return $selectform;      return $selectform;
Line 1902  sub display_filter { Line 1912  sub display_filter {
            &mt('Filter [_1]',             &mt('Filter [_1]',
    &select_form($env{'form.displayfilter'},     &select_form($env{'form.displayfilter'},
  'displayfilter',   'displayfilter',
  ('currentfolder' => 'Current folder/page',   {'currentfolder' => 'Current folder/page',
  'containing' => 'Containing phrase',   'containing' => 'Containing phrase',
  'none' => 'None'))).   'none' => 'None'})).
  '<input type="text" name="containingphrase" size="30" value="'.&HTML::Entities::encode($env{'form.containingphrase'}).'" /></span>';   '<input type="text" name="containingphrase" size="30" value="'.&HTML::Entities::encode($env{'form.containingphrase'}).'" /></span>';
 }  }
   
Line 3247  sub filecategoryselect { Line 3257  sub filecategoryselect {
     my ($name,$value)=@_;      my ($name,$value)=@_;
     return &select_form($value,$name,      return &select_form($value,$name,
  '' => &mt('Any category'),   '' => &mt('Any category'),
  map { $_,$_ } sort(keys(%category_extensions)));   {'' => &mt('Any category'), map { $_,$_ } sort(keys(%category_extensions))});
 }  }
   
 =pod  =pod
Line 6146  ol.LC_primary_menu a { Line 6156  ol.LC_primary_menu a {
   text-decoration: none;    text-decoration: none;
 }  }
   
   ol.LC_docs_parameters {
     margin-left: 0;
     padding: 0;
     list-style: none;
   }
   
   ol.LC_docs_parameters li {
     margin: 0;
     padding-right: 20px;
     display: inline;
   }
   
   ol.LC_docs_parameters li:before {
     content: "\\002022 \\0020";
   }
   
   li.LC_docs_parameters_title {
     font-weight: bold;
   }
   
   ol.LC_docs_parameters li.LC_docs_parameters_title:before {
     content: "";
   }
   
 ul#LC_secondary_menu {  ul#LC_secondary_menu {
   clear: both;    clear: both;
   color: $fontmenu;    color: $fontmenu;
Line 6319  ul.LC_CourseBreadcrumbs li a { Line 6353  ul.LC_CourseBreadcrumbs li a {
   font-size:90%;    font-size:90%;
 }  }
   
   ol#LC_MenuBreadcrumbs h1 {
     display: inline;
     font-size: 90%;
     line-height: 2.5em;
     margin: 0;
     padding: 0;
   }
   
 ol#LC_PathBreadcrumbs li a {  ol#LC_PathBreadcrumbs li a {
   text-decoration:none;    text-decoration:none;
   font-size:100%;    font-size:100%;
Line 6661  Inputs: none Line 6703  Inputs: none
 sub xml_begin {  sub xml_begin {
     my $output='';      my $output='';
   
     if ($env{'internal.start_page'}==1) {  
  &Apache::lonhtmlcommon::init_htmlareafields();  
     }  
   
     if ($env{'browser.mathml'}) {      if ($env{'browser.mathml'}) {
  $output='<?xml version="1.0"?>'   $output='<?xml version="1.0"?>'
             #.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>'."\n"              #.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>'."\n"
Line 8196  sub get_institutional_codes { Line 8234  sub get_institutional_codes {
     return;      return;
 }  }
   
   sub get_standard_codeitems {
       return ('Year','Semester','Department','Number','Section');
   }
   
 =pod  =pod
   
 =head1 Slot Helpers  =head1 Slot Helpers

Removed from v.1.948.2.6  
changed lines
  Added in v.1.948.2.7


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