... | in _harvey_naml.naml |
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
<macro name="delete_from_tree" requires="servlet">
<n.node_page.>
<n.if.not.visitor.is_site_admin>
<then>
<n.login.>Only authorized users can perform this action.</n.login.>
</then>
</n.if.not.visitor.is_site_admin>
<n.page_node.>
<!-- Here we move all replies to the parent node and delete the current node -->
<n.set_var. name='parent_url'><n.parent_node.url/></n.set_var.>
<n.children_list. start="0" length="1000">
<n.loop.>
<n.current_node.as_node_page.edit_page_node.>
<n.set_parent_url parent_url="[n.var name='parent_url'/]" />
<n.save_node/>
</n.current_node.as_node_page.edit_page_node.>
</n.loop.>
</n.children_list.>
<n.delete_recursively/>
<n.redirect_to.var name='parent_url'/>
</n.page_node.>
</n.node_page.>
</macro>
|
Powered by Nabble | NAML |