You are here

function _views_calc_operators in Views Calc 7

Same name and namespace in other branches
  1. 5 views_calc.module \_views_calc_operators()
  2. 6.3 views_calc.module \_views_calc_operators()
  3. 6 views_calc.module \_views_calc_operators()

Default SQL operator alternatives.

The ones allowed in this system are stored in the variable views_calc_operators, and can be changed at admin/settings/views_calc.

3 calls to _views_calc_operators()
views_calc_field_form_item in ./views_calc.module
A form element for an individual calculated field.
views_calc_settings_form in ./views_calc.module
FAPI settings_form.
_views_calc_replacements in ./views_calc.module
An array of allowable calculation values.

File

./views_calc.module, line 54
This module will allow you to add calculated fields to views tables and compute (SUM, COUNT, AVG, etc) columns of numeric data in a views table.

Code

function _views_calc_operators() {
  $default = array(
    '+',
    '-',
    '*',
    '/',
    '(',
    ')',
    ',',
    "'",
    'CONCAT',
    'MIN',
    'MAX',
    'ROUND',
    'NOW()',
  );
  $operators = variable_get('views_calc_operators', implode("\n", $default));
  return explode("\n", $operators);
}