Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.69 and 1.74

version 1.69, 2004/05/06 17:54:11 version 1.74, 2004/06/04 16:05:47
Line 868  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/';
   _editor_lang='$lang';
 </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>  
 <script type="text/javascript" src="/htmlarea/dialog.js"></script>  
 <style type="text/css">  
 \@import url(/htmlarea/htmlarea.css);  
 </style>  
 ENDHEADERS  ENDHEADERS
 }  }
   
   # ------------------------------------------------- Activate additional buttons
   
   sub htmlareaaddbuttons {
       if (&htmlareablocked()) { return ''; }
       return (<<ENDADDBUTTON);
       var config=new HTMLArea.Config();
       config.registerButton('ed_math','LaTeX Inline',
     '/htmlarea/images/ed_math.gif',false,
       function(editor,id) {
         editor.surroundHTML('<m>\$','\$</m>');
       }
     );
       config.registerButton('ed_math_eqn','LaTeX Equation',
     '/htmlarea/images/ed_math_eqn.gif',false,
       function(editor,id) {
         editor.surroundHTML('<br /><m>\\\\[','\\\\]</m><br />');
       }
     );
       config.toolbar.push(['ed_math','ed_math_eqn']);
   ENDADDBUTTON
   }
 # ---------------------------------------------------------- Script to activate  # ---------------------------------------------------------- Script to activate
   
 sub htmlareaactive {  sub htmlareaactive {
     unless (&htmlareablocked()) { return ''; }      if (&htmlareablocked()) { return ''; }
       my $addbuttons=&htmlareaaddbuttons();
     return (<<ENDSCRIPT);      return (<<ENDSCRIPT);
 <script type="text/javascript" defer="1">  <script type="text/javascript" defer="1">
     HTMLArea.replaceAll();      $addbuttons
       HTMLArea.replaceAll(config);
 </script>  </script>
 ENDSCRIPT  ENDSCRIPT
 }  }
   
   # ----------------------------------------- Script to activate only some fields
   
   sub htmlareaselectactive {
       my @fields=@_;
       if (&htmlareablocked()) { return ''; }
       my $output='<script type="text/javascript" defer="1">'.
    &htmlareaaddbuttons();
       foreach(@fields) {
    $output.="\nHTMLArea.replace('$_',config);";
       }
       $output.="\nwindow.status='Activated Editfields';\n</script>";
       return $output;
   }
   
 # --------------------------------------------------------------------- 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 975  returns: nothing Line 1011  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',
                              target =>'_top',                      target =>'_top',
                              text   =>$ENV{'course.'.$cid.'.description'},                      text   =>$description,
                             });                  });
         }          }
         my $links .=           my $links .= 
             join('-&gt;',              join('-&gt;',

Removed from v.1.69  
changed lines
  Added in v.1.74


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