Revision 2737667a
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DB/CustomVariableConfig.pm | ||
---|---|---|
6 | 6 |
use strict; |
7 | 7 |
|
8 | 8 |
use SL::DB::MetaSetup::CustomVariableConfig; |
9 |
use SL::DB::Manager::CustomVariableConfig; |
|
9 | 10 |
use SL::DB::Helper::ActsAsList; |
10 | 11 |
|
11 |
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. |
|
12 |
__PACKAGE__->meta->make_manager_class; |
|
12 |
__PACKAGE__->configure_acts_as_list(group_by => [qw(module)]); |
|
13 |
|
|
14 |
sub validate { |
|
15 |
my ($self) = @_; |
|
16 |
|
|
17 |
my @errors; |
|
18 |
push @errors, $::locale->text('The name is missing.') if !$self->name; |
|
19 |
push @errors, $::locale->text('The description is missing.') if !$self->description; |
|
20 |
push @errors, $::locale->text('The type is missing.') if !$self->type; |
|
21 |
push @errors, $::locale->text('The option field is empty.') if (($self->type || '') eq 'select') && !$self->options; |
|
22 |
|
|
23 |
return @errors; |
|
24 |
} |
|
13 | 25 |
|
14 | 26 |
1; |
Auch abrufbar als: Unified diff
Verwaltung von benutzerdefinierten Variablen auf Controller umgestellt