function commerce_order_handler_area_order_total::options_form in Commerce Core 7
Default options form that provides the label widget that all fields should have.
Overrides views_handler_area::options_form
File
- modules/
order/ includes/ views/ handlers/ commerce_order_handler_area_order_total.inc, line 32
Class
- commerce_order_handler_area_order_total
- Defines an area handler that renders an order's total field.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['empty']['#description'] = t("Even if selected, this area handler will never render if a valid order cannot be found in the View's arguments.");
$form['label_display'] = array(
'#type' => 'checkbox',
'#title' => t('Display a custom label for this field'),
'#description' => t('Displaying a custom label may require updates to your theme to maintain the default alignment of the field without a label.'),
'#default_value' => $this->options['label_display'],
);
$form['label_custom'] = array(
'#type' => 'textfield',
'#title' => t('Custom label'),
'#default_value' => $this->options['label_custom'],
'#dependency' => array(
'edit-options-label-display' => array(
1,
),
),
);
$form['label_position'] = array(
'#type' => 'select',
'#title' => t('Label position'),
'#default_value' => $this->options['label_position'],
'#dependency' => array(
'edit-options-label-display' => array(
1,
),
),
'#options' => array(
'inline' => t('Inline'),
'above' => t('Above'),
),
);
// Load the formatter options for the commerce_order_total field.
module_load_include('inc', 'field_ui', 'field_ui.admin');
$field = field_info_field('commerce_order_total');
$form['formatter'] = array(
'#type' => 'select',
'#title' => t('Formatter'),
'#options' => field_ui_formatter_options($field['type']),
'#default_value' => $this->options['formatter'],
);
}