You are here

function _button_field_widget_settings_common in Button Field 6

Builds the array of common settings for the button widgets for button fields.

Based on code submitted by AlfredSanta.

@link http://drupal.org/node/681318

Parameters

string $op:

array $widget:

Return value

array

2 calls to _button_field_widget_settings_common()
_button_field_widget_settings_html in ./button_field.module
Builds the array of setting for the HTML button widget for button fields.
_button_field_widget_settings_image in ./button_field.module
Builds the array of setting for the image button widget for button fields.

File

./button_field.module, line 229
Defines a field, widget and formatter for the button field type.

Code

function _button_field_widget_settings_common($op, $widget) {
  switch ($op) {
    case 'form':
      $form['additional_class'] = array(
        '#type' => 'textfield',
        '#title' => t('Additional class'),
        '#default_value' => isset($widget['additional_class']) ? $widget['additional_class'] : NULL,
        '#description' => t('Optionally, specify a class to be applied to ' . 'the element. All button field elements will always contain the ' . '"button_field" class. This option allows you to specify an ' . 'additional class for styling your elements.'),
      );

      // end $form['additional_class']
      $form['edit_hidden'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide on edit form'),
        '#default_value' => isset($widget['edit_hidden']) ? $widget['edit_hidden'] : TRUE,
        '#description' => t('Whether or not this field will be rendered on ' . 'the node edit and add forms.  Note: Nodes do not get assisgned a ' . 'node id on the add form; therefore, any Rules that require the ' . 'node to be available on button click will not function properly.'),
      );

      // end $form['edit_hidden']
      return $form;
      break;
  }

  // end switch $op
}