You are here

function _draggableviews_check_node_order in DraggableViews 7

Same name and namespace in other branches
  1. 6.3 draggableviews.inc \_draggableviews_check_node_order()

Check Node Order Value

We rely on the correctness of depth values and parent values. The order values of each level have to equal with the values of the parent nodes.

Parameters

$nid: The node id to check.

$info: The structured information array. Look at _draggableviews_info(..) to learn more.

1 call to _draggableviews_check_node_order()
_draggableviews_check_order in ./draggableviews.inc
Detect and Repair Order Values

File

./draggableviews.inc, line 958
Draggableviews processing functions. Rough summary of what functions in this file do:

Code

function _draggableviews_check_node_order($nid, &$info) {
  $error = FALSE;
  $nodes =& $info['nodes'];
  $temp_nid = $nodes[$nid]['parent'];
  for ($i = $nodes[$nid]['depth'] - 1; $i >= 0; $i--) {

    // We're operating top-down, so we determine the parents nid by the way.
    $nodes[$nid]['order'][$i] = $nodes[$temp_nid]['order'][$i];
    $temp_nid = $nodes[$temp_nid]['parent'];
  }
}