CVS: phpweather/config pw_option_integer.php,NONE,1.1
Brought to you by:
iridium
|
From: Martin G. <gim...@us...> - 2002-04-12 22:01:52
|
Update of /cvsroot/phpweather/phpweather/config
In directory usw-pr-cvs1:/tmp/cvs-serv15292
Added Files:
pw_option_integer.php
Log Message:
New wrapper-type: integers doesn't need to be quoted in defaults.php.
--- NEW FILE ---
<?php
class pw_option_integer extends pw_option_text {
function pw_option_integer($name, $description, $dependencies,
$validator = false, $default = false) {
if (!$validator) {
$validator = new pw_validator_ereg("Sorry, '%s' is not an integer.", '^[-+]?[0-9]+$');
}
$this->pw_option_text($name, $description, $dependencies, $validator, $default);
}
function get_config() {
if ($this->is_ready() && $this->is_valid() &&
$this->value != $this->default) {
return "/* $this->name */\n\$this->properties['$this->name'] = " .
"$this->value;\n\n";
} else {
return '';
}
}
}
?>
|