Class: Spud::Cms::TemplateParser
- Inherits:
-
Object
- Object
- Spud::Cms::TemplateParser
- Defined in:
- lib/spud_cms/template_parser.rb
Instance Method Summary collapse
Instance Method Details
#all_layouts ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/spud_cms/template_parser.rb', line 20 def all_layouts if @layouts && Rails.env != 'development' return @layouts end @layouts = {} engines.each do |engine| @layouts.merge! process_layouts(engine.root.join('app','views','layouts')) end @layouts.merge! process_layouts(Rails.application.root.join('app','views','layouts')) check_for_defaults(@layouts) return @layouts end |
#layouts(site_short_name = nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/spud_cms/template_parser.rb', line 6 def layouts(site_short_name=nil) if(site_short_name != nil) filtered_layouts = {} all_layouts.each do |key,value| if value[:sites].include?(site_short_name.to_s.downcase) filtered_layouts[key] = value end end return filtered_layouts else return all_layouts end end |