[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /homework grades.pm /interface lonaboutme.pm lonannounce.pm loncommon.pm londocs.pm lonquickgrades.pm lonremote.pm lonrss.pm portfolio.pm

raeburn raeburn@source.lon-capa.org
Mon, 15 Dec 2008 16:37:54 -0000


This is a MIME encoded message

--raeburn1229359074
Content-Type: text/plain

raeburn		Mon Dec 15 16:37:54 2008 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonaboutme.pm lonannounce.pm 
                     	londocs.pm lonquickgrades.pm lonremote.pm 
                     	lonrss.pm portfolio.pm 
    /loncom/homework	grades.pm 
    /loncom/auth	lonroles.pm 
  Log:
  - $brcrum is a reference to an anonymous array [] (use $brcrum not @brcrum).
  - add sanity checking to confirm that the arg passed was an array ref.
  - style
    - indentation
    - exists()
  
  
--raeburn1229359074
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20081215163754.txt"

Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.717 loncom/interface/loncommon.pm:1.718
--- loncom/interface/loncommon.pm:1.717	Mon Dec 15 11:44:41 2008
+++ loncom/interface/loncommon.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.717 2008/12/15 11:44:41 tempelho Exp $
+# $Id: loncommon.pm,v 1.718 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6031,13 +6031,14 @@
 		$result = &html_encode($result);
     }
 
-	if (exists $args->{'bread_crumbs'}) {
-		&Apache::lonhtmlcommon::clear_breadcrumbs();
-		my $temp = $args->{'bread_crumbs'};
-		foreach my $crumb (@$temp){
-			&Apache::lonhtmlcommon::add_breadcrumb($crumb);
-		}
-		$result .= &Apache::lonhtmlcommon::breadcrumbs();
+    if (exists($args->{'bread_crumbs'})) {
+        &Apache::lonhtmlcommon::clear_breadcrumbs();
+        if (ref($args->{'bread_crumbs'}) eq 'ARRAY') {         
+            foreach my $crumb (@{$args->{'bread_crumbs'}}){
+                &Apache::lonhtmlcommon::add_breadcrumb($crumb);
+            }
+        }
+        $result .= &Apache::lonhtmlcommon::breadcrumbs();
     }
 
     return $result;
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.84 loncom/interface/lonaboutme.pm:1.85
--- loncom/interface/lonaboutme.pm:1.84	Mon Dec 15 15:46:35 2008
+++ loncom/interface/lonaboutme.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.84 2008/12/15 15:46:35 raeburn Exp $
+# $Id: lonaboutme.pm,v 1.85 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -167,8 +167,8 @@
 
     if ($is_course) {
         if ($target ne 'tex') {
-			my @brcrum = [{href=>"/adm/navmaps",text=>"Navigate Course Contents"},
-						 {href=>"/adm/aboutme",text=>"Course Information"}];
+	    my $brcrum = [{href=>"/adm/navmaps",text=>"Navigate Course Contents"},
+			  {href=>"/adm/aboutme",text=>"Course Information"}];
             my $start_page =
                 &Apache::loncommon::start_page(
                     "Course Information",
@@ -176,7 +176,7 @@
                      {'function' => $env{'forcestudent'},
                       'domain'   => $cdom,
                       'force_register' => $env{'forceregister'},
-					   bread_crumbs => @brcrum});
+                      'bread_crumbs' => $brcrum});
             $r->print($start_page);
             $r->print('<h2>'.&mt('Group files').'</h2>');
             &print_portfiles_link($r,$is_course);
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.75 loncom/interface/lonannounce.pm:1.76
--- loncom/interface/lonannounce.pm:1.75	Wed Dec 10 21:46:58 2008
+++ loncom/interface/lonannounce.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.75 2008/12/10 21:46:58 kaisler Exp $
+# $Id: lonannounce.pm,v 1.76 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -538,8 +538,8 @@
 		  &dialscript().
 		  '<font size="1">');
     } else {
-		my @brcrum = 	[{href=>"/adm/announcements",text=>"Announcements and Calendar"}];
-		$r->print(&Apache::loncommon::start_page("Announcements and Calendar",$js,{'bread_crumbs' => @brcrum}));
+        my $brcrum = [{href=>"/adm/announcements",text=>"Announcements and Calendar"}];
+        $r->print(&Apache::loncommon::start_page("Announcements and Calendar",$js,{'bread_crumbs' => $brcrum}));
     }
 # does this user have privileges to post, etc?
     my $allowed=0;
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.323 loncom/interface/londocs.pm:1.324
--- loncom/interface/londocs.pm:1.323	Mon Dec 15 06:32:01 2008
+++ loncom/interface/londocs.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.323 2008/12/15 06:32:01 raeburn Exp $
+# $Id: londocs.pm,v 1.324 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2632,9 +2632,10 @@
     }
 # -------------------------------------------------------------------- Body tag
     $script = '<script type="text/javascript">'."\n".$script."\n".'</script>';
-	my @brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
+    my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
     $r->print(&Apache::loncommon::start_page("$type Documents", $script,
-					     {'force_register' => $showdoc, bread_crumbs => @brcrum}).
+				    {'force_register' => $showdoc,
+                                     'bread_crumbs' => $brcrum}).
 	      &Apache::loncommon::help_open_menu('','',273,'RAT'));
   
   my %allfiles = ();
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.45 loncom/interface/lonquickgrades.pm:1.46
--- loncom/interface/lonquickgrades.pm:1.45	Thu Dec 11 14:55:15 2008
+++ loncom/interface/lonquickgrades.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Quick Student Grades Display
 #
-# $Id: lonquickgrades.pm,v 1.45 2008/12/11 14:55:15 bisitz Exp $
+# $Id: lonquickgrades.pm,v 1.46 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -82,8 +82,10 @@
  
     # Header
     my $title = $showPoints ? "Points Display" : "Completed Problems Display";
-	my @brcrum = [{href=>"/adm/quickgrades",text => "Points Display"}];
-    $r->print(&Apache::loncommon::start_page($title,undef,{bread_crumbs => @brcrum}));
+    my $brcrum = [{href=>"/adm/quickgrades",text => "Points Display"}];
+    $r->print(&Apache::loncommon::start_page($title,undef,
+                                            {'bread_crumbs' => $brcrum})
+             );
 
     if (!$showPoints && !$notshowSPRSlink ) {
         $r->print('<p>'
Index: loncom/interface/lonremote.pm
diff -u loncom/interface/lonremote.pm:1.25 loncom/interface/lonremote.pm:1.26
--- loncom/interface/lonremote.pm:1.25	Wed Dec 10 21:46:58 2008
+++ loncom/interface/lonremote.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonremote.pm,v 1.25 2008/12/10 21:46:58 kaisler Exp $
+# $Id: lonremote.pm,v 1.26 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -64,12 +64,13 @@
 sub collapseremote {
     my ($r,$lowerurl)=@_;
 # -------------------------------------------------------- Menu script and info
-	my @brcrum = [{href=>"/adm/preferences",text=>"Set User Preferences"},
-				  {href=>"/adm/remote?url=/adm/preferences&action=collapse",text=>"Collapse Remote Control"}];
-    my $start_page = &Apache::loncommon::start_page('Collapse Remote Control',
-						    undef,
-						    {'bread_crumbs' => @brcrum,
-							 'no_inline_link' => 1,});
+    my $brcrum = [{href=>"/adm/preferences",text=>"Set User Preferences"},
+                  {href=>"/adm/remote?url=/adm/preferences&action=collapse",text=>"Collapse Remote Control"}];
+    my $start_page = 
+        &Apache::loncommon::start_page('Collapse Remote Control',
+                                       undef,
+                                       {'bread_crumbs' => $brcrum,
+                                        'no_inline_link' => 1,});
     my $end_page  =  &Apache::loncommon::end_page();
     my $windowinfo=&Apache::lonmenu::close();
 #    my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'">';
Index: loncom/interface/lonrss.pm
diff -u loncom/interface/lonrss.pm:1.41 loncom/interface/lonrss.pm:1.42
--- loncom/interface/lonrss.pm:1.41	Mon Dec 15 16:09:12 2008
+++ loncom/interface/lonrss.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # RSS Feeder
 #
-# $Id: lonrss.pm,v 1.41 2008/12/15 16:09:12 raeburn Exp $
+# $Id: lonrss.pm,v 1.42 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -323,12 +323,11 @@
 	my $title = $displayfeedname?$displayfeedname
                                     :"Available RSS Feeds and Blogs";
 	my $rss_link = &Apache::lonrss::rss_link($uname,$udom);
-	my @brcrumb = [{href=>$rss_link,text=>"Available RSS Feeds and Blogs"}];
+	my $brcrumb = [{href=>$rss_link,text=>"Available RSS Feeds and Blogs"}];
 	$r->print(&Apache::loncommon::start_page($title,$rss_link,
-						 {'bread_crumbs' => @brcrumb,
-						  'domain'         => $udom,
-						  'force_register' =>
-						      $env{'form.register'}}).
+			 {'bread_crumbs'   => $brcrumb,
+			  'domain'         => $udom,
+			  'force_register' => $env{'form.register'}}).
 		  &changed_js());
     } else { # render RSS
         my $server = &Apache::lonnet::absolute_url();
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.202 loncom/interface/portfolio.pm:1.203
--- loncom/interface/portfolio.pm:1.202	Wed Dec 10 21:46:58 2008
+++ loncom/interface/portfolio.pm	Mon Dec 15 16:37:44 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.202 2008/12/10 21:46:58 kaisler Exp $
+# $Id: portfolio.pm,v 1.203 2008/12/15 16:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2245,7 +2245,8 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
     # Give the LON-CAPA page header
-	my @brcrum = [{href=>"/adm/portfolio",text=>"Portfolio Manager"}];
+    my $brcrum = [{href=>"/adm/portfolio",text=>"Portfolio Manager"}];
+
     if ($env{"form.mode"} eq 'selectfile'){
         $r->print(&Apache::loncommon::start_page($title,undef,
 						 {'only_body' => 1}));
@@ -2253,7 +2254,8 @@
         $r->print(&Apache::loncommon::start_page('New role-based condition',undef,
                                                  {'no_nav_bar'  => 1, }));
     } else {
-        $r->print(&Apache::loncommon::start_page($title,undef,{bread_crumbs => @brcrum}));
+        $r->print(&Apache::loncommon::start_page($title,undef,
+                                                 {'bread_crumbs' => $brcrum}));
     }
     $r->rflush();
     if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) {
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.534 loncom/homework/grades.pm:1.535
--- loncom/homework/grades.pm:1.534	Wed Dec 10 21:46:54 2008
+++ loncom/homework/grades.pm	Mon Dec 15 16:37:49 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.534 2008/12/10 21:46:54 kaisler Exp $
+# $Id: grades.pm,v 1.535 2008/12/15 16:37:49 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8820,8 +8820,9 @@
     }
 
     $ssi_error = 0;
-	my @brcrum = [{href=>"/adm/grades",text=>"Grading"}];
-    $request->print(&Apache::loncommon::start_page('Grading',undef,{bread_crumbs => @brcrum}));
+    my $brcrum = [{href=>"/adm/grades",text=>"Grading"}];
+    $request->print(&Apache::loncommon::start_page('Grading',undef,
+                                          {'bread_crumbs' => $brcrum}));
     if ($symb eq '' && $command eq '') {
 	if ($env{'user.adv'}) {
 	    if (($env{'form.codeone'}) && ($env{'form.codetwo'}) &&
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.213 loncom/auth/lonroles.pm:1.214
--- loncom/auth/lonroles.pm:1.213	Wed Dec 10 21:46:50 2008
+++ loncom/auth/lonroles.pm	Mon Dec 15 16:37:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.213 2008/12/10 21:46:50 kaisler Exp $
+# $Id: lonroles.pm,v 1.214 2008/12/15 16:37:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -535,9 +535,9 @@
     $r->send_http_header;
     return OK if $r->header_only;
 
-	my @brcrum =[{href=>"/admmm/roles",text=>"User Roles"}];
+    my $brcrum =[{href=>"/admm/roles",text=>"User Roles"}];
     my $swinfo=&Apache::lonmenu::rawconfig();
-    my $start_page=&Apache::loncommon::start_page('User Roles',undef,{bread_crumbs=>@brcrum});
+    my $start_page=&Apache::loncommon::start_page('User Roles',undef,{bread_crumbs=>$brcrum});
     my $standby=&mt('Role selected. Please stand by.');
     $standby=~s/\n/\\n/g;
     my $noscript='<span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />';

--raeburn1229359074--