You are here

function maxlength_form_alter in Maxlength 5.2

Same name and namespace in other branches
  1. 5 maxlength.module \maxlength_form_alter()
  2. 6.2 maxlength.module \maxlength_form_alter()
  3. 6 maxlength.module \maxlength_form_alter()
  4. 7.3 maxlength.module \maxlength_form_alter()
  5. 7 maxlength.module \maxlength_form_alter()
  6. 7.2 maxlength.module \maxlength_form_alter()

Implementation of hook_form_alter().

File

./maxlength.module, line 65

Code

function maxlength_form_alter($form_id, &$form) {

  //Editing the content
  if ($form['#id'] == 'node-form') {
    _maxlength_content_form_alter($form_id, $form);
  }
  else {
    if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
      _maxlength_content_type_form_alter($form_id, $form);
    }
    else {
      if ($form_id == '_content_admin_field' and isset($form['field']['max_length'])) {
        _maxlength_cck_form_alter($form_id, $form);
      }
      else {
        if ($form_id == '_content_admin_field_remove') {
          variable_del(MAXLENGTH_NODE_TYPE . $form['field_name']['#value']);
          variable_del(MAXLENGTH_NODE_TYPE . $form['field_name']['#value'] . '_js');
          variable_del(MAXLENGTH_NODE_TYPE . $form['field_name']['#value'] . '_text');
        }
      }
    }
  }
}