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



73
74
75
76
77
78
79
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
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 73

def initialize
  @cms_title            = 'ComfortableMexicanSofa CMS Engine'
  @base_controller      = 'ApplicationController'
  @admin_auth           = 'ComfortableMexicanSofa::HttpAuth'
  @public_auth          = 'ComfortableMexicanSofa::DummyAuth'
  @seed_data_path       = nil
  @admin_route_redirect = ''
  @enable_sitemap       = true
  @upload_file_options  = { }
  @enable_fixtures      = false
  @fixtures_path        = File.expand_path('db/cms_fixtures', Rails.root)
  @revisions_limit      = 25
  @locales              = {
    'en'    => 'English',
    'fr'    => 'Français',
    'es'    => 'Español',
    'pt-BR' => 'Português Brasileiro',
    'zh-CN' => '简体中文',
    'zh-TW' => '正體中文',
    'ja'    => '日本語',
    'sv'    => 'Svenska',
    'ru'    => 'Русский',
    'pl'    => 'Polski',
    'de'    => 'Deutsch',
    'nl'    => 'Nederlands',
    'it'    => 'Italiano',
    'da'    => 'Dansk',
    'cs'    => 'Česky',
    'nb' => 'Norsk'
  }
  @admin_locale         = nil
  @admin_cache_sweeper  = nil
  @allow_irb            = false
  @allowed_helpers      = nil
  @allowed_partials     = nil
  @hostname_aliases     = nil
  @reveal_cms_partials  = false
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_cache_sweeperObject

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



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

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`



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

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’



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

def admin_route_redirect
  @admin_route_redirect
end

#allow_irbObject

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



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

def allow_irb
  @allow_irb
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.



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

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.



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

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.



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

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_fixturesObject

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



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

def enable_fixtures
  @enable_fixtures
end

#fixtures_pathObject

Path where fixtures can be located.



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

def fixtures_path
  @fixtures_path
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)



66
67
68
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 66

def hostname_aliases
  @hostname_aliases
end

#localesObject

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



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

def locales
  @locales
end

#public_authObject

Module that will handle authentication for public pages



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

def public_auth
  @public_auth
end

#reveal_cms_partialsObject

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



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

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.



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

def revisions_limit
  @revisions_limit
end

#upload_file_optionsObject

Upload settings



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

def upload_file_options
  @upload_file_options
end