Changeset 2479


Ignore:
Timestamp:
10/08/21 18:29:38 (3 years ago)
Author:
nanardon
Message:

Allow to specify default values for attribute in la-allowed-values.ini

Location:
trunk/LATMOS-Accounts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm

    r2457 r2479  
    186186        my ($val) = $self->val( '_defattr_', $_ ); 
    187187        $defattr{ $_ } = $val; 
     188    } 
     189 
     190    if (my $ini = $self->{_allowed_values}) { 
     191        foreach my $attr ( $ini->Sections ) { 
     192            if ( my @defaults = $ini->val( $attr, 'default' ) ) { 
     193                $defattr{ $attr } = @defaults > 1 ? @defaults : $defaults[0]; 
     194            } 
     195        } 
    188196    } 
    189197 
  • trunk/LATMOS-Accounts/man/man5/la-allowed-values.ini.pod

    r1214 r2479  
    2020=head2 VARIABLES 
    2121 
     22=head3 default 
     23 
     24The default value for this attribute 
     25 
    2226=head3 allowed 
    2327 
Note: See TracChangeset for help on using the changeset viewer.