You are here

function quiz_type_confirm in Quiz 7

Same name and namespace in other branches
  1. 6.4 quiz.module \quiz_type_confirm()
  2. 7.6 quiz.module \quiz_type_confirm()
  3. 7.4 quiz.module \quiz_type_confirm()
  4. 7.5 quiz.module \quiz_type_confirm()

Validate that a node is of type quiz, and that the user has access to it.

Parameters

$node:

$op:

Return value

unknown_type

Related topics

2 string references to 'quiz_type_confirm'
quiz_menu in ./quiz.module
Implements hook_menu().
quiz_stats_menu in includes/quiz_stats/quiz_stats.module
Implements hook_menu().

File

./quiz.module, line 1542
Quiz Module

Code

function quiz_type_confirm($node, $op = NULL) {
  if ($node->type != 'quiz') {
    return FALSE;
  }
  if (isset($op)) {
    $node_ops = array(
      'view',
      'update',
      'delete',
      'create',
    );
    if (in_array($op, $node_ops)) {
      return node_access($op, $node);
    }
    return user_access($op);
  }
  return user_access('access quiz');
}