| ');
if (defined($sone{$_})) { $r->print($sone{$_}."\n"); }
@@ -3199,14 +3434,18 @@ sub propath {
sub icon {
my ($file)=@_;
- my @file_ext = split(/\./,$file);
- my $curfext = $file_ext[-1];
- my $iconname="unknown.gif";
+ my $curfext = (split(/\./,$file))[-1];
+ my $iconname=$Apache::lonnet::perlvar{'lonIconsURL'}.'/unknown.gif';
my $embstyle = &Apache::loncommon::fileembstyle($curfext);
- # The unless conditional that follows is a bit of overkill
- $iconname = $curfext.".gif" unless
- (!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');
- return $Apache::lonnet::perlvar{'lonIconsURL'}."/$iconname";
+ if (!(!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn')) {
+ if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/'.
+ $Apache::lonnet::perlvar{'lonIconsURL'}.'/'.
+ $curfext.".gif") {
+ $iconname=$Apache::lonnet::perlvar{'lonIconsURL'}.'/'.
+ $curfext.".gif";
+ }
+ }
+ return $iconname;
}
=pod
|