[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonhtmlcommon.pm

droeschl droeschl@source.lon-capa.org
Wed, 10 Jun 2009 13:32:38 -0000


This is a MIME encoded message

--droeschl1244640758
Content-Type: text/plain

droeschl		Wed Jun 10 13:32:38 2009 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm loncommon.pm 
  Log:
  Changes related to modification of LON-CAPA screen header.
  - Moved the breadcrumbs "component" from its own table to the right of the breadcrumbs trail within the surrounding <div>.
  - removed unused styles.
  - changed breadcrumbs word wrap behavior.
  
  
--droeschl1244640758
Content-Type: text/plain
Content-Disposition: attachment; filename="droeschl-20090610133238.txt"

Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.222 loncom/interface/lonhtmlcommon.pm:1.223
--- loncom/interface/lonhtmlcommon.pm:1.222	Mon Jun  8 18:04:45 2009
+++ loncom/interface/lonhtmlcommon.pm	Wed Jun 10 13:32:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.222 2009/06/08 18:04:45 bisitz Exp $
+# $Id: lonhtmlcommon.pm,v 1.223 2009/06/10 13:32:38 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1314,15 +1314,13 @@
 =item breadcrumbs
 
 Compiles the previously registered breadcrumbs into an series of links.
-FAQ and BUG links will be placed on the left side of the table if they
-are defined for the last registered breadcrumb.  
 Additionally supports a 'component', which will be displayed on the
-right side of the table (without a link).
+right side of the breadcrumbs enclosing div (without a link).
 A link to help for the component will be included if one is specified.
 
 All inputs can be undef without problems.
 
-Inputs: $component (the large text on the right side of the table),
+Inputs: $component (the text on the right side of the breadcrumbs trail),
         $component_help
         $menulink (boolean, controls whether to include a link to /adm/menu)
         $helplink (if 'nohelp' don't include the orange help link)
@@ -1357,20 +1355,13 @@
         my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_;
         #
         $css_class ||= 'LC_breadcrumbs';
-        my $Str1 = '<div id="LC_head_subbox"><ol id="LC_MenuBreadcrumbs">';
-	
-		if($CourseBreadcrumbs){
-			$Str1 = '<ul id="LC_CourseBreadcrumbs">';
-		}
 
-        my $Str = '';
-        #
         # Make the faq and bug data cascade
-        my $faq = '';
-        my $bug = '';
-        my $help='';
+        my $faq  = '';
+        my $bug  = '';
+        my $help = '';
         # Crumb Symbol
-        my $crumbsymbol = '&raquo;&nbsp;';
+        my $crumbsymbol = '&raquo;';
         # The last breadcrumb does not have a link, so handle it separately.
         my $last = pop(@Crumbs);
         #
@@ -1405,30 +1396,26 @@
                      $help = $_->{'help'} if (exists($_->{'help'}));
 
                      my $result = htmltag( 'a', 
-                                           $_->{no_mt} ? $_->{text} : mt($_->{text}), 
+                                           $_->{no_mt} ? 
+                                            $_->{text} : mt($_->{text}), 
                                            { 
                                                href   => $_->{href},
-                                               title  => $_->{no_mt} ? $_->{title} : mt($_->{title}),
+                                               title  => $_->{no_mt} ? 
+                                                $_->{title} : mt($_->{title}),
                                                target => $_->{target},
                                            });
-                     $result = htmltag( 'li', $crumbsymbol.$result);
+                     $result = htmltag( 'li', "$result $crumbsymbol");
                      } @Crumbs;
-#Workaround for edit course. 
-	if(@Crumbs == 0 ){
-		$links .= '<li>' if ($links ne '');
-	} else {
-		$links .= '<li>'.$crumbsymbol if ($links ne '');
-	}
-#should the last Element be translated?
-	if ($last->{'no_mt'}) {
-	    $links .= '<b>'.$last->{'text'}.'</b>';
-	} else {
-	    $links .= '<b>'.&mt($last->{'text'}).'</b>';
-	}
-	$links .= '</li>';
+
+        #should the last Element be translated?
+        $links  .= htmltag( 'li', 
+                        htmltag( 'b', 
+                                 $last->{'no_mt'} ? 
+                                 $last->{'text'} : mt($last->{'text'}) ));
+
         my $icons = '';
-        $faq = $last->{'faq'} if (exists($last->{'faq'}));
-        $bug = $last->{'bug'} if (exists($last->{'bug'}));
+        $faq  = $last->{'faq'}  if (exists($last->{'faq'}));
+        $bug  = $last->{'bug'}  if (exists($last->{'bug'}));
         $help = $last->{'help'} if (exists($last->{'help'}));
         $component_help=($component_help?$component_help:$help);
 #        if ($faq ne '') {
@@ -1437,39 +1424,36 @@
 #        if ($bug ne '') {
 #            $icons .= &Apache::loncommon::help_open_bug($bug);
 #        }
-	if ($faq ne '' || $component_help ne '' || $bug ne '') {
-	    $icons .= &Apache::loncommon::help_open_menu($component,
-							 $component_help,
-							 $faq,$bug);
-	}
+        if ($faq ne '' || $component_help ne '' || $bug ne '') {
+            $icons .= &Apache::loncommon::help_open_menu($component,
+                                                         $component_help,
+                                                         $faq,$bug);
+        }
         #
 		
 
-		if($CourseBreadcrumbs){
-        	$Str1 .= $links.'</ul>';
-		} else {
-        	$Str1 .= $links.'</ol></div>';		
-		}
-        #
-        if (defined($component)) {
-            $Str .= "\n".'<table class="'.$css_class.'">'
-                   .'<tr><td class="'.$css_class.'_component">';
-            if ($no_mt) {
-                $Str .= $component;
-            } else {
-                $Str .= &mt($component);
-            }
-	    if ($icons ne '') {
-		$Str .= '&nbsp;'.$icons;
-	    }
-	    $Str .= '</td></tr></table>'."\n";
+        unless ($CourseBreadcrumbs) {
+            $links = htmltag('ol',  $links, { id => "LC_MenuBreadcrumbs"   });
+        } else {
+            $links = htmltag('ul',  $links, { id => "LC_CourseBreadcrumbs" });
         }
-        #
+
+        if ($component) {
+            $links = htmltag('span', 
+                             ( $no_mt ? $component : mt($component) ).
+                             ( $icons ? $icons : '' ),
+                             { class => 'LC_breadcrumbs_component' } )
+                             .$links;
+        }
+        
+        $links = htmltag('div', $links, 
+                        { id => "LC_head_subbox" }) unless ($CourseBreadcrumbs) ;
+
         # Return the @Crumbs stack to what we started with
         push(@Crumbs,$last);
         shift(@Crumbs);
-        # Return a table and after that the breadcrumb's line
-        return "$Str\n$Str1";
+        # Return the breadcrumb's line
+        return "$links";
     }
 
     sub clear_breadcrumbs {
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.841 loncom/interface/loncommon.pm:1.842
--- loncom/interface/loncommon.pm:1.841	Tue Jun  9 18:42:42 2009
+++ loncom/interface/loncommon.pm	Wed Jun 10 13:32:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.841 2009/06/09 18:42:42 tempelho Exp $
+# $Id: loncommon.pm,v 1.842 2009/06/10 13:32:38 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4747,14 +4747,6 @@
   margin: 0;
 }
 
-table.LC_docs_path {
-  width: 100%;
-  border: 0;
-  background: $pgbg;
-  border-collapse: collapse;
-  padding: 0;
-}
-
 table#LC_title_bar td {
   background: $tabbg;
 }
@@ -4798,19 +4790,12 @@
   text-align: center;
 }
 
-table.LC_breadcrumbs td,
-table.LC_docs_path td  {
-  background: $tabbg;
-  color: $fontmenu;
-  font-size: smaller;
+.LC_breadcrumbs_component {
+    float: right;
+    margin: 0 1em;
 }
-
-table.LC_breadcrumbs td.LC_breadcrumbs_component,
-table.LC_docs_path td.LC_docs_path_component {
-  background: $tabbg;
-  color: $fontmenu;
-  font-size: larger;
-  text-align: right;
+.LC_breadcrumbs_component img {
+    vertical-align: middle;
 }
 
 td.LC_table_cell_checkbox {
@@ -4829,7 +4814,6 @@
  clear:both;
  background: $sidebg;
  border-bottom: 1px solid $lg_border_color;
- height: 32px;
  line-height: 32px; 
  margin: 0;
  padding: 0;
@@ -6000,9 +5984,8 @@
 ol#LC_MenuBreadcrumbs li, 
 ol#LC_PathBreadcrumbs li, 
 ul#LC_CourseBreadcrumbs li {
-	display: inline;
-	padding: 0 0 0 10px;
-	overflow:hidden;
+    display: inline;
+    white-space: nowrap;
 }
 
 ol#LC_MenuBreadcrumbs li a,

--droeschl1244640758--