forked from radiant/radiant-reorder-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreorder_extension.rb
31 lines (26 loc) · 1.13 KB
/
reorder_extension.rb
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
27
28
29
30
31
# Uncomment this if you reference any of your controllers in activate
require_dependency 'application_controller'
class ReorderExtension < Radiant::Extension
version "0.2.0"
description "Allows (re)ordering of pages in the page tree."
url "http://dev.radiantcms.org/"
define_routes do |map|
map.with_options :controller => "admin/pages" do |page|
page.page_move_lower "admin/pages/:id/move_lower", :action => "move_lower"
page.page_move_higher "admin/pages/:id/move_higher", :action => "move_higher"
page.page_move_to_bottom "admin/pages/:id/move_to_bottom", :action => "move_to_bottom"
page.page_move_to_top "admin/pages/:id/move_to_top", :action => "move_to_top"
end
end
def activate
admin.page.index.add :sitemap_head, "order_header"
admin.page.index.add :node, "order"
admin.page.index.add :top, 'header'
Page.send :include, Reorder::PageExtensions
Admin::PagesController.send :include, Reorder::PagesControllerExtensions
Admin::PagesController.send :helper, Reorder::PageHelper
StandardTags.send :include, Reorder::TagExtensions
end
def deactivate
end
end