summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-28 09:47:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-28 09:47:09 +0000
commit68f8470d4af60c71d024059b96ad53f2968b1bf2 (patch)
tree37bdf896dda10271df9172636e9961ebaa858572 /app/helpers
parentda43f785bea5ef7f8cc985358e8204ad0e0c7fdc (diff)
downloadredmine-68f8470d4af60c71d024059b96ad53f2968b1bf2.tar.gz
redmine-68f8470d4af60c71d024059b96ad53f2968b1bf2.zip
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
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb6
1 files changed, 4 insertions, 2 deletions
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