You are here

public function views_plugin_argument_validate_php::options_form in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_argument_validate_php.inc \views_plugin_argument_validate_php::options_form()

Provide the default form for setting options.

Overrides views_plugin_argument_validate::options_form

File

plugins/views_plugin_argument_validate_php.inc, line 28
Definition of views_plugin_argument_validate_php.

Class

views_plugin_argument_validate_php
Provide PHP code to validate whether or not an argument is ok.

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['code'] = array(
    '#type' => 'textarea',
    '#title' => t('PHP validate code'),
    '#default_value' => $this->options['code'],
    '#description' => t('Enter PHP code that returns TRUE or FALSE. No return is the same as FALSE, so be SURE to return something if you do not want to declare the argument invalid. Do not use <?php ?>. The argument to validate will be "$argument" and the view will be "$view". You may change the argument by setting "$handler->argument". You may change the title used for substitutions for this argument by setting "$handler->validated_title".'),
  );
  $this
    ->check_access($form, 'code');
}