--- loncom/interface/lonhtmlcommon.pm	2009/11/06 18:32:42	1.240
+++ loncom/interface/lonhtmlcommon.pm	2009/11/18 11:47:32	1.245
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.240 2009/11/06 18:32:42 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.245 2009/11/18 11:47:32 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1128,7 +1128,7 @@ sub crumbs {
     my $output='';
     unless ($noformat) { $output.='<br /><tt><b>'; }
     $output.='<font size="'.$size.'">'.$prefix.'/';
-    if ($env{'user.adv'}) {
+    if (($env{'user.adv'}) | ($env{'user.author'})) {
 	my $path=$prefix.'/';
 	foreach my $dir (split('/',$uri)) {
             if (! $dir) { next; }
@@ -1342,6 +1342,7 @@ returns: nothing
 ############################################################
 {
     my @Crumbs;
+    my %tools = ();
     
     sub breadcrumbs {
         my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_;
@@ -1438,8 +1439,12 @@ returns: nothing
                              .$links;
         }
         
+        #SD START (work in progress!)
+        add_tools(\$links);
+        #SD END
         $links = htmltag('div', $links, 
                         { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
+        add_advtools(\$links);
 
         # Return the @Crumbs stack to what we started with
         push(@Crumbs,$last);
@@ -1450,11 +1455,62 @@ returns: nothing
 
     sub clear_breadcrumbs {
         undef(@Crumbs);
+        undef(%tools);
     }
 
     sub add_breadcrumb {
         push(@Crumbs,@_);
     }
+    
+
+    #SD START (work in progress!)
+    sub add_breadcrumb_tool {
+        my ($category, $html) = @_;
+        return unless $html;
+        if (!defined(%tools)) { 
+            my %tools = ( A => [], B => [], C => []);
+        }
+        push @{$tools{$category}}, $html;
+    }
+
+    sub clear_breadcrumb_tools {
+        undef(%tools);
+    }
+
+    sub add_tools {
+        my ($links) = @_;
+        return unless defined %tools;
+        my $html = '<ul class="LC_bct">';
+        for my $category ('A','B') {
+            $html .= '<li class="LC_breadcrumb_tools">'
+                   . '<ul class="LC_breadcrumb_tools'
+                   . " LC_breadcrumb_tools_$category\">";
+            for my $item (@{$tools{$category}}){
+                #SD ugly! I'll fix that later on
+                $item =~ s/align="(right|left)"//;
+                $item =~ s/<span(.*?)\/span>//;
+                $html .= "<li>$item</li>";
+            }
+            $html .= '</li></ul>';
+            if ($category eq 'A') { $html .= "<li>$$links</li>"; }
+        }
+        $$links = $html.'</ul>';
+    }
+
+    sub add_advtools {
+        my ($links) = @_;
+        return unless (defined $tools{'C'}) and (scalar (@{$tools{'C'}}) > 0);
+        my $html = start_funclist();
+        for my $item (@{$tools{'C'}}){
+                next unless $item;
+                $item =~ s/align="(right|left)"//;
+                $html .= add_item_funclist($item);
+        }
+        $html   .= end_funclist();
+        $html    = Apache::loncommon::head_subbox($html);
+        $$links .= $html;
+    }
+    #SD END
 
 } # End of scope for @Crumbs
 
@@ -1547,7 +1603,7 @@ END
 }
 
 sub row_title {
-    my ($title,$css_title_class,$css_value_class) = @_;
+    my ($title,$css_title_class,$css_value_class, $css_value_furtherAttributes) = @_;
     $row_count[0]++;
     my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';
     $css_title_class ||= 'LC_pick_box_title';
@@ -1559,7 +1615,7 @@ sub row_title {
         $title .= ':';
     }
     my $output = <<"ENDONE";
-           <tr class="LC_pick_box_row">
+           <tr class="LC_pick_box_row" $css_value_furtherAttributes> 
             <td $css_title_class>
 	       $title
             </td>
@@ -2291,8 +2347,7 @@ Returns: HTML code with function list st
 sub start_funclist {
     my($legendtext)=@_;
     $legendtext=&mt('Functions') if !$legendtext;
-    return "<fieldset>\n<legend>$legendtext</legend>\n"
-          .'<ul class="LC_funclist">'."\n";
+    return '<ul class="LC_funclist"><li style="font-weight:bold; margin-left:0.8em;">'.$legendtext.'</li>'."\n";
 }