1 views_handler_field_node_link.inc | views_handler_field_node_link::options_form(&$form, &$form_state) |
Default options form that provides the label widget that all fields should have.
Overrides views_handler_field::options_form
File
- core/
modules/ node/ views/ views_handler_field_node_link.inc, line 22 - Definition of views_handler_field_node_link.
Class
- views_handler_field_node_link
- Field handler to present a link to the node.
Code
function options_form(&$form, &$form_state) {
$form['url'] = array(
'#type' => 'checkbox',
'#title' => t('Output URL as text'),
'#default_value' => $this->options['url'],
'#description' => t('The resulting URL will be plain text and not a clickable link.'),
);
$form['text'] = array(
'#type' => 'textfield',
'#title' => t('Text to display'),
'#default_value' => $this->options['text'],
'#indentation' => 1,
'#states' => array(
'visible' => array(
':input[name="options[url]"]' => array('checked' => FALSE),
),
),
);
$form['absolute'] = array(
'#type' => 'checkbox',
'#title' => t('Output an absolute link starting with "http(s)://"'),
'#default_value' => $this->options['absolute'],
);
parent::options_form($form, $form_state);
// The path is set by render_link function so don't allow to set it.
$form['alter']['path'] = array('#access' => FALSE);
$form['alter']['external'] = array('#access' => FALSE);
$form['alter']['absolute'] = array('#access' => FALSE);
}