diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2010-11-04 18:00:58 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2010-11-04 18:00:58 +0100 |
commit | a3c3abffe5a964685d596a82261fde79b416107a (patch) | |
tree | 239d968be3e690f72f843189f3e770f0f98c2644 /extensions/Example/Extension.pm | |
parent | be891c97c342f6197a72897272fc11c81ba4381e (diff) | |
download | bugzilla-a3c3abffe5a964685d596a82261fde79b416107a.tar.gz bugzilla-a3c3abffe5a964685d596a82261fde79b416107a.tar.xz |
Bug 485418: Code and template hooks for userprefs.cgi to be able to add additional tabs
r=mkanat a=LpSolit
Diffstat (limited to 'extensions/Example/Extension.pm')
-rw-r--r-- | extensions/Example/Extension.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index 5c6865362..f16ddf725 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -682,6 +682,26 @@ sub bug_check_can_change_field { } } +sub user_preferences { + my ($self, $args) = @_; + my $tab = $args->{current_tab}; + my $save = $args->{save_changes}; + my $handled = $args->{handled}; + + return unless $tab eq 'my_tab'; + + my $value = Bugzilla->input_params->{'example_pref'}; + if ($save) { + # Validate your data and update the DB accordingly. + $value =~ s/\s+/:/g; + } + $args->{'vars'}->{example_pref} = $value; + + # Set the 'handled' scalar reference to true so that the caller + # knows the panel name is valid and that an extension took care of it. + $$handled = 1; +} + sub webservice { my ($self, $args) = @_; |