views_plugin_argument_validate_numeric.inc

  1. 3.x plugins/views_plugin_argument_validate_numeric.inc
  2. 2.x plugins/views_plugin_argument_validate_numeric.inc

Contains the numeric argument validator plugin.

File

plugins/views_plugin_argument_validate_numeric.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Contains the numeric argument validator plugin.
  5. */
  6. /**
  7. * Validate whether an argument is numeric or not.
  8. *
  9. * @ingroup views_argument_validate_plugins
  10. */
  11. class views_plugin_argument_validate_numeric extends views_plugin_argument_validate {
  12. var $option_name = 'validate_argument_numeric';
  13. /**
  14. * Only let users with PHP block visibility permissions set/modify this
  15. * validate plugin.
  16. */
  17. function access() {
  18. return !empty($this->argument->definition['numeric']);
  19. }
  20. function validate_argument($argument) {
  21. return is_numeric($argument);
  22. }
  23. }