--- loncom/interface/lonhtmlcommon.pm 2008/07/28 05:25:59 1.177 +++ loncom/interface/lonhtmlcommon.pm 2009/11/24 06:23:14 1.182.2.2 @@ -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.182.2.2 2009/11/24 06:23:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -84,8 +84,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 +102,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 } + ############################################## ############################################## @@ -1089,7 +1092,7 @@ sub crumbs { my $output=''; unless ($noformat) { $output.='
'; } $output.=''.$prefix.'/'; - if ($env{'user.adv'}) { + if (($env{'user.adv'}) || ($env{'user.author'})) { my $path=$prefix.'/'; foreach my $dir (split('/',$uri)) { if (! $dir) { next; } @@ -1275,6 +1278,9 @@ Inputs: $component (the large text on th $menulink (boolean, controls whether to include a link to /adm/menu) $helplink (if 'nohelp' don't include the orange help link) $css_class (optional name for the class to apply to the table for CSS) + $no_mt (optional flag, 1 if &mt() is _not_ to be applied to $component + when including the text on the right. + Returns a string containing breadcrumbs for the current page. =item clear_breadcrumbs @@ -1300,7 +1306,7 @@ returns: nothing my @Crumbs; sub breadcrumbs { - my ($component,$component_help,$menulink,$helplink,$css_class) = @_; + my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt) = @_; # $css_class ||= 'LC_breadcrumbs'; my $Str = "\n".''; # if (defined($component)) { - $Str .= '
'; @@ -1309,6 +1315,8 @@ returns: nothing my $faq = ''; my $bug = ''; my $help=''; + # Crumb Symbol + my $crumbsymbol = ' ▶ '; # The last breadcrumb does not have a link, so handle it separately. my $last = pop(@Crumbs); # @@ -1332,7 +1340,7 @@ returns: nothing }); } my $links .= - join('->', + join($crumbsymbol, map { $faq = $_->{'faq'} if (exists($_->{'faq'})); $bug = $_->{'bug'} if (exists($_->{'bug'})); @@ -1351,7 +1359,7 @@ returns: nothing $result; } @Crumbs ); - $links .= '->' if ($links ne ''); + $links .= $crumbsymbol if ($links ne ''); if ($last->{'no_mt'}) { $links .= ''.$last->{'text'}.''; } else { @@ -1378,8 +1386,12 @@ returns: nothing $Str .= $links.''. - &mt($component); + $Str .= ''; + if ($no_mt) { + $Str .= $component; + } else { + $Str .= &mt($component); + } if ($icons ne '') { $Str .= ' '.$icons; } @@ -1480,6 +1492,13 @@ END return $output; } +sub row_headline { + my $output = <<"END"; +
+END + return $output; +} + sub row_title { my ($title,$css_title_class,$css_value_class) = @_; $css_title_class ||= 'LC_pick_box_title'; @@ -1726,6 +1745,25 @@ sub course_custom_roles { ############################################## ############################################## + +# topic_bar +# +# Generates a div containing a numbered (static image) followed by a title +# with a background color defined in the corresponding CSS: LC_topic_bar +# +sub topic_bar { + my ($imgnum,$title) = @_; + return ' +
+ '.&mt('Step [_1]',$imgnum).
+              '  + '.$title.' +
+'; +} + +############################################## +############################################## # echo_form_input #