You are here

function button_field_field_settings in Button Field 6

Implementation of hook_field_settings().

Parameters

string $op:

string $field:

Return value

array

File

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

Code

function button_field_field_settings($op, $field) {
  switch ($op) {
    case 'database columns':
      $columns['value'] = array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => FALSE,
        'sortable' => FALSE,
        'views' => TRUE,
      );
      return $columns;
      break;
    case 'form':

      // hide the multiple and required fields, since buttons don't store
      // anything
      $form = array();
      $form['multiple'] = array(
        '#type' => 'hidden',
        '#value' => '0',
      );

      // end $form['multiple']
      $form['required'] = array(
        '#type' => 'hidden',
        '#value' => NULL,
      );

      // end $form['required']
      $form['confirmation'] = array(
        '#type' => 'textfield',
        '#title' => t('Confirmation message'),
        '#default_value' => isset($field['confirmation']) ? $field['confirmation'] : FALSE,
        '#description' => t('You may enter a confirmation message to be ' . 'displayed to the user before running any rules. If you do not ' . 'want the user to see a confirmation message you can leave this ' . 'setting empty.'),
      );

      // end $form['confirmation']
      return $form;
      break;
    case 'save':
      return array(
        'confirmation',
      );
      break;
  }

  // end switch $op
}