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_content_editor, #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, #engine_for, #path_elements_for

Methods included from ErrorHandling

#handle_access_denied, #handle_server_error

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/cms/section_nodes_controller.rb', line 5

def index
  @toolbar_tab = :sitemap
  @modifiable_sections = current_user.modifiable_sections
  @public_sections = Group.guest.sections.all # Load once here so that every section doesn't need to.

  @sitemap = Section.sitemap
  @root_section_node = @sitemap.keys.first
  @section = @root_section_node.node
end

#move_afterObject



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

def move_after
  move(:after)
end

#move_beforeObject



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

def move_before
  move(:before)
end

#move_to_beginningObject



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

def move_to_beginning
  move_to(:beginning)
end

#move_to_endObject



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

def move_to_end
  move_to(:end)
end

#move_to_rootObject



26
27
28
29
30
31
# File 'app/controllers/cms/section_nodes_controller.rb', line 26

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