version 1.96, 2004/11/19 19:31:13
|
version 1.100, 2004/11/30 08:06:38
|
Line 141 sub select_recent {
|
Line 141 sub select_recent {
|
return $return; |
return $return; |
} |
} |
|
|
|
sub get_recent { |
|
my ($area, $n) = @_; |
|
my %recent=&Apache::lonnet::dump(&recent_filename($area)); |
|
|
|
# Create hash with key as time and recent as value |
|
my %time_hash = (); |
|
foreach (keys %recent) { |
|
my $thistime=(split(/\&/,$recent{$_}))[0]; |
|
$time_hash{$thistime} = $_; |
|
} |
|
|
|
# Sort by decreasing time and return key value pairs |
|
my %return_hash = (); |
|
my $idx = 1; |
|
foreach (reverse sort keys %time_hash) { |
|
$return_hash{$time_hash{$_}} = |
|
&Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]); |
|
if ($n && ($idx++ >= $n)) {last;} |
|
} |
|
|
|
return %return_hash; |
|
} |
|
|
|
|
|
|
=pod |
=pod |
|
|
Line 875 sub crumbs {
|
Line 899 sub crumbs {
|
if (! defined($size)) { |
if (! defined($size)) { |
$size = '+2'; |
$size = '+2'; |
} |
} |
|
if ($target) { |
|
$target = ' target="'. |
|
&Apache::loncommon::escape_single($target).'"'; |
|
} |
my $output=''; |
my $output=''; |
unless ($noformat) { $output.='<br /><tt><b>'; } |
unless ($noformat) { $output.='<br /><tt><b>'; } |
$output.='<font size="'.$size.'">'.$prefix.'/'; |
$output.='<font size="'.$size.'">'.$prefix.'/'; |
if ($ENV{'user.adv'}) { |
if ($ENV{'user.adv'}) { |
my $path=$prefix.'/'; |
my $path=$prefix.'/'; |
foreach (split('/',$uri)) { |
foreach my $dir (split('/',$uri)) { |
unless ($_) { next; } |
if (! $dir) { next; } |
$path.=$_; |
$path .= $dir; |
unless ($path eq $uri) { $path.='/'; } |
unless ($path eq $uri) { $path.='/'; } |
my $linkpath=$path; |
my $linkpath = &Apache::loncommon::escape_single($path); |
if ($form) { |
if ($form) { |
my $escaped_path = &Apache::loncommon::escape_single($path); |
$linkpath= |
$linkpath="javascript:$form.action='$escaped_path';$form.submit();"; |
qq{javascript:$form.action='$linkpath';$form.submit();}; |
} |
} |
my $escaped_linkpath = &Apache::loncommon::escape_single($linkpath); |
$output.=qq{<a href="$linkpath" $target>$dir</a>/}; |
my $escaped_target = &Apache::loncommon::escape_single($target); |
|
$output.='<a href="'.$escaped_linkpath.'"'.($target?' target="'.$escaped_target.'"':'').'>'.$_.'</a>/'; |
|
} |
} |
} else { |
} else { |
$output.=$uri; |
$output.=$uri; |