Module: Redmine::Themes

Defined in:
lib/redmine/themes.rb

Defined Under Namespace

Modules: Helper Classes: Theme

Class Method Summary collapse

Class Method Details

.rescanObject

Rescan themes directory



28
29
30
# File 'lib/redmine/themes.rb', line 28

def self.rescan
  @@installed_themes = scan_themes
end

.theme(id, options = {}) ⇒ Object

Return theme for given id, or nil if it’s not found



33
34
35
36
37
38
39
40
41
42
# File 'lib/redmine/themes.rb', line 33

def self.theme(id, options={})
  return nil if id.blank?

  found = themes.find {|t| t.id == id}
  if found.nil? && options[:rescan] != false
    rescan
    found = theme(id, :rescan => false)
  end
  found
end

.themesObject

Return an array of installed themes



23
24
25
# File 'lib/redmine/themes.rb', line 23

def self.themes
  @@installed_themes ||= scan_themes
end