You are here

function _maxlength_comment_form_alter in Maxlength 6.2

1 call to _maxlength_comment_form_alter()
maxlength_form_alter in ./maxlength.module
Implementation of hook_form_alter().

File

./maxlength.inc, line 41
Business logic for maxlength

Code

function _maxlength_comment_form_alter(&$form, &$form_state, $form_id) {
  $node = node_load($form['nid']['#value']);
  $type = $node->type;

  // Add a max length formatter to the comment subject and body.
  if (isset($form['subject']) && ($values = maxlength_get_values('comment_subject', $type))) {
    $form['subject']['#max_length_properties'] = $values;
  }
  if (isset($form['comment_filter']['comment']) && ($values = maxlength_get_values('comment_comment', $type))) {
    $form['comment_filter']['comment']['#max_length_properties'] = $values;
  }
}