Changeset 508
- Timestamp:
- 11/10/08 04:10:56 (3 years ago)
- Location:
- trunk/core/lib
- Files:
-
- 2 edited
-
TWiki.pm (modified) (2 diffs)
-
TWiki/Attach.pm (modified) (1 diff)
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 -
trunk/core/lib/TWiki/Attach.pm
r411 r508 195 195 elsif ( $attr eq 'ICON' ) { 196 196 my $picked = $this->{session}->mapToIconFileName($file); 197 if (!defined($picked) || ($picked eq '')) { 198 return ''; 199 } 197 200 my $url = $this->{session}->getIconUrl( 0, $picked ); 198 201 return CGI::img(
Note: See TracChangeset
for help on using the changeset viewer.
