--- loncom/interface/lonhtmlcommon.pm 2009/04/01 14:22:11 1.205
+++ loncom/interface/lonhtmlcommon.pm 2009/04/29 18:42:38 1.210
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.205 2009/04/01 14:22:11 amueller Exp $
+# $Id: lonhtmlcommon.pm,v 1.210 2009/04/29 18:42:38 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -62,6 +62,29 @@ 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 ''.
+ $message.
+ ' ';
+ } else {
+ return ''.
+ $message.
+ ' ';
+ }
+}
##############################################
##############################################
@@ -285,7 +308,7 @@ sub checkbox {
$Str .= 'value="'.$value.'"';
}
if ($checked) {
- $Str .= ' checked="1"';
+ $Str .= ' checked="checked"';
}
$Str .= ' />';
return $Str;
@@ -307,7 +330,7 @@ sub radio {
$Str .= 'value="'.$value.'"';
}
if ($checked eq $value) {
- $Str .= ' checked="1"';
+ $Str .= ' checked="checked"';
}
$Str .= ' />';
return $Str;
@@ -1344,7 +1367,7 @@ returns: nothing
no_mt =>$no_mt_descr,
});
}
- my $links .= '
'.
+ my $links .= ''.
join(''.$crumbsymbol,
map {
$faq = $_->{'faq'} if (exists($_->{'faq'}));
@@ -1354,6 +1377,7 @@ returns: nothing
if (defined($_->{'target'}) && $_->{'target'} ne '') {
$result .= 'target="'.$_->{'target'}.'" ';
}
+ # set the possible translation for title
if ($_->{'no_mt'}) {
$result .='title="'.$_->{'title'}.'">'.
$_->{'text'}.'';
@@ -1364,13 +1388,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'}));
@@ -1413,7 +1443,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";
}
@@ -1516,9 +1546,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.'"';