--- loncom/interface/lonhtmlcommon.pm 2009/02/18 19:28:45 1.201 +++ loncom/interface/lonhtmlcommon.pm 2009/05/11 16:18:53 1.213 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.201 2009/02/18 19:28:45 droeschl Exp $ +# $Id: lonhtmlcommon.pm,v 1.213 2009/05/11 16:18:53 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"; + } +} ############################################## ############################################## @@ -285,7 +310,7 @@ sub checkbox { $Str .= 'value="'.$value.'"'; } if ($checked) { - $Str .= ' checked="1"'; + $Str .= ' checked="checked"'; } $Str .= ' />'; return $Str; @@ -307,7 +332,7 @@ sub radio { $Str .= 'value="'.$value.'"'; } if ($checked eq $value) { - $Str .= ' checked="1"'; + $Str .= ' checked="checked"'; } $Str .= ' />'; return $Str; @@ -955,7 +980,7 @@ sub Create_PrgWin { popwin=open(\'\',\'popwin\',\'width=400,height=100\');". "popwin.document.writeln(\'".$start_page. "

".&mt("$heading")."<\/h4>". - "
". + "". '<\\/form>'.$end_page. "\');". @@ -1305,10 +1330,15 @@ returns: nothing my @Crumbs; sub breadcrumbs { - my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt) = @_; + my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $no_realBreadcrumb) = @_; # $css_class ||= 'LC_breadcrumbs'; my $Str1 = '
    '; + + if($no_realBreadcrumb){ + $Str1 = '
      '; + } + my $Str = ''; # # Make the faq and bug data cascade @@ -1316,7 +1346,7 @@ returns: nothing my $bug = ''; my $help=''; # Crumb Symbol - my $crumbsymbol = '▶ '; + my $crumbsymbol = '» '; # The last breadcrumb does not have a link, so handle it separately. my $last = pop(@Crumbs); # @@ -1339,7 +1369,7 @@ returns: nothing no_mt =>$no_mt_descr, }); } - my $links .= '
    • '. + my $links .= '
    • '. join('
    • '.$crumbsymbol, map { $faq = $_->{'faq'} if (exists($_->{'faq'})); @@ -1349,6 +1379,7 @@ returns: nothing if (defined($_->{'target'}) && $_->{'target'} ne '') { $result .= 'target="'.$_->{'target'}.'" '; } + # set the possible translation for title if ($_->{'no_mt'}) { $result .='title="'.$_->{'title'}.'">'. $_->{'text'}.''; @@ -1359,13 +1390,19 @@ returns: nothing $result; } @Crumbs ).'
    • '; - $links .= '
    • '.$crumbsymbol if ($links ne ''); +#Workaround for edit course. + if(@Crumbs == 0 ){ + $links .= '
    • ' if ($links ne ''); + } else { + $links .= '
    • '.$crumbsymbol if ($links ne ''); + } +#should the last Element be translated? if ($last->{'no_mt'}) { - $links .= ''.$last->{'text'}.'
    • '; + $links .= ''.$last->{'text'}.''; } else { - $links .= ''.&mt($last->{'text'}).''; + $links .= ''.&mt($last->{'text'}).''; } - # + $links .= ''; my $icons = ''; $faq = $last->{'faq'} if (exists($last->{'faq'})); $bug = $last->{'bug'} if (exists($last->{'bug'})); @@ -1383,7 +1420,13 @@ returns: nothing $faq,$bug); } # - $Str1 .= $links.'
'; + + + if($no_realBreadcrumb){ + $Str1 .= $links.''; + } else { + $Str1 .= $links.''; + } # if (defined($component)) { $Str .= "\n".'' @@ -1402,7 +1445,7 @@ returns: nothing # Return the @Crumbs stack to what we started with push(@Crumbs,$last); shift(@Crumbs); - # + # Return a table and after that the breadcrumb's line return "$Str\n$Str1"; } @@ -1505,9 +1548,9 @@ END } sub row_title { + my ($title,$css_title_class,$css_value_class) = @_; $row_count[0]++; my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row'; - my ($title,$css_title_class,$css_value_class) = @_; $css_title_class ||= 'LC_pick_box_title'; $css_title_class = 'class="'.$css_title_class.'"'; @@ -1766,7 +1809,7 @@ sub topic_bar { return '
'.&mt('Step [_1]',$imgnum).
-              '  + ' "src="/res/adm/pages/bl_step'.$imgnum.'.gif" />  '.$title.'
'; @@ -2091,15 +2134,15 @@ sub generate_menu { $img->("", { class => "LC_noBorder LC_middle", src => "/res/adm/pages/$$link{icon}", - alt => defined($$link{alttext}) ? - $$link{alttext} : $$link{linktext} + alt => mt(defined($$link{alttext}) ? + $$link{alttext} : $$link{linktext}) }), { href => $$link{url}, - title => $$link{linktitle} + title => mt($$link{linktitle}) }). - $a->($$link{linktext}, { + $a->(mt($$link{linktext}), { href => $$link{url}, - title => $$link{linktitle}, + title => mt($$link{linktitle}), class => "LC_menubuttons_link" }). (defined($$link{help}) ? @@ -2115,9 +2158,9 @@ sub generate_menu { #

title

  • ...
  • ...
# the category won't be added if there aren't any links push @categories, - $div->($h3->($$category{categorytitle}, {class=>"LC_hcell"}). + $div->($h3->(mt($$category{categorytitle}), {class=>"LC_hcell"}). $ul->(join('' ,@links), {class =>"LC_ListStyleNormal" }), - {class=>"LC_ContentBoxSpecial"}) if scalar(@links); + {class=>"LC_ContentBoxSpecial LC_400Box"}) if scalar(@links); } # wrap the joined @categories in another
(column layout)