public static function validate_range($value, $control, $container, $min, $max, $warning = null)
{
if ($value < $min) {
if ($warning == null) {
$warning = _t('The value entered for %s is lesser than the minimum of %d.', array($control->get_label(), $min));
}
return array($warning);
} elseif ($value > $max) {
if ($warning == null) {
$warning = _t('The value entered for %s is greater than the maximum of %d.', array($control->get_label(), $max));
}
return array($warning);
} else {
return array();
}
}