function views_handler_field_math::options_form
Same name in other branches
- 7.x-3.x handlers/views_handler_field_math.inc \views_handler_field_math::options_form()
Overrides views_handler_field_numeric::options_form
File
-
handlers/
views_handler_field_math.inc, line 19
Class
- views_handler_field_math
- Render a mathematical expression as a numeric value
Code
function options_form(&$form, &$form_state) {
$form['expression'] = array(
'#type' => 'textarea',
'#title' => t('Expression'),
'#description' => t('Enter mathematical expressions such as 2 + 2 or sqrt(5). You may assign variables and create mathematical functions and evaluate them. Use the ; to separate these. For example: f(x) = x + 2; f(2).'),
'#default_value' => $this->options['expression'],
);
// Create a place for the help
$form['expression_help'] = array();
parent::options_form($form, $form_state);
// Then move the existing help:
$form['expression_help'] = $form['alter']['help'];
unset($form['expression_help']['#dependency']);
unset($form['expression_help']['#process']);
unset($form['alter']['help']);
}