You are here

function basic_cart_field_formatter_settings_form in Basic cart 7.3

Implements hook_field_formatter_settings_form().

File

./basic_cart.module, line 255

Code

function basic_cart_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {

  //This gets the view_mode where our settings are stored
  $display = $instance['display'][$view_mode];

  //This gets the actual settings
  $settings = $display['settings'];

  //Initialize the element variable
  $element = array();
  switch ($display['type']) {
    case 'basic_cart_add_to_cart':
      $element['css_class'] = array(
        '#type' => 'textfield',
        '#title' => t('CSS class'),
        '#description' => t('This class will be added to the button\'s HTML code.'),
        '#default_value' => $settings['css_class'],
      );
      break;
  }
  return $element;
}