You are here

function _maxlength_limit_body in Maxlength 6

Same name and namespace in other branches
  1. 5 maxlength.module \_maxlength_limit_body()
1 call to _maxlength_limit_body()
maxlength_elements in ./maxlength.module
Implemenation of hook_elements().

File

./maxlength.module, line 96

Code

function _maxlength_limit_body() {
  if (arg(0) == 'node') {
    if (arg(1) == 'add') {
      $type = str_replace('-', '_', arg(2));
      return strlen(variable_get(MAXLENGTH_NODE_TYPE . $type . '_b', '')) > 0;
    }
    if (arg(2) == 'edit') {
      $nid = intval(arg(1));
      return strlen(variable_get(MAXLENGTH_NODE_TYPE . _maxlength_node_type_from_id($nid) . '_b', '')) > 0;
    }
  }
  return FALSE;
}