function views_handler_field_node_field::options_form in Views node field 7
Default options form provides the label widget that all fields should have.
Overrides views_handler_field::options_form
File
- ./
views_handler_field_node_field.inc, line 22
Class
- views_handler_field_node_field
- Field handler to present a node.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$entity_info = entity_get_info('node');
$options = array();
if (!empty($entity_info['view modes'])) {
foreach ($entity_info['view modes'] as $mode => $settings) {
$options[$mode] = $settings['label'];
}
}
if (empty($options)) {
$options = array(
'teaser' => t('Teaser'),
'full' => t('Full node'),
);
}
$form['build_mode'] = array(
'#type' => 'select',
'#options' => $options,
'#title' => t('Build mode'),
'#default_value' => $this->options['build_mode'],
);
$form['links'] = array(
'#type' => 'checkbox',
'#title' => t('Display links'),
'#default_value' => $this->options['links'],
);
$form['comments'] = array(
'#type' => 'checkbox',
'#title' => t('Display node comments'),
'#default_value' => $this->options['comments'],
);
}