You are here

function _maxlength_get_values in Maxlength 5.2

Same name and namespace in other branches
  1. 7 maxlength.inc \_maxlength_get_values()
  2. 7.2 maxlength.inc \_maxlength_get_values()
1 call to _maxlength_get_values()
_maxlength_format_element in ./maxlength.module

File

./maxlength.module, line 219

Code

function _maxlength_get_values($field = 'body', $type = '') {
  $values = '';
  $values['limit'] = FALSE;

  //CCK
  if (strpos($field, 'field_') === 0) {
    $values['limit'] = variable_get(MAXLENGTH_NODE_TYPE . $field, FALSE);
    $values['use_js'] = variable_get(MAXLENGTH_NODE_TYPE . $field . '_js', FALSE);
    $values['text'] = variable_get(MAXLENGTH_NODE_TYPE . $field . '_text', FALSE);
  }
  else {
    if ($type != '') {
      $values['limit'] = variable_get(MAXLENGTH_NODE_TYPE . $field . '_' . $type, FALSE);
      $values['use_js'] = variable_get(MAXLENGTH_NODE_TYPE . $field . '_js_' . $type, FALSE);
      $values['text'] = variable_get(MAXLENGTH_NODE_TYPE . $field . '_text_' . $type, FALSE);
    }
  }
  if ($values['limit']) {
    return $values;
  }
  else {
    return FALSE;
  }
}