Changeset 507
- Timestamp:
- 11/10/08 04:10:29 (3 years ago)
- Location:
- branches/Release04x02/lib
- Files:
-
- 2 edited
-
TWiki.pm (modified) (2 diffs)
-
TWiki/Attach.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/Release04x02/lib/TWiki.pm
r506 r507 1238 1238 1239 1239 my $iconTopic = $this->{prefs}->getPreferencesValue('ICONTOPIC'); 1240 my ( $web, $topic ) = 1241 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1242 $iconName =~ s/^.*\.(.*?)$/$1/; 1243 return $this->getPubUrl( $absolute, $web, $topic, $iconName . '.gif' ); 1240 if (defined($iconTopic)) { 1241 my ( $web, $topic ) = 1242 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1243 $iconName =~ s/^.*\.(.*?)$/$1/; 1244 return $this->getPubUrl( $absolute, $web, $topic, $iconName . '.gif' ); 1245 } ele { 1246 return ''; 1247 } 1244 1248 } 1245 1249 … … 1261 1265 unless ( $this->{_ICONMAP} ) { 1262 1266 my $iconTopic = $this->{prefs}->getPreferencesValue('ICONTOPIC'); 1263 my ( $web, $topic ) = 1264 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1265 local $/ = undef; 1266 try { 1267 my $icons = 1268 $this->{store} 1269 ->getAttachmentStream( undef, $web, $topic, '_filetypes.txt' ); 1270 %{ $this->{_ICONMAP} } = split( /\s+/, <$icons> ); 1271 close($icons); 1272 } 1273 catch Error::Simple with { 1274 %{ $this->{_ICONMAP} } = (); 1275 }; 1267 if (defined($iconTopic)) { 1268 my ( $web, $topic ) = 1269 $this->normalizeWebTopicName( $this->{webName}, $iconTopic ); 1270 local $/ = undef; 1271 try { 1272 my $icons = 1273 $this->{store} 1274 ->getAttachmentStream( undef, $web, $topic, '_filetypes.txt' ); 1275 %{ $this->{_ICONMAP} } = split( /\s+/, <$icons> ); 1276 close($icons); 1277 } 1278 catch Error::Simple with { 1279 %{ $this->{_ICONMAP} } = (); 1280 }; 1281 } else { 1282 return $default || $fileName; 1283 } 1276 1284 } 1277 1285 -
branches/Release04x02/lib/TWiki/Attach.pm
r21 r507 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.
