You are here

public function views_sort_expression_handler::options_form in Views Sort Expression 7

Basic options for all sort criteria

Overrides views_handler_sort::options_form

File

views/views_sort_expression_handler.inc, line 27
Filter classes.

Class

views_sort_expression_handler
Generic views handler filter to add code to manipulate the query object.

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['expression'] = array(
    '#type' => 'textarea',
    '#title' => t('Expression'),
    '#default_value' => $this->options['expression'],
    '#description' => t('<b>This is an advanced sort handler.</b> You can use whatever is available on the SQL. If what you need is not on the query, you could add other sort handlers in the end that will make some others to be available. You should probably want to enable "Show the SQL query" on the <a href="!url">settings</a> page.', array(
      '!url' => url('admin/structure/views/settings'),
    )),
  );
  $form['aggregate'] = array(
    '#type' => 'checkbox',
    '#title' => t('Expression has an aggregate function'),
    '#default_value' => $this->options['aggregate'],
    '#description' => t('This allows you to use an <a href="https://www.w3schools.com/sql/sql_groupby.asp">aggregate function</a> on the expression, instead of relying on the views aggregation plugins which doesn\'t otherwise work nicely with this sort handler.'),
  );
}