You are here

function node_limit_node_validate in Node Limit 7

Same name and namespace in other branches
  1. 8 old/node_limit.module \node_limit_node_validate()

Implements hook_node_validate().

File

./node_limit.module, line 231

Code

function node_limit_node_validate($node, $form, &$form_state) {
  if (empty($node->nid) && _node_limit_violates_limit($node)) {

    //we have a violation!

    //and this is a new node
    $nodetype = node_type_get_type($node);
    form_set_error('title', t("You can't create more content of type !type", array(
      '!type' => check_plain($nodetype->name),
    )), 'error');
  }
}