You are here

function prev_next_nid in Previous/Next API 6

Same name and namespace in other branches
  1. 7.2 prev_next.module \prev_next_nid()
  2. 7 prev_next.module \prev_next_nid()
1 call to prev_next_nid()
prev_next_block in ./prev_next.module
Implementation of hook_block().

File

./prev_next.module, line 523

Code

function prev_next_nid($nid, $op = 'next') {
  foreach (module_implements('prev_next_nid') as $module) {
    $function = $module . '_prev_next_nid';
    $ret = $function($nid, $op);
    if ($ret !== FALSE) {

      // If the function returns FALSE, keep trying other methods
      return $ret;
    }
  }
  if ($op == 'prev') {
    return prev_next_nid_prev($nid);
  }
  elseif ($op == 'next') {
    return prev_next_nid_next($nid);
  }
  else {
    return 0;
  }
}