Class: Marley::Joints::Section::Resources::MainMenu
- Defined in:
- lib/marley/joints/section.rb
Class Method Summary collapse
- .requires_user? ⇒ Boolean
- .section_content ⇒ Object
- .section_desc ⇒ Object
- .section_nav ⇒ Object
- .section_title ⇒ Object
Methods inherited from Section
Class Method Details
.requires_user? ⇒ Boolean
37 38 39 40 41 42 43 |
# File 'lib/marley/joints/section.rb', line 37 def self.requires_user? if respond_to?(:current_user) ! ($request[:path].nil? || $request[:path].empty?) else false end end |
.section_content ⇒ Object
54 55 56 57 58 |
# File 'lib/marley/joints/section.rb', line 54 def self.section_content if respond_to?(:current_user) && (current_user.nil? || current_user.new?) [[:msg,{:title => 'New users, please sign up below'}],MR::User.new] end end |
.section_desc ⇒ Object
59 60 61 62 63 |
# File 'lib/marley/joints/section.rb', line 59 def self.section_desc if respond_to?(:current_user) && (current_user.nil? || current_user.new?) ReggaeLink.new({:url => '/main_menu', :title => 'Existing users, please click here to log in.'}) end end |
.section_nav ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/marley/joints/section.rb', line 47 def self.section_nav if !(respond_to?(:current_user) && (current_user.nil? || current_user.new?)) MR.resources_responding_to(:section).sort {|l,r|l.resource_name <=> r.resource_name}.map{|r| next if r==self; r.section}.compact else [] end end |