Class: ComfortableMexicanSofa::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/comfortable_mexican_sofa/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Configuration defaults



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 80

def initialize
  @cms_title            = "ComfortableMexicanSofa CMS Engine"
  @base_controller      = "ApplicationController"
  @admin_auth           = "ComfortableMexicanSofa::AccessControl::AdminAuthentication"
  @admin_authorization  = "ComfortableMexicanSofa::AccessControl::AdminAuthorization"
  @public_auth          = "ComfortableMexicanSofa::AccessControl::PublicAuthentication"
  @public_authorization = "ComfortableMexicanSofa::AccessControl::PublicAuthorization"
  @seed_data_path       = nil
  @admin_route_redirect = ""
  @enable_sitemap       = true
  @enable_seeds         = false
  @seeds_path           = File.expand_path("db/cms_seeds", Rails.root)
  @revisions_limit      = 25
  @locales              = {
    "ca"    => "Català",
    "cs"    => "Česky",
    "da"    => "Dansk",
    "de"    => "Deutsch",
    "en"    => "English",
    "es"    => "Español",
    "fi"    => "Suomi",
    "fr"    => "Français",
    "gr"    => "Ελληνικά",
    "it"    => "Italiano",
    "ja"    => "日本語",
    "nb"    => "Norsk",
    "nl"    => "Nederlands",
    "pl"    => "Polski",
    "pt-BR" => "Português Brasileiro",
    "ru"    => "Русский",
    "sk"    => "Slovensky",
    "sv"    => "Svenska",
    "tr"    => "Türkçe",
    "uk"    => "Українська",
    "zh-CN" => "简体中文",
    "zh-TW" => "正體中文"
  }
  @admin_locale         = nil
  @admin_cache_sweeper  = nil
  @allow_erb            = false
  @allowed_helpers      = nil
  @allowed_partials     = nil
  @hostname_aliases     = nil
  @reveal_cms_partials  = false
  @public_cms_path      = nil
end

Instance Attribute Details

#admin_authObject

Module that will handle authentication to access cms-admin area



13
14
15
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 13

def admin_auth
  @admin_auth
end

#admin_authorizationObject

Module that will handle authorization against admin cms resources



16
17
18
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 16

def admin_authorization
  @admin_authorization
end

#admin_cache_sweeperObject

A class that is included as a sweeper to admin base controller if it’s set



47
48
49
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 47

def admin_cache_sweeper
  @admin_cache_sweeper
end

#admin_localeObject

Admin interface will respect the locale of the site being managed. However you can force it to English by setting this to ‘:en`



44
45
46
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 44

def admin_locale
  @admin_locale
end

#admin_route_redirectObject

When arriving at /cms-admin you may chose to redirect to arbirtary path, for example ‘/cms-admin/users’



26
27
28
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 26

def admin_route_redirect
  @admin_route_redirect
end

#allow_erbBoolean

Not allowing erb code to be run inside page content. False by default.

Returns:

  • (Boolean)


51
52
53
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 51

def allow_erb
  @allow_erb
end

#allowed_helpersObject

Whitelist of all helper methods that can be used via {cms:helper} tag. By default all helpers are allowed except ‘eval`, `send`, `call` and few others. Empty array will prevent rendering of all helpers.



56
57
58
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 56

def allowed_helpers
  @allowed_helpers
end

#allowed_partialsObject

Whitelist of partials paths that can be used via {cms:partial} tag. All partials are accessible by default. Empty array will prevent rendering of all partials.



60
61
62
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 60

def allowed_partials
  @allowed_partials
end

#allowed_templatesObject

Whitelist of template paths that can be used via {cms:template} tag. All templates are accessible by default. Empty array will prevent rendering of all templates.



64
65
66
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 64

def allowed_templates
  @allowed_templates
end

#base_controllerObject

Controller that is inherited from CmsAdmin::BaseController ‘ApplicationController’ is the default



10
11
12
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 10

def base_controller
  @base_controller
end

#cms_titleObject

Don’t like ComfortableMexicanSofa? Set it to whatever you like. :(



6
7
8
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 6

def cms_title
  @cms_title
end

#enable_seedsObject

With each page load, files will be synched with the database. Database entries are destroyed if there’s no corresponding file. Seeds are disabled by default.



30
31
32
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 30

def enable_seeds
  @enable_seeds
end

#hostname_aliasesObject

Site aliases, if you want to have aliases for your site. Good for harmonizing production env with dev/testing envs. e.g. config.site_aliases = => ‘host.inv’, ‘host_a.com’ => [‘host.lvh.me’, ‘host.dev’] Default is nil (not used)



70
71
72
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 70

def hostname_aliases
  @hostname_aliases
end

#localesObject

Locale definitions. If you want to define your own locale merge => ‘Locale Title’ with this.



40
41
42
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 40

def locales
  @locales
end

#public_authObject

Module that will handle authentication for public pages



19
20
21
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 19

def public_auth
  @public_auth
end

#public_authorizationObject

Module that will handle authorization against public resources



22
23
24
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 22

def public_authorization
  @public_authorization
end

#public_cms_pathObject

Auto-setting parameter derived from the routes



77
78
79
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 77

def public_cms_path
  @public_cms_path
end

#reveal_cms_partialsObject

Reveal partials that can be overwritten in the admin area. Default is false.



74
75
76
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 74

def reveal_cms_partials
  @reveal_cms_partials
end

#revisions_limitObject

Number of revisions kept. Default is 25. If you wish to disable: set this to 0.



36
37
38
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 36

def revisions_limit
  @revisions_limit
end

#seeds_pathObject

Path where seeds can be located.



33
34
35
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 33

def seeds_path
  @seeds_path
end