Index: maxlength.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/maxlength/maxlength.module,v retrieving revision 1.11 diff -r1.11 maxlength.module 2a3,7 > /** > * @file > * Module to enable a max length countdown on node body and title. > */ > 54c59 < '#collapsed' => strlen(variable_get($code . '_t', '') . variable_get($code . '_b', '')) == 0, --- > '#collapsed' => strlen(variable_get($code .'_t', '') . variable_get($code .'_b', '')) == 0, 57c62 < $form['nodetypes'][$type][$code . '_t'] = array( --- > $form['nodetypes'][$type][$code .'_t'] = array( 62c67 < '#default_value' => variable_get($code . '_t', ''), --- > '#default_value' => variable_get($code .'_t', ''), 66c71 < $form['nodetypes'][$type][$code . '_b'] = array( --- > $form['nodetypes'][$type][$code .'_b'] = array( 71c76 < '#default_value' => variable_get($code . '_b', ''), --- > '#default_value' => variable_get($code .'_b', ''), 97c102 < return strlen(variable_get(MAXLENGTH_NODE_TYPE . $type . '_b', '')) > 0; --- > return strlen(variable_get(MAXLENGTH_NODE_TYPE . $type .'_b', '')) > 0; 103c108 < return strlen(variable_get(MAXLENGTH_NODE_TYPE . _maxlength_node_type_from_id($nid) . '_b', '')) > 0; --- > return strlen(variable_get(MAXLENGTH_NODE_TYPE . _maxlength_node_type_from_id($nid) .'_b', '')) > 0; 115c120 < drupal_add_js($path . '/maxlength.js'); --- > drupal_add_js($path .'/maxlength.js'); 120,121c125 < else < { --- > else { 125c129 < $limit = intval(variable_get(MAXLENGTH_NODE_TYPE . $type . '_b', '')); --- > $limit = intval(variable_get(MAXLENGTH_NODE_TYPE . $type .'_b', '')); 143,144c147,148 < $element['#attributes']['onchange'] = 'maxlength_limit(this, ' . $limit . ');'; < $element['#attributes']['onkeyup'] = 'maxlength_limit(this, ' . $limit . ');'; --- > $element['#attributes']['onchange'] = 'maxlength_limit(this, '. $limit .');'; > $element['#attributes']['onkeyup'] = 'maxlength_limit(this, '. $limit .');'; 162,164c166,168 < if ( $type . '_node_form' == $form_id) { < if (strlen(variable_get(MAXLENGTH_NODE_TYPE . $type . '_t', '')) > 0) { < $limit = intval(variable_get(MAXLENGTH_NODE_TYPE . $type . '_t', '')); --- > if ( $type .'_node_form' == $form_id) { > if (strlen(variable_get(MAXLENGTH_NODE_TYPE . $type .'_t', '')) > 0) { > $limit = intval(variable_get(MAXLENGTH_NODE_TYPE . $type .'_t', '')); 187c191 < if (strlen(variable_get($code . '_b', '')) > 0) { --- > if (strlen(variable_get($code .'_b', '')) > 0) { 192c196 < $limit = intval(variable_get($code . '_b', '')); --- > $limit = intval(variable_get($code .'_b', '')); 209,210c213,214 < variable_del($code . '_t'); < variable_del($code . '_b'); --- > variable_del($code .'_t'); > variable_del($code .'_b'); 219,220c223,224 < $max_title = variable_get($code_old . '_t', ''); < $max_body = variable_get($code_old . '_b', ''); --- > $max_title = variable_get($code_old .'_t', ''); > $max_body = variable_get($code_old .'_b', ''); 222,223c226,227 < variable_set($code_new . '_t', $max_title); < variable_set($code_new . '_b', $max_body); --- > variable_set($code_new .'_t', $max_title); > variable_set($code_new .'_b', $max_body); 225,226c229,230 < variable_del($code_old . '_t'); < variable_del($code_old . '_b'); --- > variable_del($code_old .'_t'); > variable_del($code_old .'_b'); 231,233c235 < } < < ?> --- > } \ No newline at end of file Index: maxlength.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/maxlength/maxlength.install,v retrieving revision 1.5 diff -r1.5 maxlength.install 2a3,6 > /** > * @file > * Install file for the maxlenght module > */ 8,9c12,13 < foreach(node_get_types() as $type => $name) { < $code_old = 'maxlength_node_type_' . $type; --- > foreach (node_get_types() as $type => $name) { > $code_old = 'maxlength_node_type_'. $type; 12,13c16,17 < $max_title = variable_get($code_old . '_maxlength_title', ''); < $max_body = variable_get($code_old . '_maxlength_body', ''); --- > $max_title = variable_get($code_old .'_maxlength_title', ''); > $max_body = variable_get($code_old .'_maxlength_body', ''); 15,16c19,20 < variable_set($code_new . '_t', $max_title); < variable_set($code_new . '_b', $max_body); --- > variable_set($code_new .'_t', $max_title); > variable_set($code_new .'_b', $max_body); 18,19c22,23 < variable_del($code_old . '_maxlength_title'); < variable_del($code_old . '_maxlength_body'); --- > variable_del($code_old .'_maxlength_title'); > variable_del($code_old .'_maxlength_body'); 22,23c26,27 < variable_del($code_old . '_limit'); < variable_del($code_old . '_maxlength'); --- > variable_del($code_old .'_limit'); > variable_del($code_old .'_maxlength'); 34,35c38,39 < variable_del($code . '_t'); < variable_del($code . '_b'); --- > variable_del($code .'_t'); > variable_del($code .'_b'); 37,39c41 < } < < ?> \ No newline at end of file --- > } \ No newline at end of file Index: maxlength.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/maxlength/maxlength.inc,v retrieving revision 1.4 diff -r1.4 maxlength.inc 2a3,6 > /** > * @file > * Include file for constants used in the maxlenght module > */ 8,10c12 < define('ADMINISTER_MAXLENGTH', 'administer maxlength'); < < ?> \ No newline at end of file --- > define('ADMINISTER_MAXLENGTH', 'administer maxlength'); \ No newline at end of file