You are here

function sheetnode_validate in Sheetnode 7.2

Same name and namespace in other branches
  1. 6 sheetnode.module \sheetnode_validate()
  2. 7 sheetnode.module \sheetnode_validate()

Implements hook_validate().

File

./sheetnode.module, line 201
Module file for the sheetnode module.

Code

function sheetnode_validate($node, $form, &$form_state) {
  $errors = form_get_errors();
  if (!empty($errors)) {
    _sheetnode_inject(drupal_clean_css_identifier('sheetnode-' . (empty($form['nid']['#value']) ? 'new' : $form['nid']['#value'])), 'sheetnode', $form['sheetnode']['value']['#value'], drupal_clean_css_identifier('edit-sheetnode-value'), array(
      'entity-type' => 'node',
      'oid' => $form['nid']['#value'],
    ));
  }
}