summaryrefslogtreecommitdiffstats
path: root/extensions/Example/lib/Config.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Example/lib/Config.pm')
-rw-r--r--extensions/Example/lib/Config.pm53
1 files changed, 52 insertions, 1 deletions
diff --git a/extensions/Example/lib/Config.pm b/extensions/Example/lib/Config.pm
index 311ea4a6a..c183b0efc 100644
--- a/extensions/Example/lib/Config.pm
+++ b/extensions/Example/lib/Config.pm
@@ -22,7 +22,58 @@ sub get_param_list {
{
name => 'example_string',
type => 't',
- default => 'EXAMPLE',
+ default => 'Bugzilla is powerful'
+ },
+ {
+ name => 'example_constrained_string',
+ type => 't',
+ default => '12-xfdd-5',
+ checker => sub { $_[0] =~ /^\d{2}\-[a-zA-Z]{4}\-\d$/ ?
+ '' : "$_[0] must be of the form NN-XXXX-N"; }
+ },
+ {
+ name => 'example_number',
+ type => 't',
+ default => '905',
+ checker => \&check_numeric
+ },
+ {
+ name => 'example_password',
+ type => 'p',
+ default => '1234'
+ },
+ {
+ name => 'example_multi_lines',
+ type => 'l',
+ default => "This text can be very long.\n\nVery very long!"
+ },
+ # Default can only be 0 or 1.
+ {
+ name => 'example_boolean',
+ type => 'b',
+ default => 0
+ },
+ {
+ name => 'example_single_select',
+ type => 's',
+ choices => [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday' ],
+ default => 'Thursday',
+ checker => \&check_multi
+ },
+ {
+ name => 'example_multi_select',
+ type => 'm',
+ choices => [ 'Mercury', 'Venus', 'Mars', 'Jupiter', 'Saturn' ],
+ default => [ 'Venus', 'Saturn' ],
+ checker => \&check_multi
+ },
+ # This one lets you order selected items.
+ {
+ name => 'example_multi_ordered',
+ type => 'o',
+ choices => [ 'Perl', 'Python', 'PHP', 'C++', 'Java' ],
+ default => 'Perl,C++',
+ checker => \&check_multi
},
);
return @param_list;