| Class | FileHandlers::GalleryHandler::GalleryInfo::Image |
| In: |
lib/webgen/plugins/filehandlers/gallery.rb
|
| Parent: | Object |
| filename | [R] | The name of the image file. |
# File lib/webgen/plugins/filehandlers/gallery.rb, line 113
113: def initialize( pagename, data, filename )
114: super( pagename, data )
115: @filename = filename
116: end
Returns the thumbnail image tag for the image.
# File lib/webgen/plugins/filehandlers/gallery.rb, line 119
119: def thumbnail( attr = {} )
120: attr = attr.collect {|k,v| "#{k}='#{v}'"}.join( ' ' )
121: if !@data['thumbnail'].to_s.empty? && @data['thumbnail'] != @filename
122: "<img src=\"{relocatable: #{@data['thumbnail']}}\" alt=\"#{@title}\" #{attr}/>"
123: else
124: width, height = (@data['thumbnailSize'] || '').split('x')
125: "<img src=\"{relocatable: #{@filename}}\" width=\"#{width}\" height=\"#{height}\" alt=\"#{@title}\" #{attr}/>"
126: end
127: end