Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
8cea1907
Commit
8cea1907
authored
Jan 05, 2011
by
Gervase Markham
Committed by
Gervase Markham
Jan 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document how to add user settings. r,a=mkanat.
https://bugzilla.mozilla.org/show_bug.cgi?id=616427
parent
f6a3f831
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
Extension.pm
Bugzilla/Extension.pm
+2
-1
Extension.pm
extensions/Example/Extension.pm
+11
-0
setting-descs-settings.none.tmpl
...e/en/default/hook/global/setting-descs-settings.none.tmpl
+7
-0
No files found.
Bugzilla/Extension.pm
View file @
8cea1907
...
...
@@ -272,7 +272,8 @@ This is the base class for all Bugzilla extensions.
The L</SYNOPSIS> above gives a pretty good overview of what's basically
required to write an extension. This section gives more information
on exactly how extensions work and how you write them.
on exactly how extensions work and how you write them. There is also a
L<wiki page|https://wiki.mozilla.org/Bugzilla:Extension_Notes> with additional HOWTOs, tips and tricks.
=head2 Using F<extensions/create.pl>
...
...
extensions/Example/Extension.pm
View file @
8cea1907
...
...
@@ -28,6 +28,7 @@ use Bugzilla::Constants;
use
Bugzilla::
Error
;
use
Bugzilla::
Group
;
use
Bugzilla::
User
;
use
Bugzilla::User::
Setting
;
use
Bugzilla::
Util
qw(diff_arrays html_quote)
;
use
Bugzilla::
Status
qw(is_open_state)
;
...
...
@@ -384,6 +385,16 @@ sub group_end_of_update {
sub
install_before_final_checks
{
my
(
$self
,
$args
)
=
@_
;
print
"Install-before_final_checks hook\n"
unless
$args
->
{
silent
};
# Add a new user setting like this:
#
# add_setting('product_chooser', # setting name
# ['pretty', 'full', 'small'], # options
# 'pretty'); # default
#
# To add descriptions for the setting and choices, add extra values to
# the hash defined in global/setting-descs.none.tmpl. Do this in a hook:
# hook/global/setting-descs-settings.none.tmpl .
}
sub
job_map
{
...
...
extensions/Example/template/en/default/hook/global/setting-descs-settings.none.tmpl
0 → 100644
View file @
8cea1907
[%
setting_descs.product_chooser = "Product chooser to use when entering $terms.bugs",
setting_descs.pretty = "Pretty chooser with common products and icons",
setting_descs.full = "Full chooser with all products",
setting_descs.small = "Product chooser for mobile devices",
%]
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment