}
+class Horde_Form_Type_ip6address extends Horde_Form_Type_text {
+
+ function isValid(&$var, &$vars, $value, &$message)
+ {
+ $valid = true;
+
+ if (strlen(trim($value)) > 0) {
+ $valid = @inet_pton($value);
+
+ if ($valid === false) {
+ $message = _("Please enter a valid IP address.");
+ }
+ } elseif ($var->isRequired()) {
+ $valid = false;
+ $message = _("This field is required.");
+ }
+
+ return true;
+ }
+
+ /**
+ * Return info about field type.
+ */
+ function about()
+ {
+ return array('name' => _("IPv6 address"));
+ }
+
+}
+
class Horde_Form_Type_longtext extends Horde_Form_Type_text {
var $_rows;
);
}
+ protected function _renderVarInput_ip6address($form, &$var, &$vars)
+ {
+ $varname = @htmlspecialchars($var->getVarName(), ENT_QUOTES, $this->_charset);
+ return sprintf('<input type="text" name="%s" id="%s" size="40" value="%s" %s%s />',
+ $varname,
+ $varname,
+ @htmlspecialchars($var->getValue($vars), ENT_QUOTES, $this->_charset),
+ $var->isDisabled() ? ' disabled="disabled" ' : '',
+ $this->_getActionScripts($form, $var)
+ );
+ }
+
protected function _renderVarInput_file($form, &$var, &$vars)
{
$varname = @htmlspecialchars($var->getVarName(), ENT_QUOTES, $this->_charset);