Import settings

This commit is contained in:
Crack
2010-07-01 22:24:18 +02:00
parent 83f1397f0f
commit b13dee72f3
7 changed files with 172 additions and 6 deletions

View File

@@ -364,8 +364,8 @@ function validate_non_negative_number($path, $values)
/**
* Validates DefaultPropDisplay field
*
* @param $path
* @param $values
* @param string $path
* @param array $values
* @return array
*/
function validate_DefaultPropDisplay($path, $values)
@@ -373,4 +373,30 @@ function validate_DefaultPropDisplay($path, $values)
$result = preg_match('/^(?:horizontal|vertical|\d+)$/', $values[$path]);
return array($path => ($result ? '' : __('Incorrect value')));
}
/**
* Validates string length - must be 1 character long
*
* @param string $path
* @param array $values
* @return array
*/
function validate_str1($path, $values)
{
$result = strlen($values[$path]) == 1;
return array($path => ($result ? '' : __('Incorrect value')));
}
/**
* Validates string length - must be 0 or 1 character long
*
* @param string $path
* @param array $values
* @return array
*/
function validate_str01($path, $values)
{
$result = strlen($values[$path]) <= 1;
return array($path => ($result ? '' : __('Incorrect value')));
}
?>