From 68f8470d4af60c71d024059b96ad53f2968b1bf2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 28 Apr 2012 09:47:09 +0000 Subject: Makes image_tag pick the image from the current theme if it exists. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9560 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f54a85a02..50ecd1c27 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1065,14 +1065,16 @@ module ApplicationHelper super sources, options end - # Overrides Rails' image_tag with plugins support. + # Overrides Rails' image_tag with themes and plugins support. # Examples: - # image_tag('image.png') # => picks defaults image.png + # image_tag('image.png') # => picks image.png from the current theme or defaults # image_tag('image.png', :plugin => 'foo) # => picks image.png from plugin's assets # def image_tag(source, options={}) if plugin = options.delete(:plugin) source = "/plugin_assets/#{plugin}/images/#{source}" + elsif current_theme && current_theme.images.include?(source) + source = current_theme.image_path(source) end super source, options end -- cgit v1.2.3