--- loncom/interface/lonhtmlcommon.pm 2008/10/07 10:13:58 1.182 +++ loncom/interface/lonhtmlcommon.pm 2009/08/23 12:59:18 1.182.4.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.182 2008/10/07 10:13:58 foxr Exp $ +# $Id: lonhtmlcommon.pm,v 1.182.4.8 2009/08/23 12:59:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -62,6 +62,31 @@ use Apache::lonlocal; use Apache::lonnet; use LONCAPA; +############################################## +############################################## + +=pod + +=item confirm_success + +Successful completion of an operation message + +=cut + +sub confirm_success { + my ($message,$failure)=@_; + if ($failure) { + return ''."\n" + .''.&mt('Error').' '."\n" + .$message."\n" + .''."\n"; + } else { + return ''."\n" + .''.&mt('OK').' '."\n" + .$message."\n" + .''."\n"; + } +} ############################################## ############################################## @@ -105,11 +130,13 @@ sub dragmath_js { my ($popup) = @_; return < + // ENDDRAGMATHJS @@ -285,7 +312,7 @@ sub checkbox { $Str .= 'value="'.$value.'"'; } if ($checked) { - $Str .= ' checked="1"'; + $Str .= ' checked="checked"'; } $Str .= ' />'; return $Str; @@ -307,7 +334,7 @@ sub radio { $Str .= 'value="'.$value.'"'; } if ($checked eq $value) { - $Str .= ' checked="1"'; + $Str .= ' checked="checked"'; } $Str .= ' />'; return $Str; @@ -405,6 +432,7 @@ sub date_setter { my $result = "\n\n"; $result .= < +// ENDJS $result .= ' '; @@ -476,23 +505,23 @@ ENDJS unshift(@Months,'If you can read this an error occurred'); if ($includeempty) { $monthselector.=""; } for(my $m = 1;$m <=$#Months;$m++) { - $monthselector .= qq{