Class: MuckContents::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/muck-contents/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



34
35
36
37
38
39
40
41
42
43
# File 'lib/muck-contents/config.rb', line 34

def initialize
  self.sanitize_content = true
  self.enable_auto_translations = true
  self.enable_sunspot = false
  self.enable_solr = false
  self.enable_comments = false
  self.git_repository = nil #"#{File.join(RAILS_ROOT, 'repo', RAILS_ENV)}"
  self.content_css = ['/stylesheets/reset.css', '/stylesheets/styles.css']
  self.translate_to = []
end

Instance Attribute Details

#advanced_mce_optionsObject

Tiny MCE options



30
31
32
# File 'lib/muck-contents/config.rb', line 30

def advanced_mce_options
  @advanced_mce_options
end

#content_cssObject

Enables solr for the content system. If you are using solr then set this to true. If you do not wish to setup and manage solr then set this value to false (but search will be disabled).



21
22
23
# File 'lib/muck-contents/config.rb', line 21

def content_css
  @content_css
end

#enable_auto_translationsObject

If true then all content objects will automatically be translated into all languages supported by Google Translate



16
17
18
# File 'lib/muck-contents/config.rb', line 16

def enable_auto_translations
  @enable_auto_translations
end

#enable_commentsObject

Turns comments on and off for a content page.



27
28
29
# File 'lib/muck-contents/config.rb', line 27

def enable_comments
  @enable_comments
end

#enable_solrObject

Returns the value of attribute enable_solr.



19
20
21
# File 'lib/muck-contents/config.rb', line 19

def enable_solr
  @enable_solr
end

#enable_sunspotObject

This enables or disables sunspot for profiles. Only use acts_as_solr or sunspot not both. Sunspot does not include multicore support.



18
19
20
# File 'lib/muck-contents/config.rb', line 18

def enable_sunspot
  @enable_sunspot
end

#flickr_api_keyObject

CSS files that should be fed into the tiny_mce content editor.

Note that Rails will typically generate a single all.css stylesheet. Setting the stylesheets here let’s the site administrator control which css is present in the content editor and thus which css an end user has access to to style their content.



25
26
27
# File 'lib/muck-contents/config.rb', line 25

def flickr_api_key
  @flickr_api_key
end

#git_repositoryObject

Not currently used. Eventually this will be the path to a git repository that the content system uses to store revisions.



15
16
17
# File 'lib/muck-contents/config.rb', line 15

def git_repository
  @git_repository
end

#raw_mce_optionsObject

Returns the value of attribute raw_mce_options.



32
33
34
# File 'lib/muck-contents/config.rb', line 32

def raw_mce_options
  @raw_mce_options
end

#sanitize_contentObject

Leave this one on or suffer hacker wrath.



26
27
28
# File 'lib/muck-contents/config.rb', line 26

def sanitize_content
  @sanitize_content
end

#simple_mce_optionsObject

Returns the value of attribute simple_mce_options.



31
32
33
# File 'lib/muck-contents/config.rb', line 31

def simple_mce_options
  @simple_mce_options
end

#translate_toObject

If auto translate is enabled this indicates which languages to translate the content into. Specify Babelphish::GoogleTranslate::LANGUAGES to translate to all available language (not recommended).



17
18
19
# File 'lib/muck-contents/config.rb', line 17

def translate_to
  @translate_to
end