Reload themes so that new themes can be used without restarting Redmine (#5712).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4432 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+12
-3
@@ -29,8 +29,13 @@ module Redmine
|
||||
end
|
||||
|
||||
# Return theme for given id, or nil if it's not found
|
||||
def self.theme(id)
|
||||
themes.find {|t| t.id == id}
|
||||
def self.theme(id, options={})
|
||||
found = themes.find {|t| t.id == id}
|
||||
if found.nil? && options[:rescan] != false
|
||||
rescan
|
||||
found = theme(id, :rescan => false)
|
||||
end
|
||||
found
|
||||
end
|
||||
|
||||
# Class used to represent a theme
|
||||
@@ -45,7 +50,11 @@ module Redmine
|
||||
|
||||
# Directory name used as the theme id
|
||||
def id; dir end
|
||||
|
||||
|
||||
def ==(theme)
|
||||
theme.is_a?(Theme) && theme.dir == dir
|
||||
end
|
||||
|
||||
def <=>(theme)
|
||||
name <=> theme.name
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user