Class: AlchemyCrm::NewsletterLayout

Inherits:
Object
  • Object
show all
Defined in:
lib/alchemy_crm/newsletter_layout.rb

Class Method Summary collapse

Class Method Details

.allObject



11
12
13
# File 'lib/alchemy_crm/newsletter_layout.rb', line 11

def self.all
  @@newsletter_layouts ||= Alchemy::PageLayout.get_all_by_attributes(:newsletter => true)
end

.display_name_for(name) ⇒ Object



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

def self.display_name_for(name)
  Alchemy::I18n.t(name, :scope => :page_layout_names, :default => name.to_s.camelcase)
end

.get(name) ⇒ Object



15
16
17
18
# File 'lib/alchemy_crm/newsletter_layout.rb', line 15

def self.get(name)
  all
  @@newsletter_layouts.detect { |l| l['name'] == name.to_s }
end

.get_layouts_for_selectObject



4
5
6
7
8
9
# File 'lib/alchemy_crm/newsletter_layout.rb', line 4

def self.get_layouts_for_select()
  all
  @@newsletter_layouts.map do |l|
    [display_name_for(l["name"]), l["name"]]
  end
end