Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.67 and 1.71

version 1.67, 2004/04/23 17:49:25 version 1.71, 2004/06/02 16:41:46
Line 163  sub textbox { Line 163  sub textbox {
 ##############################################  ##############################################
 ##############################################  ##############################################
 sub checkbox {  sub checkbox {
     my ($name,$value) = @_;      my ($name,$checked,$value) = @_;
     my $Str = '<input type="checkbox" name="'.$name.'"'.      my $Str = '<input type="checkbox" name="'.$name.'" ';
  ($value?' checked="1"':'').' />';      if (defined($value)) {
           $Str .= 'value="'.$value.'"';
       } 
       if ($checked) {
           $Str .= ' checked="1"';
       }
       $Str .= ' />';
     return $Str;      return $Str;
 }  }
   
Line 862  sub crumbs { Line 868  sub crumbs {
 # ------------------------------------------------- Output headers for HTMLArea  # ------------------------------------------------- Output headers for HTMLArea
   
 sub htmlareaheaders {  sub htmlareaheaders {
     unless (&htmlareablocked()) { return ''; }      if (&htmlareablocked()) { return ''; }
     my $lang='en';      my $lang='en';
       if (&mt('htmlarea_lang') ne 'htmlarea_lang') {
    $lang=&mt('htmlarea_lang');
       }
     return (<<ENDHEADERS);      return (<<ENDHEADERS);
 <script type="text/javascript">  <script type="text/javascript">
     _editor_url="/htmlarea/";      _editor_url="/htmlarea/";
 </script>  </script>
 <script type="text/javascript" src="/htmlarea/htmlarea.js"></script>  <script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
 <script type="text/javascript" src="/htmlarea/lang/$lang.js"></script>  <style type="text/javascript">
 <script type="text/javascript" src="/htmlarea/dialog.js"></script>  _editor_url='/htmlarea/';
 <style type="text/css">  _editor_lang='$lang';
 \@import url(/htmlarea/htmlarea.css);  
 </style>  </style>
 ENDHEADERS  ENDHEADERS
 }  }
Line 880  ENDHEADERS Line 888  ENDHEADERS
 # ---------------------------------------------------------- Script to activate  # ---------------------------------------------------------- Script to activate
   
 sub htmlareaactive {  sub htmlareaactive {
     unless (&htmlareablocked()) { return ''; }      if (&htmlareablocked()) { return ''; }
     return (<<ENDSCRIPT);      return (<<ENDSCRIPT);
 <script type="text/javascript" defer="1">  <script type="text/javascript" defer="1">
     HTMLArea.replaceAll();      HTMLArea.replaceAll();
Line 891  ENDSCRIPT Line 899  ENDSCRIPT
 # --------------------------------------------------------------------- Blocked  # --------------------------------------------------------------------- Blocked
   
 sub htmlareablocked {  sub htmlareablocked {
     unless (&htmlareabrowser()) { return ''; }      unless (&htmlareabrowser()) { return 1; }
     return 1;      return 0;
 }  }
   
 # ---------------------------------------- Browser capable of running HTMLArea?  # ---------------------------------------- Browser capable of running HTMLArea?
Line 969  returns: nothing Line 977  returns: nothing
         # The last breadcrumb does not have a link, so handle it separately.          # The last breadcrumb does not have a link, so handle it separately.
         my $last = pop(@Crumbs);          my $last = pop(@Crumbs);
         #          #
         # The first one should be the course, I guess.          # The first one should be the course or a menu link
  if (!defined($menulink)) { $menulink=1; }   if (!defined($menulink)) { $menulink=1; }
         if ($menulink && exists($ENV{'request.course.id'}) && $ENV{'request.course.id'} ne '') {          if ($menulink) {
             my $cid = $ENV{'request.course.id'};              my $description = 'Menu';
               if (exists($ENV{'request.course.id'}) && 
                   $ENV{'request.course.id'} ne '') {
                   $description = 
                       $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
               }
             unshift(@Crumbs,{              unshift(@Crumbs,{
                              href=>'/adm/menu',                      href   =>'/adm/menu',
                              title=>'Go to main menu',                      title  =>'Go to main menu',
                              text=>$ENV{'course.'.$cid.'.description'},                      target =>'_top',
                             });                      text   =>$description,
                   });
         }          }
         my $links .=           my $links .= 
             join('-&gt;',              join('-&gt;',
                  map {                   map {
                      $faq = $_->{'faq'} if (exists($_->{'faq'}));                       $faq = $_->{'faq'} if (exists($_->{'faq'}));
                      $bug = $_->{'bug'} if (exists($_->{'bug'}));                       $bug = $_->{'bug'} if (exists($_->{'bug'}));
                      '<a href="'.$_->{'href'}.'" title="'.&mt($_->{'title'}).'">'.                       my $result = '<a href="'.$_->{'href'}.'" ';
                          &mt($_->{'text'}).'</a>'                        if (defined($_->{'target'}) && $_->{'target'} ne '') {
                            $result .= 'target="'.$_->{'target'}.'" ';
                        }
                        $result .='title="'.&mt($_->{'title'}).'">'.
                            &mt($_->{'text'}).'</a>';
                        $result;
                      } @Crumbs                       } @Crumbs
                  );                   );
         $links .= '-&gt;' if ($links ne '');          $links .= '-&gt;' if ($links ne '');

Removed from v.1.67  
changed lines
  Added in v.1.71


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