function nodehierarchy_views_update in Node Hierarchy 6
Same name and namespace in other branches
- 5 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
- 6.3 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
- 6.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
- 7.4 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
- 7.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
Update the given embedded view.
2 calls to nodehierarchy_views_update()
- nodehierarchy_views_insert in nodehierarchy_views/
nodehierarchy_views.module - Insert the given embedded view.
- nodehierarchy_views_nodeapi in nodehierarchy_views/
nodehierarchy_views.module - Implmentation of hook_nodeapi().
File
- nodehierarchy_views/
nodehierarchy_views.module, line 101 - Views.module integration for nodehierarchy.module.
Code
function nodehierarchy_views_update($node) {
if (user_access('edit embedded child view')) {
db_query('DELETE FROM {nodehierarchy_views} WHERE nid = %d', $node->nid);
$valid_views = _nodehierarchy_views_view_options();
if ($node->nh_children_view && isset($valid_views[$node->nh_children_view])) {
db_query("INSERT INTO {nodehierarchy_views} (nid, nh_children_view) VALUES (%d, '%s')", $node->nid, $node->nh_children_view);
}
}
}