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

banghart lon-capa-cvs-allow@mail.lon-capa.org
Fri, 14 Sep 2007 23:24:19 -0000


banghart		Fri Sep 14 19:24:19 2007 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  	Bug 5408. Use the $form argument in crumbs. Submit form (if
  		present) to preserve import selections in lonindexer 
  		when navigating directories with breadcrumbs.
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.161 loncom/interface/lonhtmlcommon.pm:1.162
--- loncom/interface/lonhtmlcommon.pm:1.161	Wed Sep  5 01:00:24 2007
+++ loncom/interface/lonhtmlcommon.pm	Fri Sep 14 19:24:18 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.161 2007/09/05 05:00:24 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.162 2007/09/14 23:24:18 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1006,7 +1006,12 @@
 	    }	    
             my $href_path = &HTML::Entities::encode($path,'<>&"');
 	    &Apache::loncommon::inhibit_menu_check(\$href_path);
-	    $output.=qq{<a href="$href_path" $target>$dir</a>/};
+	    if ($form) {
+	        my $href = 'javascript:'.$form.".action='".$href_path."';".$form.'.submit();';
+	        $output.=qq{<a href="$href" $target>$dir</a>/};
+	    } else {
+	        $output.=qq{<a href="$href_path" $target>$dir</a>/};
+	    }
 	}
     } else {
 	foreach my $dir (split('/',$uri)) {