version 1.42, 2007/10/18 21:08:31
|
version 1.45, 2008/05/31 23:37:49
|
Line 182 sub mt (@) {
|
Line 182 sub mt (@) {
|
# print LOG (@_[0]."\n"); |
# print LOG (@_[0]."\n"); |
# close(LOG); |
# close(LOG); |
if ($lh) { |
if ($lh) { |
return $lh->maketext(@_); |
if ($_[0] eq '') { |
|
if (wantarray) { |
|
return @_; |
|
} else { |
|
return $_[0]; |
|
} |
|
} else { |
|
return $lh->maketext(@_); |
|
} |
} else { |
} else { |
if (wantarray) { |
if (wantarray) { |
return @_; |
return @_; |
Line 259 sub get_language_handle {
|
Line 267 sub get_language_handle {
|
|
|
# ========================================================== Localize localtime |
# ========================================================== Localize localtime |
sub gettimezone { |
sub gettimezone { |
my ($time) = @_; |
|
if ($Apache::lonnet::env{'course.'.$Apache::lonnet::env{'request.course.id'}.'.timezone'}) { |
if ($Apache::lonnet::env{'course.'.$Apache::lonnet::env{'request.course.id'}.'.timezone'}) { |
return $Apache::lonnet::env{'course.'.$Apache::lonnet::env{'request.course.id'}.'.timezone'}; |
return $Apache::lonnet::env{'course.'.$Apache::lonnet::env{'request.course.id'}.'.timezone'}; |
|
} elsif ($Apache::lonnet::env{'request.course.id'} ne '') { |
|
my $cdom = $Apache::lonnet::env{'course.'.$Apache::lonnet::env{'request.course.id'}.'.domain'}; |
|
if ($cdom ne '') { |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom); |
|
if ($domdefaults{'timezone_def'} ne '') { |
|
return $domdefaults{'timezone_def'}; |
|
} |
|
} |
} |
} |
return 'local'; |
return 'local'; |
} |
} |
Line 289 sub locallocaltime {
|
Line 304 sub locallocaltime {
|
my $day = $dt->day_of_month(); |
my $day = $dt->day_of_month(); |
my $mon = $dt->month()-1; |
my $mon = $dt->month()-1; |
my $year = $dt->year(); |
my $year = $dt->year(); |
my $wday = $dt->wday()-1; |
my $wday = $dt->wday(); |
|
if ($wday==7) { $wday=0; } |
my $month =(split(/\,/,$lh->maketext('date_months')))[$mon]; |
my $month =(split(/\,/,$lh->maketext('date_months')))[$mon]; |
my $weekday=(split(/\,/,$lh->maketext('date_days')))[$wday]; |
my $weekday=(split(/\,/,$lh->maketext('date_days')))[$wday]; |
if ($seconds<10) { |
if ($seconds<10) { |