You are here

function views_php_handler_sort::options_form in Views PHP 6

Same name and namespace in other branches
  1. 7.2 plugins/views/views_php_handler_sort.inc \views_php_handler_sort::options_form()
  2. 7 plugins/views/views_php_handler_sort.inc \views_php_handler_sort::options_form()

Implements views_handler#option_definition().

File

plugins/views/views_php_handler_sort.inc, line 27

Class

views_php_handler_sort
A handler to sort a view using PHP defined by the administrator.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form += views_php_form_element($this, FALSE, array(
    'sql_sort',
    t('SQL sort code'),
    t('Return a valid SQL ORDER BY clause.'),
    FALSE,
  ), array(
    '$view',
    '$handler',
    '$static',
  ));
  $form += views_php_form_element($this, array(
    'use_php_setup',
    t('Use setup code'),
    t('If checked, you can provide PHP code to be run once right before execution of the view. This may be useful to define functions to be re-used in the value and/or output code.'),
  ), array(
    'php_setup',
    t('Setup code'),
    t('Code to run right before execution of the view.'),
    FALSE,
  ), array(
    '$view',
    '$handler',
    '$static',
  ));
  $form += views_php_form_element($this, FALSE, array(
    'php_sort',
    t('Sort code'),
    t('The comparison code must return an integer less than, equal to, or greater than zero if the first row should respectively appear before, stay where it was compared to, or appear after the second row.'),
    FALSE,
  ), array(
    '$view',
    '$handler',
    '$static',
    '$row1' => t('Data of row.'),
    '$row2' => t('Data of row to compare against.'),
  ));
}