version 1.270, 2010/04/12 01:22:49
|
version 1.275, 2010/06/09 14:55:22
|
Line 1049 sub Update_PrgWin {
|
Line 1049 sub Update_PrgWin {
|
|
|
# increment progress state |
# increment progress state |
sub Increment_PrgWin { |
sub Increment_PrgWin { |
my ($r,$prog_state,$extraInfo)=@_; |
my ($r,$prog_state,$extraInfo,$step)=@_; |
$$prog_state{'done'}++; |
if ($step !~ /^\d+$/) { |
|
$step = 1; # default |
|
} |
|
$$prog_state{'done'} += $step; |
|
|
|
# Catch (max modulo step) <> 0 |
|
my $current = $$prog_state{'done'}; |
|
my $last = ($$prog_state{'max'} - $current); |
|
if ($last <= 0) { |
|
$last = 1; |
|
$current = $$prog_state{'max'}; |
|
} |
|
|
my $time_est= (&Time::HiRes::time() - $$prog_state{'firststart'})/ |
my $time_est= (&Time::HiRes::time() - $$prog_state{'firststart'})/ |
$$prog_state{'done'} * |
$current * $last; |
($$prog_state{'max'}-$$prog_state{'done'}); |
|
$time_est = int($time_est); |
$time_est = int($time_est); |
# |
# |
my $min = int($time_est/60); |
my $min = int($time_est/60); |
Line 1100 sub Increment_PrgWin {
|
Line 1111 sub Increment_PrgWin {
|
$$prog_state{'window'}.'.document.'. |
$$prog_state{'window'}.'.document.'. |
$$prog_state{'formname'}.'.'. |
$$prog_state{'formname'}.'.'. |
$$prog_state{'inputname'}.'.value="'. |
$$prog_state{'inputname'}.'.value="'. |
$$prog_state{'done'}.'/'.$$prog_state{'max'}. |
$current.'/'.$$prog_state{'max'}. |
': '.$time_est.' '.&mt('remaining').' '.$lasttime.'";' |
': '.$time_est.' '.&mt('remaining').' '.$lasttime.'";' |
)); |
)); |
$$prog_state{'laststart'}=&Time::HiRes::time(); |
$$prog_state{'laststart'}=&Time::HiRes::time(); |
Line 1481 returns: nothing
|
Line 1492 returns: nothing
|
my $lasttext = $last->{'no_mt'} ? $last->{'text'} |
my $lasttext = $last->{'no_mt'} ? $last->{'text'} |
: mt( $last->{'text'} ); |
: mt( $last->{'text'} ); |
|
|
$links .= htmltag( 'li', htmltag('b', $lasttext), {title => $lasttext}); |
# last breadcrumb is the first order heading of a page |
|
# for course breadcrumbs it's just bold |
|
$links .= htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', |
|
$lasttext), {title => $lasttext}); |
|
|
my $icons = ''; |
my $icons = ''; |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
Line 1993 sub resource_info_box {
|
Line 2007 sub resource_info_box {
|
my ($symb,$onlyfolderflag)=@_; |
my ($symb,$onlyfolderflag)=@_; |
my $return=''; |
my $return=''; |
if ($symb) { |
if ($symb) { |
my $title=&Apache::lonnet::gettitle($symb); |
|
$return=&Apache::loncommon::start_data_table(); |
$return=&Apache::loncommon::start_data_table(); |
unless ($onlyfolderflag) { |
|
$return.=&Apache::loncommon::start_data_table_row(). |
|
'<th>'.&mt('Resource:').'</th><td>'.$title.'</td>'. |
|
&Apache::loncommon::end_data_table_row(); |
|
} |
|
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($symb); |
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($symb); |
my $folder=&Apache::lonnet::gettitle($map); |
my $folder=&Apache::lonnet::gettitle($map); |
$return.=&Apache::loncommon::start_data_table_row(). |
$return.=&Apache::loncommon::start_data_table_row(). |
'<th>'.&mt('Folder:').'</th><td>'.$folder.'</td>'. |
'<th>'.&mt('Folder:').'</th><td>'.$folder.'</td>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table(); |
unless ($onlyfolderflag) { |
|
$return.=&Apache::loncommon::start_data_table_row(). |
|
'<th>'.&mt('Resource:').'</th><td>'.&Apache::lonnet::gettitle($symb).'</td>'. |
|
&Apache::loncommon::end_data_table_row(); |
|
} |
|
$return.=&Apache::loncommon::end_data_table(); |
} else { |
} else { |
$return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>'; |
$return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>'; |
} |
} |
Line 2393 returns: XHTML list as String.
|
Line 2406 returns: XHTML list as String.
|
# \@items, {listattr => { class => 'abc', id => 'xyx' }, itemattr => {class => 'abc', id => 'xyx'}} |
# \@items, {listattr => { class => 'abc', id => 'xyx' }, itemattr => {class => 'abc', id => 'xyx'}} |
sub list_from_array { |
sub list_from_array { |
my ($items, $args) = @_; |
my ($items, $args) = @_; |
|
return unless scalar @$items; |
my ($ul, $li) = inittags( qw(ul li) ); |
my ($ul, $li) = inittags( qw(ul li) ); |
my $listitems = join '', map { $li->($_, $args->{itemattr}) } @$items; |
my $listitems = join '', map { $li->($_, $args->{itemattr}) } @$items; |
return $ul->( $listitems, $args->{listattr} ); |
return $ul->( $listitems, $args->{listattr} ); |