--- loncom/interface/lonhtmlcommon.pm 2003/12/29 17:11:53 1.35 +++ loncom/interface/lonhtmlcommon.pm 2004/01/01 20:13:17 1.38 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.35 2003/12/29 17:11:53 www Exp $ +# $Id: lonhtmlcommon.pm,v 1.38 2004/01/01 20:13:17 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -91,8 +91,9 @@ sub textbox { ############################################## ############################################## sub checkbox { - my ($name) = @_; - my $Str = '<input type="checkbox" name="'.$name.'" />'; + my ($name,$value) = @_; + my $Str = '<input type="checkbox" name="'.$name.'"'. + ($value?' checked="1"':'').' />'; return $Str; } @@ -437,11 +438,11 @@ sub StatusOptions { $Str .= ' size="'.$size.'" '; $Str .= '>'."\n"; $Str .= '<option value="Active" '.$OpSel1.'>'. - 'Currently Enrolled</option>'."\n"; + &mt('Currently Enrolled').'</option>'."\n"; $Str .= '<option value="Expired" '.$OpSel2.'>'. - 'Previously Enrolled</option>'."\n"; + &mt('Previously Enrolled').'</option>'."\n"; $Str .= '<option value="Any" '.$OpSel3.'>'. - 'Any Enrollment Status</option>'."\n"; + &mt('Any Enrollment Status').'</option>'."\n"; $Str .= '</select>'."\n"; } @@ -842,15 +843,16 @@ sub crumbs { my ($uri,$target,$prefix)=@_; my $output='<br /><tt><b><font size="+2">'.$prefix.'/'; if ($ENV{'user.adv'}) { - my $path=$prefix.'/'; + my $path=$prefix; foreach (split('/',$uri)) { unless ($_) { next; } - $path.=$_.'/'; + $path.='/'.$_; $output.='<a href="'.$path.'"'.($target?' target="'.$target.'"':'').'>'.$_.'</a>/'; } } else { $output.=$uri; } + unless ($uri=~/\/$/) { $output=~s/\/$//; } return $output.'</font></b></tt><br />'; }