@@ -74,6 +74,45 @@ '#default_value' => variable_get($code .'_b', ''), '#description' => t('Maximum number of characters allowed for the body field of this content type. Leave blank for an unlimited size.'), ); + $form['nodetypes'][$type]['comment'] = array( + '#type' => 'fieldset', + '#title' => t('comment settings for ').$name->name, + '#collapsible' => TRUE, + '#collapsed' => strlen(variable_get($code . '_comment_' .'_b', '')) == 0, + ); + $form['nodetypes'][$type]['comment'][$code . '_comment_' .'_b'] = array( + '#type' => 'textfield', + '#title' => t('Comment Maxlength'), + '#field_suffix' => t('characters'), + '#return_value' => 1, + '#default_value' => variable_get($code . '_comment_' .'_b', ''), + '#description' => t('Maximum number of characters allowed for the body field of comment for this content type. Leave blank for an unlimited size.'), + ); + $form['nodetypes'][$type]['comment'][$code . '_comment_' .'_resizable'] = array( + '#type' => 'checkbox', + '#title' => t('Comment Resizable ?'), + '#return_value' => 1, + '#default_value' => variable_get($code . '_comment_' .'_resizable', 1), + '#description' => t('Do you want to use drupal default resizable function on textarea ? default : yes.'), + ); + $form['nodetypes'][$type]['comment'][$code . '_comment_' .'_rows'] = array( + '#type' => 'textfield', + '#title' => t('Comment rows'), + '#field_suffix' => t('characters'), + '#return_value' => 1, + '#default_value' => variable_get($code . '_comment_' .'_rows', ''), + '#description' => t('Use only if textarea is not resizable. Number of rows'), + ); + $form['nodetypes'][$type]['comment'][$code . '_comment_' .'_cols'] = array( + '#type' => 'textfield', + '#title' => t('Comment cols'), + '#field_suffix' => t('characters'), + '#return_value' => 1, + '#default_value' => variable_get($code . '_comment_' .'_cols', ''), + '#description' => t('Use only if textarea is not resizable. Number of cols'), + ); + } return system_settings_form($form); @@ -108,9 +147,18 @@ return strlen(variable_get(MAXLENGTH_NODE_TYPE . _maxlength_node_type_from_id($nid) .'_b', '')) > 0; } } + if (arg(0) == 'comment') { + if (arg(1) == 'reply') { + $type = $type = _maxlength_node_type_from_id(arg(2)); + + return strlen(variable_get(MAXLENGTH_NODE_TYPE . $type . '_comment_' .'_b', '')) > 0; + } + } return FALSE; } @@ -160,7 +207,36 @@ $prefix = t('