delete_from_tree

NAML documentation   Watch a video
   Usages of this macro
... 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
Macro
Requires: servlet
Parameters: do
.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.is_site_admin
Macro
Requires: user
>
            <then>
                <n.login
Macro
Requires: servlet
Parameters: message
.>Only authorized users can perform this action.</n.login.>
            </then>
        </n.if.not.visitor.is_site_admin>
        <n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.>
            <!-- Here we move all replies to the parent node and delete the current node -->
            <n.set_var
Binary
Namespace: BasicNamespace
Parameters: name, value
. name='parent_url'><n.parent_node
Binary
Namespace: NodeNamespace
Parameters: do
.url
Macro
Requires: node
Parameters: template, date, index_record
/></n.set_var.>
            <n.children_list
Macro
Requires: node
Parameters: filter, start, length, sort, do
. start="0" length="1000">
                <n.loop
Macro
Requires: sequence
Parameters: by, do
.>
                    <n.current_node
Binary
Namespace: NodeList
Parameters: do
.as_node_page
Binary
Namespace: NodeNamespace
Parameters: do
.edit_page_node
Binary
Namespace: NodePageNamespace
Parameters: commit, do
.>
                        <n.set_parent_url
Binary
Namespace: NodeEditorNamespace
Parameters: parent_url
 parent_url="[n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='parent_url'/]" />
                        <n.save_node
Binary
Namespace: NodeEditorNamespace
/>
                    </n.current_node.as_node_page.edit_page_node.>
                </n.loop.>
            </n.children_list.>
            <n.delete_recursively
Binary
Namespace: NodeNamespace
/>
            <n.redirect_to
Binary
Namespace: ServletNamespace
Parameters: url
.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='parent_url'/>
        </n.page_node.>
    </n.node_page.>
</macro>