You are here

views_plugin_argument_validate_numeric.inc in Views (for Drupal 7) 6.2

Contains the numeric argument validator plugin.

File

plugins/views_plugin_argument_validate_numeric.inc
View source
<?php

/**
 * @file
 * Contains the numeric argument validator plugin.
 */

/**
 * Validate whether an argument is numeric or not.
 *
 * @ingroup views_argument_validate_plugins
 */
class views_plugin_argument_validate_numeric extends views_plugin_argument_validate {
  var $option_name = 'validate_argument_numeric';

  /**
   * Only let users with PHP block visibility permissions set/modify this
   * validate plugin.
   */
  function access() {
    return !empty($this->argument->definition['numeric']);
  }
  function validate_argument($argument) {
    return is_numeric($argument);
  }

}

Classes

Namesort descending Description
views_plugin_argument_validate_numeric Validate whether an argument is numeric or not.