[Jifty-commit] r2571 - in jifty/trunk/lib/Jifty: Web/Form
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Jan 26 06:29:28 EST 2007
Author: audreyt
Date: Fri Jan 26 06:29:25 2007
New Revision: 2571
Modified:
jifty/trunk/lib/Jifty/Param/Schema.pm
jifty/trunk/lib/Jifty/Web/Form/Field.pm
Log:
* Jifty: Deprecate ->length in web form and param fields;
write ->max_length instead.
Modified: jifty/trunk/lib/Jifty/Param/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Param/Schema.pm (original)
+++ jifty/trunk/lib/Jifty/Param/Schema.pm Fri Jan 26 06:29:25 2007
@@ -88,7 +88,6 @@
valid => 'valid_values',
render => 'render_as',
order => 'sort_order',
- max_length => 'length',
},
copula => {
is => '',
Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm Fri Jan 26 06:29:25 2007
@@ -13,7 +13,7 @@
label
hints
placeholder
-length
+max_length
mandatory
=end properties
@@ -104,8 +104,8 @@
=cut
-sub accessors { shift->SUPER::accessors(), qw(name label input_name type sticky sticky_value default_value action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode length _element_id disable_autocomplete); }
-__PACKAGE__->mk_accessors(qw(name _label _input_name type sticky sticky_value default_value _action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode length _element_id disable_autocomplete));
+sub accessors { shift->SUPER::accessors(), qw(name label input_name type sticky sticky_value default_value action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode max_length _element_id disable_autocomplete); }
+__PACKAGE__->mk_accessors(qw(name _label _input_name type sticky sticky_value default_value _action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode max_length _element_id disable_autocomplete));
=head2 name [VALUE]
@@ -489,7 +489,7 @@
$field .= qq! id="@{[ $self->element_id ]}"!;
$field .= qq! value="@{[Jifty->web->escape($self->current_value)]}"! if defined $self->current_value;
$field .= $self->_widget_class;
- $field .= qq! size="@{[ $self->length() ]}" maxlength="@{[ $self->length() ]}"! if ($self->length());
+ $field .= qq! size="@{[ $self->max_length() ]}" maxlength="@{[ $self->length() ]}"! if ($self->max_length());
$field .= qq! autocomplete="off"! if defined $self->disable_autocomplete;
$field .= " " .$self->other_widget_properties;
$field .= qq! />\n!;
@@ -711,4 +711,13 @@
return '';
}
+
+# Deprecated API
+sub length {
+ my $self = shift;
+ Carp::carp("->length is deprecated; use ->max_length instead");
+ $self->max_length(@_);
+}
+
+
1;
More information about the Jifty-commit
mailing list