class Fullstack::Cms::Configuration

Attributes

linkables[W]
localized[W]
prepend_locale_to_path[W]

Public Instance Methods

default_locale() click to toggle source
# File lib/fullstack/cms/configuration.rb, line 7
def default_locale
  "#{I18n.default_locale}" || "en"
end
linkables() click to toggle source
# File lib/fullstack/cms/configuration.rb, line 21
def linkables
  @linkables || []
end
localize()
Alias for: localized
localized() click to toggle source
# File lib/fullstack/cms/configuration.rb, line 11
def localized
  @localized.nil? ? true : @localized
end
Also aliased as: localize, localized?
localized?()
Alias for: localized
menu(uid, options = {}) click to toggle source

config.menu( ‘main’, :localized => true )

… menu( ‘main’, :locale => I18n.locale ) menu_items( ‘main’, :locale => I18n.locale )

prepend_locale_to_path() click to toggle source
# File lib/fullstack/cms/configuration.rb, line 17
def prepend_locale_to_path
  @prepend_locale_to_path.nil? ? true : @prepend_locale_to_path
end
resources(&block) click to toggle source
# File lib/fullstack/cms/configuration.rb, line 25
def resources(&block)
  Fullstack::Admin.resources(&block)
end
setting(key, options = {}) click to toggle source

config.setting(‘description’, :kind => :text, :localized => true, :group => group) setting(‘website/description’, :locale => I18n.locale)

# File lib/fullstack/cms/configuration.rb, line 58
def setting(key, options = {})
  return nil unless Setting.table_exists?

  options = options.reverse_merge({ :localized => localized? }).merge({ :autocreate => true })
  localized_setting = options.delete(:localized)

  if localized_setting && localized? # ignores the option if CMS is not localized
    I18n.available_locales.each do |locale|
      Setting.global(key.to_s, options.merge(:locale => locale.to_s))
    end
  else
    Setting.global(key.to_s, options)
  end


end