version 1.37, 2003/09/27 13:20:46
|
version 1.39, 2003/10/24 14:58:36
|
Line 70 sub dynamicmeta {
|
Line 70 sub dynamicmeta {
|
'comments' => 'app', |
'comments' => 'app', |
'usage' => 'cnt' |
'usage' => 'cnt' |
); |
); |
foreach (keys %evaldata) { |
while ($_=each(%evaldata)) { |
my ($item,$purl,$cat)=&Apache::lonnet::decode_symb($_); |
my ($item,$purl,$cat)=split(/___/,$_); |
### print "\n".$_.' - '.$item.'<br />'; |
### Apache->request->print("\n".$_.' - '.$item.'<br />'); |
if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; } |
if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; } |
unless ($listitems{$cat} eq 'app') { |
unless ($listitems{$cat} eq 'app') { |
if (defined($sum{$cat})) { |
if (defined($sum{$cat})) { |
$sum{$cat}+=$evaldata{$_}; |
$sum{$cat}+=$evaldata{$_}; |
Line 93 sub dynamicmeta {
|
Line 93 sub dynamicmeta {
|
} |
} |
} |
} |
my %returnhash=(); |
my %returnhash=(); |
foreach (keys %cnt) { |
while ($_=each(%cnt)) { |
if ($listitems{$_} eq 'avg') { |
if ($listitems{$_} eq 'avg') { |
$returnhash{$_}=int(($sum{$_}/$cnt{$_})*100.0+0.5)/100.0; |
$returnhash{$_}=int(($sum{$_}/$cnt{$_})*100.0+0.5)/100.0; |
} elsif ($listitems{$_} eq 'cnt') { |
} elsif ($listitems{$_} eq 'cnt') { |
Line 102 sub dynamicmeta {
|
Line 102 sub dynamicmeta {
|
$returnhash{$_}=$sum{$_}; |
$returnhash{$_}=$sum{$_}; |
} |
} |
$returnhash{$_.'_list'}=$concat{$_}; |
$returnhash{$_.'_list'}=$concat{$_}; |
### print "\n<hr />".$_.': '.$returnhash{$_}.'<br />'.$returnhash{$_.'_list'}; |
### Apache->request->print("\n<hr />".$_.': '.$returnhash{$_}.'<br />'.$returnhash{$_.'_list'}); |
} |
} |
return %returnhash; |
return %returnhash; |
} |
} |
Line 219 sub handler {
|
Line 219 sub handler {
|
|
|
# --------------------------------------------------------------- Render Output |
# --------------------------------------------------------------- Render Output |
my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta$/); |
my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta$/); |
my $creationdate=localtime( |
my $creationdate=&Apache::lonlocal::locallocaltime( |
&Apache::loncommon::unsqltime($content{'creationdate'})); |
&Apache::loncommon::unsqltime($content{'creationdate'})); |
my $lastrevisiondate=localtime( |
my $lastrevisiondate=&Apache::lonlocal::locallocaltime( |
&Apache::loncommon::unsqltime($content{'lastrevisiondate'})); |
&Apache::loncommon::unsqltime($content{'lastrevisiondate'})); |
my $language=&Apache::loncommon::languagedescription($content{'language'}); |
my $language=&Apache::loncommon::languagedescription($content{'language'}); |
my $mime=&Apache::loncommon::filedescription($content{'mime'}); |
my $mime=&Apache::loncommon::filedescription($content{'mime'}); |
Line 234 my $owner=$content{'owner'};
|
Line 234 my $owner=$content{'owner'};
|
$owner=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse; |
$owner=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse; |
my $versiondisplay=''; |
my $versiondisplay=''; |
if ($thisversion) { |
if ($thisversion) { |
$versiondisplay='Version: '.$thisversion. |
$versiondisplay=&mt('Version').': '.$thisversion. |
' (most recent version: '.$currentversion.')'; |
' ('.&mt('most recent version').': '.$currentversion.')'; |
} else { |
} else { |
$versiondisplay='Version: '.$currentversion; |
$versiondisplay='Version: '.$currentversion; |
} |
} |