function nodehierarchy_views_insert in Node Hierarchy 6
Same name and namespace in other branches
- 5 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_insert()
- 6.3 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_insert()
- 6.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_insert()
- 7.4 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_insert()
- 7.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_insert()
Insert the given embedded view.
1 call to nodehierarchy_views_insert()
- nodehierarchy_views_nodeapi in nodehierarchy_views/
nodehierarchy_views.module - Implmentation of hook_nodeapi().
File
- nodehierarchy_views/
nodehierarchy_views.module, line 114 - Views.module integration for nodehierarchy.module.
Code
function nodehierarchy_views_insert($node) {
// If the user has access to edit the view, update as usual.
if (user_access('edit embedded child view')) {
nodehierarchy_views_update($node);
}
else {
db_query("INSERT INTO {nodehierarchy_views} (nid, nh_children_view) VALUES (%d, '%s')", $node->nid, variable_get('nh_default_children_view_' . $node->type, NULL));
}
}