--- loncom/interface/lonhtmlcommon.pm 2008/07/28 05:25:59 1.177 +++ loncom/interface/lonhtmlcommon.pm 2009/05/05 16:01:50 1.211 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.177 2008/07/28 05:25:59 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.211 2009/05/05 16:01:50 bisitz 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" + .' '."\n" + .$message."\n" + .''."\n"; + } else { + return ''."\n" + .' '."\n" + .$message."\n" + .''."\n"; + } +} ############################################## ############################################## @@ -84,8 +109,9 @@ sub dragmath_button { if ($helpicon) { $help_text = &Apache::loncommon::help_open_topic('Authoring_Math_Editor'); } + my $buttontext=&mt('Edit Math'); return <$help_text + $help_text ENDDRAGMATH } @@ -101,18 +127,20 @@ can be used to paste LaTeX into a textar =cut sub dragmath_js { + my ($popup) = @_; return < function mathedit(textarea, doc) { targetEntry = textarea; targetDoc = doc; - newwin = window.open("/adm/dragmath/applet/EditMathPopup.html","","width=565,height=500,resizable"); + newwin = window.open("/adm/dragmath/applet/$popup.html","","width=565,height=500,resizable"); } ENDDRAGMATHJS } + ############################################## ############################################## @@ -282,7 +310,7 @@ sub checkbox { $Str .= 'value="'.$value.'"'; } if ($checked) { - $Str .= ' checked="1"'; + $Str .= ' checked="checked"'; } $Str .= ' />'; return $Str; @@ -304,7 +332,7 @@ sub radio { $Str .= 'value="'.$value.'"'; } if ($checked eq $value) { - $Str .= ' checked="1"'; + $Str .= ' checked="checked"'; } $Str .= ' />'; return $Str; @@ -464,7 +492,7 @@ document.$formname.$dname\_year.value, } ENDJS - $result .= ' '; + $result .= ' '; my $monthselector = qq{\n|; + \n|; +