Module: Odania

Defined in:
lib/odania/admin.rb,
lib/odania.rb,
app/models/odania.rb,
lib/odania/filter.rb,
lib/odania/taggable.rb,
lib/odania/protected.rb,
app/models/odania/site.rb,
lib/odania/target_type.rb,
lib/odania/text_helper.rb,
lib/odania/configuration.rb,
lib/odania/taggable/core.rb,
app/models/odania/language.rb,
lib/odania/admin_constraint.rb,
lib/odania/taggable/tag_count.rb,
lib/odania/controllers/helpers.rb,
lib/odania/taggable/tag_module.rb,
lib/odania/core_target_type_util.rb,
lib/odania/controllers/url_helpers.rb,
app/helpers/odania/application_helper.rb,
app/controllers/application_controller.rb

Overview

Warning routing error if not logged in or not allowed!!

Defined Under Namespace

Modules: Admin, ApplicationHelper, Controllers, CoreTargetTypeUtil, Filter, Protected, Taggable, TargetType, TextHelper Classes: AdminConstraint, ApplicationController, ClickTracking, Configuration, Content, ContentsController, DeliverController, InfoController, Language, Menu, MenuController, MenuItem, Notify, Site, StatisticsController, Tag, TagXref, TagsController, User, UserRole, Widget

Constant Summary collapse

@@helpers =
Set.new
@@templates =
Hash.new
@@trackable_classes =
Set.new
@@widget_includes =
Set.new
@@widgets =
Set.new

Class Method Summary collapse

Class Method Details

.adminObject



135
136
137
# File 'lib/odania.rb', line 135

def self.admin
	Odania::Admin
end

.configObject

Retrieve configuration



39
40
41
# File 'lib/odania.rb', line 39

def self.config
	Odania::Configuration
end

.include_helpers(scope) ⇒ Object

Include helpers in the given scope to AC and AV.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/odania.rb', line 44

def self.include_helpers(scope)
	ActiveSupport.on_load(:action_controller) do
		include scope::Helpers if defined?(scope::Helpers)
		include scope::UrlHelpers

		layout :set_layout
	end

	ActiveSupport.on_load(:action_view) do
		include scope::UrlHelpers
	end

	ActiveSupport.on_load(:active_record) do
		extend Odania::Taggable
	end
end

.protectedObject



139
140
141
# File 'lib/odania.rb', line 139

def self.protected
	Odania::Protected
end

.setup {|Odania::Configuration| ... } ⇒ Object

Configure the Odania Portal, example for an initializer:

Odania.configure do |config|

config.user_signed_in_function = 'signed_in?'

end

This examples shows only a part of the configuration possibilities



33
34
35
36
# File 'lib/odania.rb', line 33

def self.setup
	yield Odania::Configuration
	@@helpers.each { |h| h.define_helpers(self.config) }
end

.table_name_prefixObject



2
3
4
# File 'lib/odania.rb', line 2

def self.table_name_prefix
	'odania_'
end

.templates_for_selectObject



65
66
67
68
69
70
71
72
# File 'lib/odania.rb', line 65

def self.templates_for_select
	result = []

	self.templates.each_value do |template|
		result << [template[:name], template[:template]]
	end
	result
end

.widgets_for_selectObject



126
127
128
129
130
131
132
133
# File 'lib/odania.rb', line 126

def self.widgets_for_select
	result = []

	self.widgets.each_value do |widget|
		result << [widget[:description], widget[:template]]
	end
	result
end