function node_limit_node_validate in Node Limit 8
Same name and namespace in other branches
- 7 node_limit.module \node_limit_node_validate()
Implements hook_node_validate().
File
- old/
node_limit.module, line 214
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');
}
}