You are here

function nodehierarchy_views_update in Node Hierarchy 6.3

Same name and namespace in other branches
  1. 5 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
  2. 6 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
  3. 6.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
  4. 7.4 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_update()
  5. 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
Implementation of hook_nodeapi().

File

nodehierarchy_views/nodehierarchy_views.module, line 146
Embed a view of children onto a node.

Code

function nodehierarchy_views_update($node) {
  if (user_access('edit embedded child view')) {
    db_query('DELETE FROM {nodehierarchy_views} WHERE nid = %d', $node->nid);
    if (@$node->nh_children_view) {
      list($view, $display) = explode(':', $node->nh_children_view);
      db_query("INSERT INTO {nodehierarchy_views} (nid, nh_children_view, nh_children_view_display) VALUES (%d, '%s', '%s')", $node->nid, $view, $display);
    }
  }
}