function _maxlength_get_values in Maxlength 7.2
Same name and namespace in other branches
- 5.2 maxlength.module \_maxlength_get_values()
- 7 maxlength.inc \_maxlength_get_values()
1 call to _maxlength_get_values()
- _maxlength_format_element in ./
maxlength.module - Formats a form element to use maxlength value and use js. It's not moved to maxlength.inc because Form API calls it even when form_alter is not called
File
- ./
maxlength.inc, line 130 - Business logic for maxlength
Code
function _maxlength_get_values($field = 'body', $type = '') {
$values = '';
$values['limit'] = FALSE;
//CCK
if (strpos($field, 'field_') === 0) {
$values['limit'] = variable_get('maxlength_' . $field, FALSE);
$values['use_js'] = variable_get('maxlength_' . $field . '_js', FALSE);
$values['text'] = variable_get('maxlength_' . $field . '_text', FALSE);
}
elseif ($type != '') {
$values['limit'] = variable_get('maxlength_' . $field . '_' . $type, FALSE);
$values['use_js'] = variable_get('maxlength_' . $field . '_js_' . $type, FALSE);
$values['text'] = variable_get('maxlength_' . $field . '_text_' . $type, FALSE);
}
if ($values['limit']) {
return $values;
}
else {
return FALSE;
}
}