Changeset 969
- Timestamp:
- 12/21/06 01:47:02 (2 years ago)
- Files:
-
- branches/wheeljack/lib/MT/Asset.pm (modified) (1 diff)
- branches/wheeljack/lib/MT/Asset/Image.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/wheeljack/lib/MT/Asset.pm
r968 r969 281 281 if (my $blog = $asset->blog) { 282 282 require File::Basename; 283 if (my $thumbnail_file = $asset->thumbnail_file(@_)) {283 if (my $thumbnail_file = $asset->thumbnail_file(@_)) { 284 284 my $file = File::Basename::basename($thumbnail_file); 285 285 my $site_url = $blog->site_url; branches/wheeljack/lib/MT/Asset/Image.pm
r966 r969 150 150 151 151 if ($param->{popup}) { 152 my $popup = MT::Asset->load($param->{popup_asset_id}) || 153 return $asset->error( 154 MT->translate("Can't load asset #[_1]", 155 $param->{popup_asset_id}) 156 ); 152 157 my $link = $thumb 153 158 ? sprintf('<img src="%s" %s alt="%s" />', … … 159 164 $text = sprintf( 160 165 q|<a href="%s" onclick="window.open('%s','popup','width=%d,height=%d,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">%s</a>|, 161 MT::Util::encode_html($ asset->url),162 MT::Util::encode_html($ asset->url),166 MT::Util::encode_html($popup->url), 167 MT::Util::encode_html($popup->url), 163 168 $asset->image_width, $asset->image_height, $link, 164 169 ); … … 295 300 my $i = 0; 296 301 while ($fmgr->exists($t_file)) { 297 $t_file = File::Spec->catfile($path . $base . '-thumb' . (++$i) . $ext); 302 $basename = $base . '-thumb' . (++$i) . $ext; 303 $t_file = File::Spec->catfile($path . $basename); 298 304 } 299 305 $fmgr->put_data($blob, $t_file, 'upload') … … 305 311 $url .= '/' unless $url =~ m!/$!; 306 312 $url .= $file; 307 $thumb = $url . MT::Util::encode_url($base . '-thumb' . $ext);313 $thumb = $url . MT::Util::encode_url($basename); 308 314 309 315 my $img_pkg = MT::Asset->handler_for_file($t_file); … … 401 407 $asset_html->parent($asset->id); 402 408 $asset_html->save; 409 410 $param->{popup_asset_id} = $asset_html->id; 411 403 412 MT->run_callbacks('CMSPostSave.asset', $app, $asset_html, $original); 404 413
