You are here

function quiz_type_confirm in Quiz 7.5

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 quiz.module \quiz_type_confirm()
  4. 7.4 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

bool

Related topics

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

File

./quiz.module, line 1713
quiz.module Main file for the 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');
}