mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-23 17:01:13 +00:00
Don't reopen ApplicationHelper (#20507).
git-svn-id: http://svn.redmine.org/redmine/trunk@14695 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9244f67e28
commit
12fe8a595f
@ -26,6 +26,7 @@ module ApplicationHelper
|
|||||||
include GravatarHelper::PublicMethods
|
include GravatarHelper::PublicMethods
|
||||||
include Redmine::Pagination::Helper
|
include Redmine::Pagination::Helper
|
||||||
include Redmine::SudoMode::Helper
|
include Redmine::SudoMode::Helper
|
||||||
|
include Redmine::Themes::Helper
|
||||||
include Redmine::Hook::Helper
|
include Redmine::Hook::Helper
|
||||||
|
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
|
|||||||
@ -114,19 +114,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
module Helper
|
||||||
|
|
||||||
def self.scan_themes
|
|
||||||
dirs = Dir.glob("#{Rails.public_path}/themes/*").select do |f|
|
|
||||||
# A theme should at least override application.css
|
|
||||||
File.directory?(f) && File.exist?("#{f}/stylesheets/application.css")
|
|
||||||
end
|
|
||||||
dirs.collect {|dir| Theme.new(dir)}.sort
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
module ApplicationHelper
|
|
||||||
def current_theme
|
def current_theme
|
||||||
unless instance_variable_defined?(:@current_theme)
|
unless instance_variable_defined?(:@current_theme)
|
||||||
@current_theme = Redmine::Themes.theme(Setting.ui_theme)
|
@current_theme = Redmine::Themes.theme(Setting.ui_theme)
|
||||||
@ -140,4 +128,16 @@ module ApplicationHelper
|
|||||||
javascript_include_tag current_theme.javascript_path('theme')
|
javascript_include_tag current_theme.javascript_path('theme')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def self.scan_themes
|
||||||
|
dirs = Dir.glob("#{Rails.public_path}/themes/*").select do |f|
|
||||||
|
# A theme should at least override application.css
|
||||||
|
File.directory?(f) && File.exist?("#{f}/stylesheets/application.css")
|
||||||
|
end
|
||||||
|
dirs.collect {|dir| Theme.new(dir)}.sort
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user