Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.285 and 1.289

version 1.285, 2011/01/03 13:10:12 version 1.289, 2011/01/18 22:59:06
Line 60  use Time::Local; Line 60  use Time::Local;
 use Time::HiRes;  use Time::HiRes;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
   use HTML::Entities();
 use LONCAPA;  use LONCAPA;
   
 sub java_not_enabled {  sub java_not_enabled {
Line 83  sub raw_href_to_link { Line 84  sub raw_href_to_link {
    return $message;     return $message;
 }  }
   
   sub entity_encode {
       my ($text)=@_;
       return &HTML::Entities::encode($text, '<>&"');
   }
   
   sub direct_parm_link {
       my ($linktext,$symb,$filter,$part,$target)=@_;
       $symb=&entity_encode($symb);
       $filter=&entity_encode($filter);
       $part=&entity_encode($part);
       if (($symb) && (&Apache::lonnet::allowed('opa')) && ($target ne 'tex')) {
          return "<a href='/adm/parmset?symb=$symb&filter=$filter&part=$part'>$linktext</a>";
       } else {
          return $linktext;
       }
   }
 ##############################################  ##############################################
 ##############################################  ##############################################
   
Line 1407  sub htmlareabrowser { Line 1424  sub htmlareabrowser {
     return 1;      return 1;
 }  }
   
   #
   # Should the "return to content" link be shown?
   #
   
   sub show_return_link {
   
       unless ($env{'request.course.id'}) { return 0; }
       if ($env{'request.noversionuri'}=~m{^/priv/} ||
           $env{'request.uri'}=~m{^/~}) { return 1; }
   
       if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
           || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
   
           return if ($env{'form.register'});
       }
       return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&
                $env{'request.symb'} eq '')
               ||
               ($env{'request.noversionuri'}=~ m{^/cgi-bin/printout.pl})
               ||
               (($env{'request.noversionuri'}=~/^\/adm\//) &&
                ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
                ($env{'request.noversionuri'}!~
                 m{^/adm/.*/(smppg|bulletinboard)($|\?)})
              ));
   }
   
   
 ############################################################  ############################################################
 ############################################################  ############################################################
   
Line 1492  returns: nothing Line 1537  returns: nothing
                 $last = $menulink;                  $last = $menulink;
             }              }
         }          }
         my $links = join "",           my $links;
           if ((&show_return_link) && (!$CourseBreadcrumbs)) {
              $links=&htmltag( 'a',"<img src='/res/adm/pages/reload.png' border='0' style='vertical-align:middle;' />",
                               { href => '/adm/flip?postdata=return:',
                                 title => &mt("Back to most recent content resource") });
           }
           $links.= join "", 
              map {               map {
                  $faq  = $_->{'faq'}  if (exists($_->{'faq'}));                   $faq  = $_->{'faq'}  if (exists($_->{'faq'}));
                  $bug  = $_->{'bug'}  if (exists($_->{'bug'}));                   $bug  = $_->{'bug'}  if (exists($_->{'bug'}));
                  $help = $_->{'help'} if (exists($_->{'help'}));                   $help = $_->{'help'} if (exists($_->{'help'}));
   
                  my $result = $_->{no_mt} ? $_->{text} : mt($_->{text});                   my $result = $_->{no_mt} ? $_->{text} : &mt($_->{text});
   
                  if ($_->{href}){                   if ($_->{href}){
                      $result = htmltag( 'a', $result,                        $result = &htmltag( 'a', $result, 
                        { href   => $_->{href},                         { href   => $_->{href},
                          title  => $_->{no_mt} ? $_->{title} : mt($_->{title}),                           title  => $_->{no_mt} ? $_->{title} : &mt($_->{title}),
                          target => $_->{target}, });                           target => $_->{target}, });
                  }                   }
   
                  $result = htmltag( 'li', "$result $crumbsymbol");                   $result = &htmltag( 'li', "$result $crumbsymbol");
              } @Crumbs;               } @Crumbs;
   
         #should the last Element be translated?          #should the last Element be translated?
Line 1517  returns: nothing Line 1568  returns: nothing
   
         # last breadcrumb is the first order heading of a page          # last breadcrumb is the first order heading of a page
         # for course breadcrumbs it's just bold          # for course breadcrumbs it's just bold
         $links .= htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',          $links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
                 $lasttext), {title => $lasttext});                  $lasttext), {title => $lasttext});
   
         my $icons = '';          my $icons = '';
Line 1540  returns: nothing Line 1591  returns: nothing
   
   
         unless ($CourseBreadcrumbs) {          unless ($CourseBreadcrumbs) {
             $links = htmltag('ol',  $links, { id => "LC_MenuBreadcrumbs"   });              $links = &htmltag('ol',  $links, { id => "LC_MenuBreadcrumbs"   });
         } else {          } else {
             $links = htmltag('ul',  $links, { class => "LC_CourseBreadcrumbs" });              $links = &htmltag('ul',  $links, { class => "LC_CourseBreadcrumbs" });
         }          }
   
         if ($component) {          if ($component) {
             $links = htmltag('span',               $links = &htmltag('span', 
                              ( $no_mt ? $component : mt($component) ).                               ( $no_mt ? $component : mt($component) ).
                              ( $icons ? $icons : '' ),                               ( $icons ? $icons : '' ),
                              { class => 'LC_breadcrumbs_component' } )                               { class => 'LC_breadcrumbs_component' } )
                              .$links;                               .$links;
         }          }
                   
         render_tools(\$links);          &render_tools(\$links);
         $links = htmltag('div', $links,           $links = &htmltag('div', $links, 
                         { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;                          { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
         render_advtools(\$links);          &render_advtools(\$links);
   
         # Return the @Crumbs stack to what we started with          # Return the @Crumbs stack to what we started with
         push(@Crumbs,$last);          push(@Crumbs,$last);
Line 1611  returns: nothing Line 1662  returns: nothing
         @html = grep {defined $_ && $_ ne ''} @html;          @html = grep {defined $_ && $_ ne ''} @html;
         for (@html) {           for (@html) { 
             s/align="(right|left)"//;               s/align="(right|left)"//; 
             s/<span.*?\/span>// if $category ne 'advtools';   #            s/<span.*?\/span>// if $category ne 'advtools'; 
         }           } 
   
         push @{$tools{$category}}, @html;          push @{$tools{$category}}, @html;

Removed from v.1.285  
changed lines
  Added in v.1.289


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