Class: CamaleonCms::Plugin
- Inherits:
-
TermTaxonomy
- Object
- TermTaxonomy
- CamaleonCms::Plugin
- Defined in:
- app/models/camaleon_cms/plugin.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
attrs: term_group => status active (1, nil) slug => plugin key name => plugin name.
Instance Method Summary collapse
-
#active ⇒ Object
active the plugin.
-
#active? ⇒ Boolean
check if plugin is active.
-
#inactive ⇒ Object
inactive the plugin.
-
#installed_version ⇒ Object
return gem installed version.
-
#installed_version=(version) ⇒ Object
set a new installation version for this plugin.
-
#old_version? ⇒ Boolean
check if current installation version is older return boolean.
-
#settings ⇒ Object
return theme settings configured in config.json.
-
#title ⇒ Object
return the title of this plugin.
Instance Attribute Details
#error ⇒ Object
attrs:
term_group => status active (1, nil)
slug => plugin key
name => plugin name
10 11 12 |
# File 'app/models/camaleon_cms/plugin.rb', line 10 def error @error end |
Instance Method Details
#active ⇒ Object
active the plugin
20 21 22 23 |
# File 'app/models/camaleon_cms/plugin.rb', line 20 def active self.term_group = 1 save end |
#active? ⇒ Boolean
check if plugin is active
32 33 34 |
# File 'app/models/camaleon_cms/plugin.rb', line 32 def active? term_group.to_s == '1' end |
#inactive ⇒ Object
inactive the plugin
26 27 28 29 |
# File 'app/models/camaleon_cms/plugin.rb', line 26 def inactive self.term_group = nil save end |
#installed_version ⇒ Object
return gem installed version
54 55 56 57 58 59 60 61 62 63 |
# File 'app/models/camaleon_cms/plugin.rb', line 54 def installed_version '' # res = get_option('version_installed') # unless res.present? # fix for old installations # res = settings['version'] # self.installed_version = res # end # res end |
#installed_version=(version) ⇒ Object
set a new installation version for this plugin
49 50 51 |
# File 'app/models/camaleon_cms/plugin.rb', line 49 def installed_version=(version) set_option('version_installed', version) end |
#old_version? ⇒ Boolean
check if current installation version is older return boolean
43 44 45 46 |
# File 'app/models/camaleon_cms/plugin.rb', line 43 def old_version? # self.installed_version.to_s != self.settings["version"].to_s false end |
#settings ⇒ Object
return theme settings configured in config.json
37 38 39 |
# File 'app/models/camaleon_cms/plugin.rb', line 37 def settings PluginRoutes.plugin_info(slug) end |
#title ⇒ Object
return the title of this plugin
66 67 68 |
# File 'app/models/camaleon_cms/plugin.rb', line 66 def title PluginRoutes.plugin_info(slug)['title'] end |