function views_handler_field_math::options_form
Overrides views_handler_field_numeric::options_form
File
-
handlers/
views_handler_field_math.inc, line 32
Class
- views_handler_field_math
- Render a mathematical expression as a numeric value.
Code
public 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). The result of the previous row's mathematical expression can be accessed by using the [expression] token itself."),
'#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['alter']['help']);
}