Changeset 508 for trunk/core/lib/TWiki.pm
- Timestamp:
- 11/10/08 04:10:56 (4 years ago)
- File:
-
- 1 edited
-
trunk/core/lib/TWiki.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/lib/TWiki.pm
r504 r508 1260 1260 1261 1261 my $iconTopic = $this->{prefs}->getPreferencesValue('ICONTOPIC'); 1262 my ( $web, $topic ) = 1263 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1264 $iconName =~ s/^.*\.(.*?)$/$1/; 1265 return $this->getPubUrl( $absolute, $web, $topic, $iconName . '.gif' ); 1262 if (defined($iconTopic)) { 1263 my ( $web, $topic ) = 1264 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1265 $iconName =~ s/^.*\.(.*?)$/$1/; 1266 return $this->getPubUrl( $absolute, $web, $topic, $iconName . '.gif' ); 1267 } ele { 1268 return ''; 1269 } 1266 1270 } 1267 1271 … … 1283 1287 unless ( $this->{_ICONMAP} ) { 1284 1288 my $iconTopic = $this->{prefs}->getPreferencesValue('ICONTOPIC'); 1285 my ( $web, $topic ) = 1286 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1287 local $/ = undef; 1288 try { 1289 my $icons = 1290 $this->{store} 1291 ->getAttachmentStream( undef, $web, $topic, '_filetypes.txt' ); 1292 %{ $this->{_ICONMAP} } = split( /\s+/, <$icons> ); 1293 close($icons); 1294 } 1295 catch Error::Simple with { 1296 %{ $this->{_ICONMAP} } = (); 1297 }; 1289 if (defined($iconTopic)) { 1290 my ( $web, $topic ) = 1291 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1292 local $/ = undef; 1293 try { 1294 my $icons = 1295 $this->{store} 1296 ->getAttachmentStream( undef, $web, $topic, '_filetypes.txt' ); 1297 %{ $this->{_ICONMAP} } = split( /\s+/, <$icons> ); 1298 close($icons); 1299 } 1300 catch Error::Simple with { 1301 %{ $this->{_ICONMAP} } = (); 1302 }; 1303 } else { 1304 return $default || $fileName; 1305 } 1298 1306 } 1299 1307
Note: See TracChangeset
for help on using the changeset viewer.
