engines/adva_themes/lib/theme_support/asset_tag_helper.rb
# aliased to avoid conflicts with an image_path named route
aliased to avoid conflicts with an image_path named route
aliased to avoid conflicts with an image_path named route
def theme_image_tag(theme_id, source, options = {})
        theme = @controller.site.themes.find_by_theme_id(theme_id)
        return("could not find theme with the id #{theme_id}") unless theme
        options.symbolize_keys!
        options[:src] = theme_path_to_image(theme, source)
        options[:alt] ||= File.basename(options[:src], '.*').split('.').first.to_s.capitalize
        if size = options.delete(:size)
          options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$}
        end
        if mouseover = options.delete(:mouseover)
          options[:onmouseover] = "this.src='#{theme_image_path(theme, mouseover)}'"
          options[:onmouseout]  = "this.src='#{theme_image_path(theme, options[:src])}'"
        end
        tag("img", options)
      end
def theme_image_tag ( theme_id , source , options = { } ) theme = @controller . site . themes . find_by_theme_id ( theme_id ) return ( "could not find theme with the id #{theme_id}" ) unless theme options . symbolize_keys! options [ :src ] = theme_path_to_image ( theme , source ) options [ :alt ] ||= File . basename ( options [ :src ] , '.*' ) . split ( '.' ) . first . to_s . capitalize if size = options . delete ( :size ) options [ :width ] , options [ :height ] = size . split ( "x" ) if size =~ %r{ ^ \d +x \d +$ } end if mouseover = options . delete ( :mouseover ) options [ :onmouseover ] = "this.src='#{theme_image_path(theme, mouseover)}'" options [ :onmouseout ] = "this.src='#{theme_image_path(theme, options[:src])}'" end tag ( "img" , options ) end
aliased to avoid conflicts with an image_path named route
aliased to avoid conflicts with an image_path named route
theme_id
source
options