You are here

function nodehierarchy_views_insert in Node Hierarchy 5

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

File

nodehierarchy_views/nodehierarchy_views.module, line 122
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));
  }
}