'fieldset', '#title' => t('Resizing options'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#weight' => 0, '#description' => t('Additional resizing options for the textarea.'), ); $form['widget']['resizable_cck']['resizable_cck_cols'] = array( '#type' => 'textfield', '#title' => t('Columns'), '#description' => t('How many cols do you want the field to use? If the grippie is shown, this value will be overridden.'), '#default_value' => variable_get('resizable_cck_cols_' . $form['#field']['field_name'] . '__' . $form['#field']['type_name'], 60), '#size' => 3, '#element_validate' => array('resizable_body_element_validate'), ); $form['widget']['resizable_cck']['resizable_cck_resizable'] = array( '#type' => 'select', '#title' => t('Adjustable Height'), '#description' => t('Should the field height be adjustable? When automatic height is enabled, the grippie will be disabled. Caution: Animated may be very slow for some users.'), '#options' => array (t('None - Hide Grippie'), t('Manual - Show Grippie'), t('Autoresize, without animation'), t('Autoresize with animation')), '#default_value' => variable_get('resizable_cck_resizable_' . $form['#field']['field_name'] . '__' . $form['#field']['type_name'], 1), '#weight' => 10, '#element_validate' => array('resizable_body_resizable_element_validate'), ); } } else if (substr($form_id, -10) == '_node_form' && is_array(($fields = variable_get('resizable_cck_fields_' . $form['type']['#value'], FALSE)))) { // add drupal.behaviors code for autoresizing of cck fields $js = << 1) { // include jquery function drupal_add_js(drupal_get_path('module', 'resizable_body') . '/autoresize.js', 'module', 'header', FALSE, TRUE, FALSE); // to prevent aggregation // get element delta $delta = $element['#delta']; // add relevant class to define what js behavior should be applied to it if ($autoresize == 2) { // auto, no animation $element['value']['#attributes']['class'] = 'resizable-cck-auto-no-animation'; } elseif ($autoresize == 3) { // auto, with animation $element['value']['#attributes']['class'] = 'resizable-cck-auto-with-animation'; } } $element['value']['#resizable'] = ($autoresize == 1) ? TRUE : FALSE; return $element; }