function views_plugin_query_default::options_form

Same name in other branches
  1. 7.x-3.x plugins/views_plugin_query_default.inc \views_plugin_query_default::options_form()

Add settings for the ui.

Overrides views_plugin_query::options_form

File

plugins/views_plugin_query_default.inc, line 184

Class

views_plugin_query_default
Object used to create a SELECT query.

Code

function options_form(&$form, &$form_state) {
    $form['disable_sql_rewrite'] = array(
        '#title' => t('Disable SQL rewriting'),
        '#description' => t('Disabling SQL rewriting will disable node_access checks as well as other modules that implement hook_db_rewrite_sql().'),
        '#type' => 'checkbox',
        '#default_value' => !empty($this->options['disable_sql_rewrite']),
        '#prefix' => '<div class="messages warning">' . t('WARNING: Disabling SQL rewriting means that node access security is disabled. This may allow users to see data they should not be able to see if your view is misconfigured. Please use this option only if you understand and accept this security risk.') . '</div>',
    );
    $form['distinct'] = array(
        '#type' => 'checkbox',
        '#title' => t('Distinct'),
        '#description' => t('This will make the view display only distinct items. If there are multiple identical items, each will be displayed only once. You can use this to try and remove duplicates from a view, though it does not always work. Note that this can slow queries down, so use it with caution.'),
        '#default_value' => !empty($this->options['distinct']),
    );
}