my $title_sub = delete($attributes{title_sub});
my $default_sub = delete($attributes{default_sub});
+ my $with_empty = delete($attributes{with_empty});
+ my $empty_title = delete($attributes{empty_title});
my %selected;
my @options;
- if ( delete($attributes{with_empty}) ) {
- push(@options, [undef, $attributes{empty_title} || '']);
+ if ( $with_empty ) {
+ push(@options, [undef, $empty_title || '']);
}
my $normalize_entry = sub {
my $title;
if ( $value_title_sub ) {
- ($value, $title) = $value_title_sub->($entry);
+ ($value, $title) = @{ $value_title_sub->($entry) };
} else {
$value = $normalize_entry->('value', $entry, $value_sub, $value_key);
my $by_spec = $sort_spec->{$by};
my %current_sort_params = $controller->get_current_sort_params;
my ($image, $new_dir) = ('', $current_sort_params{dir});
- my $title = delete($params{title}) || $by_spec->{title};
+ my $title = delete($params{title}) || $::locale->text($by_spec->{title});
if ($current_sort_params{by} eq $by) {
my $current_dir = $current_sort_params{dir} ? 'up' : 'down';
my %paginate_params = $controller->get_current_paginate_params;
my %template_params = (
- pages => {
- cur => $paginate_params{page},
- max => $paginate_params{num_pages},
- common => $paginate_params{common_pages},
- },
+ pages => \%paginate_params,
url_maker => sub {
my %url_params = _hashify(@_);
$url_params{ $paginate_spec->{FORM_PARAMS}->[0] } = delete $url_params{page};