~spreadubuntu/spreadubuntu/devel-drupal6

« back to all changes in this revision

Viewing changes to modules/views/plugins/views_plugin_argument_validate_numeric.inc

  • Committer: ruben
  • Date: 2009-06-08 09:38:49 UTC
  • Revision ID: ruben@captive-20090608093849-s1qtsyctv2vwp1x1
SpreadUbuntu moving to Drupal6. Based on ubuntu-drupal theme and adding our modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
// $Id: views_plugin_argument_validate_numeric.inc,v 1.1 2008/09/03 19:21:30 merlinofchaos Exp $
 
3
/**
 
4
 * @file
 
5
 * Contains the numeric argument validator plugin.
 
6
 */
 
7
 
 
8
/**
 
9
 * Validate whether an argument is numeric or not.
 
10
 *
 
11
 * @ingroup views_argument_validate_plugins
 
12
 */
 
13
class views_plugin_argument_validate_numeric extends views_plugin_argument_validate {
 
14
  var $option_name = 'validate_argument_numeric';
 
15
 
 
16
  /**
 
17
   * Only let users with PHP block visibility permissions set/modify this
 
18
   * validate plugin.
 
19
   */
 
20
  function access() {
 
21
    return !empty($this->argument->definition['numeric']);
 
22
  }
 
23
 
 
24
  function validate_argument($argument) {
 
25
    return is_numeric($argument);
 
26
  }
 
27
}
 
28