@@ -26,6 +26,7 module ApplicationHelper | |||||
26 | include GravatarHelper::PublicMethods |
|
26 | include GravatarHelper::PublicMethods | |
27 | include Redmine::Pagination::Helper |
|
27 | include Redmine::Pagination::Helper | |
28 | include Redmine::SudoMode::Helper |
|
28 | include Redmine::SudoMode::Helper | |
|
29 | include Redmine::Themes::Helper | |||
29 | include Redmine::Hook::Helper |
|
30 | include Redmine::Hook::Helper | |
30 |
|
31 | |||
31 | extend Forwardable |
|
32 | extend Forwardable |
@@ -114,19 +114,7 module Redmine | |||||
114 | end |
|
114 | end | |
115 | end |
|
115 | end | |
116 |
|
116 | |||
117 | private |
|
117 | module Helper | |
118 |
|
||||
119 | def self.scan_themes |
|
|||
120 | dirs = Dir.glob("#{Rails.public_path}/themes/*").select do |f| |
|
|||
121 | # A theme should at least override application.css |
|
|||
122 | File.directory?(f) && File.exist?("#{f}/stylesheets/application.css") |
|
|||
123 | end |
|
|||
124 | dirs.collect {|dir| Theme.new(dir)}.sort |
|
|||
125 | end |
|
|||
126 | end |
|
|||
127 | end |
|
|||
128 |
|
||||
129 | module ApplicationHelper |
|
|||
130 | def current_theme |
|
118 | def current_theme | |
131 | unless instance_variable_defined?(:@current_theme) |
|
119 | unless instance_variable_defined?(:@current_theme) | |
132 | @current_theme = Redmine::Themes.theme(Setting.ui_theme) |
|
120 | @current_theme = Redmine::Themes.theme(Setting.ui_theme) | |
@@ -141,3 +129,15 module ApplicationHelper | |||||
141 | end |
|
129 | end | |
142 | end |
|
130 | end | |
143 | end |
|
131 | end | |
|
132 | ||||
|
133 | private | |||
|
134 | ||||
|
135 | def self.scan_themes | |||
|
136 | dirs = Dir.glob("#{Rails.public_path}/themes/*").select do |f| | |||
|
137 | # A theme should at least override application.css | |||
|
138 | File.directory?(f) && File.exist?("#{f}/stylesheets/application.css") | |||
|
139 | end | |||
|
140 | dirs.collect {|dir| Theme.new(dir)}.sort | |||
|
141 | end | |||
|
142 | end | |||
|
143 | end |
General Comments 0
You need to be logged in to leave comments.
Login now