Simplified the add child mechanism, by using a query parameter ?parent=nid

(instead of specific node/{nid}/add_child/page url)
Fixed implementation of `CMS_NODE_API.is_node_a_parent_of (..)',
  and improved parent validity checking against cycle.
This commit is contained in:
2015-09-09 23:04:08 +02:00
parent 438259033a
commit 18e159ad3c
7 changed files with 48 additions and 58 deletions

View File

@@ -99,15 +99,15 @@ feature -- HTTP Methods
edit_response.execute
elseif req.percent_encoded_path_info.ends_with ("/revision") then
do_revisions (req, res)
elseif req.percent_encoded_path_info.ends_with ("/add_child/page") then
-- Add child node
l_nid := node_id_path_parameter (req)
if l_nid > 0 then
-- create a new child node with node id `l_id' as parent.
create_new_node (req, res)
else
send_not_found (req, res)
end
-- elseif req.percent_encoded_path_info.ends_with ("/add_child/page") then
-- -- Add child node
-- l_nid := node_id_path_parameter (req)
-- if l_nid > 0 then
-- -- create a new child node with node id `l_id' as parent.
-- create_new_node (req, res)
-- else
-- send_not_found (req, res)
-- end
else
-- Display existing node
l_nid := node_id_path_parameter (req)