henryhamon / radiant-smer-extension

Simple Mailer Extension for Radiant

This URL has Read+Write access

radiant-smer-extension / smer_extension.rb
100644 26 lines (20 sloc) 0.908 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class SmerExtension < Radiant::Extension
  version "0.0"
  description "Simple Mailer Extension for Radiant. That's provide simple support for email forms."
  url "http://github.com/henryhamon/radiant-smer-extension"
 # Smers Routes
 # TODO Melhorar
  define_routes do |map|
    map.connect 'admin/smers/', :controller => 'admin/smers', :action => 'index'
    map.connect 'admin/smers/edit/:id', :controller => 'admin/smers', :action => 'edit'
    map.connect 'admin/smers/new', :controller => 'admin/smers', :action => 'new'
    map.connect 'admin/smers/remove/:id', :controller => 'admin/smers', :action => 'remove'
    
    map.resources :smer, :path_prefix => "/pages/:page_id", :controller => "smer"
 
  end
  
  def activate
    admin.tabs.add "eMail Config", "/admin/smers", :after => "Layouts", :visibility => [:all]
  end
  
  def deactive
    admin.tabs.remove "eMail Config"
  end
end