Module: Redmine::Themes
- Defined in:
- lib/redmine/themes.rb
Overview
Defined Under Namespace
Modules: Helper Classes: Theme
Class Method Summary collapse
-
.rescan ⇒ Object
Rescan themes directory.
-
.theme(id, options = {}) ⇒ Object
Return theme for given id, or nil if it's not found.
-
.themes ⇒ Object
Return an array of installed themes.
Class Method Details
.rescan ⇒ Object
Rescan themes directory
27 28 29 |
# File 'lib/redmine/themes.rb', line 27 def self.rescan @@installed_themes = scan_themes end |
.theme(id, options = {}) ⇒ Object
Return theme for given id, or nil if it's not found
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/redmine/themes.rb', line 32 def self.theme(id, ={}) return nil if id.blank? found = themes.find {|t| t.id == id} if found.nil? && [:rescan] != false rescan found = theme(id, :rescan => false) end found end |
.themes ⇒ Object
Return an array of installed themes
22 23 24 |
# File 'lib/redmine/themes.rb', line 22 def self.themes @@installed_themes ||= scan_themes end |