Class: Cms::SectionNodesController

Inherits:
BaseController show all
Defined in:
app/controllers/cms/section_nodes_controller.rb

Instance Method Summary collapse

Methods included from PageHelper

#able_to?, #cms_toolbar, #container, #container_has_block?, #current_page, #page_title, #render_breadcrumbs, #render_portlet

Methods included from PathHelper

#cms_connectable_path, #cms_index_path_for, #cms_index_url_for, #cms_new_path_for, #cms_new_url_for, #edit_cms_connectable_path

Methods included from ErrorHandling

#handle_access_denied, #handle_server_error, included

Instance Method Details

#indexObject



4
5
6
7
# File 'app/controllers/cms/section_nodes_controller.rb', line 4

def index
  @toolbar_tab = :sitemap
  @section = Section.root.first
end

#move_afterObject



11
12
13
# File 'app/controllers/cms/section_nodes_controller.rb', line 11

def move_after
  move(:after)
end

#move_beforeObject



8
9
10
# File 'app/controllers/cms/section_nodes_controller.rb', line 8

def move_before
  move(:before)
end

#move_to_beginningObject



14
15
16
# File 'app/controllers/cms/section_nodes_controller.rb', line 14

def move_to_beginning
  move_to(:beginning)
end

#move_to_endObject



17
18
19
# File 'app/controllers/cms/section_nodes_controller.rb', line 17

def move_to_end
  move_to(:end)
end

#move_to_rootObject



20
21
22
23
24
25
# File 'app/controllers/cms/section_nodes_controller.rb', line 20

def move_to_root
  @section_node = SectionNode.find(params[:id])
  @root = Section.root.find(params[:section_id])
  @section_node.move_to(@root, 0)
  render :json => {:success => true, :message => "'#{@section_node.node.name}' was moved to '#{@root.name}'"}    
end