[Jifty-commit] r799 - in jifty/trunk: . lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Apr 2 11:27:29 EDT 2006
Author: jesse
Date: Sun Apr 2 11:27:26 2006
New Revision: 799
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Action.pm
jifty/trunk/lib/Jifty/Action/Record.pm
Log:
r11032 at hualien: jesse | 2006-04-03 00:25:39 +0900
* Second half of "sort order for arguments" patch, as suggested by miyagawa
Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm (original)
+++ jifty/trunk/lib/Jifty/Action.pm Sun Apr 2 11:27:26 2006
@@ -514,9 +514,17 @@
=cut
+
sub argument_names {
- my $self = shift;
- return (sort keys %{$self->arguments});
+ my $self = shift;
+ my %arguments = %{ $self->arguments };
+ return (
+ sort {
+ (($arguments{$a}->{'sort_order'} ||0 ) <=> ($arguments{$b}->{'sort_order'} || 0))
+ || (($arguments{$a}->{'name'} || '') cmp ($arguments{$b}->{'name'} ||'' ))
+ || $a cmp $b
+ } keys %arguments
+ );
}
Modified: jifty/trunk/lib/Jifty/Action/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record.pm (original)
+++ jifty/trunk/lib/Jifty/Action/Record.pm Sun Apr 2 11:27:26 2006
@@ -213,7 +213,7 @@
# If we're hand-coding a render_as, hints or label, let's use it.
- for ( qw(render_as label hints length mandatory)) {
+ for ( qw(render_as label hints length mandatory sort_order)) {
if ( defined $column->$_ and not $info->{$_}) {
$info->{$_} = $column->$_;
More information about the Jifty-commit
mailing list