Module: Configuration

Included in:
Admin::ApplicationController, ApplicationController, User, UserMailer, UserObserver
Defined in:
lib/configuration.rb

Overview

Configuration for Blank Application

Blank Application is configured through the SuperAdministration module accessible to the 'superadmin' user

Major Application Configurations can be set up using this module.

The settings are stored in a YAML file.

Initially the /config/customs/default_config.yml file is loaded(default settings).

After the Superadministrator has setup the Superadministration Module the configurations will be stored in the /config/customs/sa_config.yml file

The setttings are accessed through the following methods in the Application

Instance Method Summary (collapse)

Instance Method Details

Get Selected Items List

will return a array of string of available items



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

def available_containers_links
	return @configuration['sa_containers'] || CONTAINERS
end

- (Object) available_items_list

Get Selected Items List

will return a array of string of available items



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

def available_items_list
	return @configuration['sa_items']
end

- (Object) available_languages

Get Available Languages

will return a array of string of available languages if not empty array



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

def available_languages
   return (@configuration['sa_languages'].nil? || @configuration['sa_languages'].empty?) ? [] : @configuration['sa_languages']
end

- (Object) available_layouts

will return a array of string of available layouts if not empty array



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

def available_layouts
	return (@configuration['sa_layouts'].nil? || @configuration['sa_layouts'].empty?) ? [] : @configuration['sa_layouts']
end

- (Boolean) encoding_activated?

Returns:

  • (Boolean)


93
94
95
# File 'lib/configuration.rb', line 93

def encoding_activated?
  @configuration['sa_activate_encoding'] == 'true'
end

- (Object) get_configuration



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

def get_configuration
	@configuration ||= get_sa_config
end

- (Object) get_fcke_item_types

Get the Item types available for FCKE



85
86
87
# File 'lib/configuration.rb', line 85

def get_fcke_item_types
	return ['page', 'image', 'cms_file', 'video', 'audio', 'bookmark']
end

- (Object) get_per_page_value

Set PerPage Values for Pagination(default 10)



74
75
76
77
78
79
80
81
82
# File 'lib/configuration.rb', line 74

def get_per_page_value
   if current_user.u_per_page
     current_user.u_per_page
	elsif (res=@configuration['sa_per_page_default']).to_i > 0
		return res
	else
		return 10
	end
end

- (Object) get_sa_config

Load the SuperAdmin Configuration



56
57
58
59
60
61
62
# File 'lib/configuration.rb', line 56

def get_sa_config
	if File.exist?("#{RAILS_ROOT}/config/customs/sa_config.yml")
		return YAML.load_file("#{RAILS_ROOT}/config/customs/sa_config.yml")
	else
		return YAML.load_file("#{RAILS_ROOT}/config/customs/default_config.yml")
	end
end

- (Boolean) is_allowed_free_user_creation?

Free User Creation

Check setting to verify if User can register directly with the application

Returns:

  • (Boolean)


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

def is_allowed_free_user_creation?
	return @configuration['sa_allowed_free_user_creation']=='true'
end

- (Object) is_given_private_workspace

Check if Automatic Private Workspace Creation is Allowed



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

def is_given_private_workspace
	return @configuration['sa_automatic_private_workspace']=='true'
end

- (Boolean) is_mandatory_user_activation?

Check if Email Activation for User is Mandatory

Returns:

  • (Boolean)


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

def is_mandatory_user_activation?
	return @configuration['sa_mandatory_user_activation']=='true'
end

- (Boolean) rss_activated?

Returns:

  • (Boolean)


89
90
91
# File 'lib/configuration.rb', line 89

def rss_activated?
  @configuration['sa_activate_rss'] == 'true'
end

- (Boolean) search_activated?

Returns:

  • (Boolean)


97
98
99
# File 'lib/configuration.rb', line 97

def search_activated?
  @configuration['sa_activate_search'] == 'true'
end