daily_validate(&$node)
daily/daily_container.inc, line 102
Implementation of hook_validate(): Verify a node editing form for nodetype Daily Container.
| Name | Description |
|---|---|
| Daily Container node type functions | All functions which define the node type Daily Container. |
| Hook implementations | Functions that implement standard Drupal hooks. |
<?php
function daily_validate(&$node) {
# If we have already form errors flagged, we will not do any further
# checking
if (form_get_errors()) {
return;
}
$vid = variable_get("daily_vocabulary", 0);
$term = module_invoke('taxonomy', 'get_term', $node->tid);
if (!$node->tid or !$term or ($term->vid != $vid)) {
form_set_error('tid', _daily_form_error_no_tid());
}
if ($node->nr !== (string) (int) $node->nr or $node->nr != floor($node->nr)) {
form_set_error('nr', _daily_form_error_correct_nr());
}
$tids = _daily_find_our_tids($node->taxonomy);
if (count($tids) != 0) {
form_set_error('vocabulary]['. $vid, _daily_form_error_recursive_container($vid));
}
}
?>