1 views_ui.admin.inc views_ui_admin_settings_advanced()

Form builder for the advanced admin settings page.

File

core/modules/views_ui/views_ui.admin.inc, line 4560
Provides the Views' administrative interface.

Code

function views_ui_admin_settings_advanced() {
  $form = array();
  $form['#attached']['css'] = views_ui_get_admin_css();
  $config = config('views.settings');

  // Set the "any" label as a value so it is included in the saved config.
  $form['exposed_filter_any_label'] = array(
    '#type' => 'value',
    '#value' => $config->get('exposed_filter_any_label'),
  );

  $form['cache'] = array(
    '#type' => 'fieldset',
    '#title' => t('Caching'),
    '#access' => user_access('flush caches'),
  );

  $form['cache']['clear_cache'] = array(
    '#type' => 'submit',
    '#value' => t("Clear Views' cache"),
    '#submit' => array('views_ui_tools_clear_cache'),
  );

  $form['debug'] = array(
    '#type' => 'fieldset',
    '#title' => t('Debugging'),
  );

  $form['debug']['sql_signature'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add Views signature to all SQL queries'),
    '#description' => t("All Views-generated queries will include the name of the views and display 'view-name:display-name' as a string  at the end of the SELECT clause. This makes identifying Views queries in database server logs simpler, but should only be used when troubleshooting."),
    '#default_value' => $config->get('sql_signature'),
  );

  $form['debug']['devel_output'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable views performance statistics/debug messages via the Devel module'),
    '#description' => t("Check this to enable some Views query and performance statistics/debug messages <em>if Devel is installed</em>."),
    '#default_value' => $config->get('devel_output'),
  );

  $form['locale'] = array(
    '#type' => 'fieldset',
    '#title' => t('Localization'),
  );

  $form['locale']['views_localization_plugin'] = array(
    '#type' => 'radios',
    '#title' => t('Translation method'),
    '#options' => views_fetch_plugin_names('localization', NULL, array()),
    '#default_value' => views_get_localization_plugin(),
    '#description' => t('Select a translation method to use for Views data like header, footer, and empty text.'),
  );

  $regions = array();
  $regions['watchdog'] = t('Watchdog');

  $form['debug']['devel_region'] = array(
    '#type' => 'select',
    '#title' => t('Page region to output performance statistics/debug messages'),
    '#default_value' => $config->get('devel_region'),
    '#options' => $regions,
    '#states' => array(
      'visible' => array(
        ':input[name="views_devel_output"]' => array('checked' => TRUE),
      ),
    ),
  );

  $options = views_fetch_plugin_names('display_extender');
  $form['extenders'] = array(
    '#type' => 'fieldset',
    '#access' => count($options) > 0,
  );
  $form['extenders']['display_extenders'] = array(
    '#title' => t('Display extenders'),
    '#default_value' => views_get_enabled_display_extenders(),
    '#options' => $options,
    '#type' => 'checkboxes',
    '#description' => t('Select extensions of the views interface.')
  );

  $form['field_rewrite_elements'] = array(
    '#type' => 'value',
    '#value' => $config->get('field_rewrite_elements'),
  );

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save settings'),
  );

  return $form;
}