Class: Goldberg::SystemSettings

Inherits:
ActiveRecord::Base show all
Includes:
Model
Defined in:
lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

included

Methods inherited from ActiveRecord::Base

#associated_valid?, #no_errors_in_associated?, #save_associated, #save_associated!, #save_with_unsaved_flag, #to_label, #unsaved=, #unsaved?

Instance Attribute Details

#default_markup_styleObject

Returns the value of attribute default_markup_style.



6
7
8
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 6

def default_markup_style
  @default_markup_style
end

#not_found_pageObject

Returns the value of attribute not_found_page.



7
8
9
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 7

def not_found_page
  @not_found_page
end

#permission_denied_pageObject

Returns the value of attribute permission_denied_page.



7
8
9
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 7

def permission_denied_page
  @permission_denied_page
end

#public_roleObject

Returns the value of attribute public_role.



6
7
8
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 6

def public_role
  @public_role
end

#session_expired_pageObject

Returns the value of attribute session_expired_page.



7
8
9
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 7

def session_expired_page
  @session_expired_page
end

#site_default_pageObject

Returns the value of attribute site_default_page.



7
8
9
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 7

def site_default_page
  @site_default_page
end

Instance Method Details

#get_start_pathObject



91
92
93
94
95
96
97
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 91

def get_start_path
  if self.start_path and self.start_path.length > 0
    self.start_path
  else
    "/"
  end
end

#self_reg_confirmation_error_pageObject



57
58
59
60
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 57

def self_reg_confirmation_error_page
  @self_reg_confirmation_error_page ||=
    ContentPage.find(self.self_reg_confirmation_error_page_id)
end

#self_reg_roleObject



99
100
101
102
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 99

def self_reg_role
  @self_reg_role ||= self.self_reg_role_id ? Role.find(self.self_reg_role_id) :
    Role.new(:id => nil, :name => '(none)')
end

#system_pages(pageid) ⇒ Object

Returns an array of system page settings for a given page, or nil if the page is not a system page.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb', line 64

def system_pages(pageid)
  pages = Array.new
  
  if self.site_default_page_id == pageid
    pages << "Site default page"
  end
  if self.not_found_page_id == pageid
    pages << "Not found page"
  end
  if self.permission_denied_page_id == pageid
    pages << "Permission denied page"
  end
  if self.session_expired_page_id == pageid
    pages << "Session expired page"
  end

  if self.self_reg_confirmation_error_page_id == pageid
    pages << "Self-registration confirmation error page"
  end
  
  if pages.length > 0
    return pages
  else
    return nil
  end
end