31: def routes_for_browser_cms
32:
33: namespace(:cms) do |cms|
34:
35: cms.home '/', :controller => 'home'
36:
37: cms.logout '/logout', :controller => 'sessions', :action => 'destroy'
38: cms.login '/login', :controller => 'sessions', :action => 'new', :conditions => { :method => :get }
39: cms.connect '/login', :controller => 'sessions', :action => 'create', :conditions => { :method => :post }
40: cms.dashboard '/dashboard', :controller => 'dashboard'
41: cms.sitemap '/sitemap', :controller => 'section_nodes'
42:
43: cms.content_types '/content_types', :controller => 'content_types'
44: cms.resources :connectors, :member => {
45: :move_up => :put,
46: :move_down => :put,
47: :move_to_bottom => :put,
48: :move_to_top => :put
49: }
50: cms.resources :links
51:
52: cms.resources :pages, :member => {
53: :archive => :put,
54: :hide => :put,
55: :publish => :put,
56: :versions => :get
57: }, :collection => {
58: :publish => :put
59: }, :has_many => [:tasks]
60: version_cms_page '/cms/pages/:id/version/:version', :controller => 'cms/pages', :action => 'version', :conditions => {:method => :get}
61: revert_to_cms_page '/cms/pages/:id/revert_to/:version', :controller => 'cms/pages', :action => 'revert_to', :conditions => {:method => :put}
62:
63: cms.file_browser '/sections/file_browser.xml', :controller => 'sections', :action => 'file_browser', :format => "xml"
64: cms.resources :sections, :has_many => [:links, :pages]
65:
66: cms.resources :section_nodes, :member => {
67: :move_before => :put,
68: :move_after => :put,
69: :move_to_beginning => :put,
70: :move_to_end => :put,
71: :move_to_root => :put
72: }
73: cms.attachment '/attachments/:id', :controller => 'attachments', :action => 'show'
74:
75: cms.resources :tasks, :member => {:complete => :put}, :collection => {:complete => :put}
76: cms.toolbar '/toolbar', :controller => 'toolbar'
77:
78:
79:
80: cms.content_library '/content_library', :controller => 'html_blocks'
81:
82: cms.content_blocks :html_blocks
83: cms.content_blocks :portlets, :member => {:usages => :get}
84: cms.handler "/portlet/:id/:handler",
85: :controller => "portlet",
86: :action => "execute_handler",
87: :conditions => {:method => :post}
88:
89: cms.content_blocks :file_blocks
90: cms.content_blocks :image_blocks
91: cms.content_blocks :category_types
92: cms.content_blocks :categories
93: cms.content_blocks :tags
94:
95: cms.administration '/administration', :controller => 'users'
96:
97: cms.with_options :controller => "cache" do |cache|
98: cache.cache "/cache", :action => "show", :conditions => {:method => :get}
99: cache.connect "/cache", :action => "destroy", :conditions => {:method => :delete}
100: end
101:
102: cms.resources :email_messages
103: cms.resources :groups
104: cms.resources :redirects
105: cms.resources :page_partials, :controller => 'dynamic_views'
106: cms.resources :page_templates, :controller => 'dynamic_views'
107: cms.resources :page_routes do |pr|
108: pr.resources :conditions, :controller => "page_route_conditions"
109: pr.resources :requirements, :controller => "page_route_requirements"
110: end
111: cms.routes "/routes", :controller => "routes"
112: cms.resources :users, :member => {
113: :change_password => :get,
114: :update_password => :put,
115: :disable => :put,
116: :enable => :put
117: }
118:
119: end
120:
121: if PageRoute.table_exists?
122: PageRoute.all(:order => "page_routes.name").each do |r|
123: send((r.route_name || 'connect').to_sym, r.pattern, r.options_map)
124: end
125: end
126:
127: connect '*path', :controller => 'cms/content', :action => 'show'
128: end