function views_plugin_argument_validate_php::validate_form

2.x views_plugin_argument_validate_php.inc views_plugin_argument_validate_php::validate_form(&$form, &$form_state)

Overrides views_plugin_argument_validate::validate_form

File

plugins/views_plugin_argument_validate_php.inc, line 15
Contains the php code argument validator plugin.

Class

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

Code

function validate_form(&$form, &$form_state) {
  $form[$this->option_name] = array(
    '#type' => 'textarea',
    '#title' => t('PHP validate code'),
    '#default_value' => $this->get_argument(),
    '#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".'),
    '#process' => array('views_process_dependency'),
    '#dependency' => array('edit-options-validate-type' => array($this->id)),
  );

  $this->check_access($form);
}