public
Description: It's an extension for Radiant CMS. It allows for a page to be copied (or moved) under a new parent.
Homepage: http://gravityblast.com/projects/radiant-copymove-extension/
Clone URL: git://github.com/pilu/radiant-copy-move.git
seancribbs (author)
Mon Jul 27 07:26:41 -0700 2009
pilu (committer)
Tue Aug 11 05:28:53 -0700 2009
commit  94a4f097fa2c2dd2da46e35d377507a90d357fe1
tree    6f512b1d26d36bd3fdaf6cd81d2c4c0370991056
parent  d1b35b87bed1403fa2b310406e913e04f062242c
radiant-copy-move / copy_move_extension.rb
100755 28 lines (24 sloc) 1.098 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
27
28
require_dependency 'application_controller'
 
class CopyMoveExtension < Radiant::Extension
  version "2.0.0"
  description "Adds the ability to copy and move a page and all of its children"
  url "http://gravityblast.com/projects/radiant-copymove-extension/"
 
  define_routes do |map|
    map.with_options(:controller => "admin/pages") do |cm|
      cm.copy_page_admin_page '/admin/pages/:id/copy_page', :action => 'copy_page'
      cm.copy_children_admin_page '/admin/pages/:id/copy_children', :action => 'copy_children'
      cm.copy_tree_admin_page '/admin/pages/:id/copy_tree', :action => 'copy_tree'
      cm.move_admin_page '/admin/pages/:id/move', :action => 'move'
    end
  end
 
  def activate
    Admin::PagesController.class_eval do
      include CopyMove::Controller
      helper :copy_move
    end
    Page.class_eval { include CopyMove::Model }
    admin.page.index.add :sitemap_head, 'copy_move_extra_th'
    admin.page.index.add :node, 'copy_move_extra_td', :after => "add_child_column"
    admin.page.index.add :bottom, 'copy_move_popup'
  end
end