From 183719adf844b5497699c60625c6268e1640d9de Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Tue, 6 May 2008 04:01:22 +0000 Subject: Bug 430909 - add hook for parameters r=mkanat, r/a=lpsolit --- extensions/example/code/config.pl | 26 ++++++++++++++ extensions/example/lib/ConfigExample.pm | 41 ++++++++++++++++++++++ .../en/default/admin/params/example.html.tmpl | 28 +++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 extensions/example/code/config.pl create mode 100644 extensions/example/lib/ConfigExample.pm create mode 100644 extensions/example/template/en/default/admin/params/example.html.tmpl (limited to 'extensions') diff --git a/extensions/example/code/config.pl b/extensions/example/code/config.pl new file mode 100644 index 000000000..1da490cc2 --- /dev/null +++ b/extensions/example/code/config.pl @@ -0,0 +1,26 @@ +# -*- Mode: perl; indent-tabs-mode: nil -*- +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is the Bugzilla Example Plugin. +# +# The Initial Developer of the Original Code is Canonical Ltd. +# Portions created by Canonical Ltd. are Copyright (C) 2008 +# Canonical Ltd. All Rights Reserved. +# +# Contributor(s): Max Kanat-Alexander +# Bradley Baetz + +use strict; +use warnings; +use Bugzilla; +my $config = Bugzilla->hook_args->{config}; +$config->{Example} = "extensions::example::lib::ConfigExample"; diff --git a/extensions/example/lib/ConfigExample.pm b/extensions/example/lib/ConfigExample.pm new file mode 100644 index 000000000..5ee612de2 --- /dev/null +++ b/extensions/example/lib/ConfigExample.pm @@ -0,0 +1,41 @@ +# -*- Mode: perl; indent-tabs-mode: nil -*- +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is the Bugzilla Example Plugin. +# +# The Initial Developer of the Original Code is Canonical Ltd. +# Portions created by Canonical Ltd. are Copyright (C) 2008 +# Canonical Ltd. All Rights Reserved. +# +# Contributor(s): Max Kanat-Alexander +# Bradley Baetz + +package extensions::example::lib::ConfigExample; +use strict; +use warnings; + +use Bugzilla::Config::Common; + +sub get_param_list { + my ($class) = @_; + + my @param_list = ( + { + name => 'example_string', + type => 't', + default => 'EXAMPLE', + }, + ); + return @param_list; +} + +1; diff --git a/extensions/example/template/en/default/admin/params/example.html.tmpl b/extensions/example/template/en/default/admin/params/example.html.tmpl new file mode 100644 index 000000000..e2bb5f35c --- /dev/null +++ b/extensions/example/template/en/default/admin/params/example.html.tmpl @@ -0,0 +1,28 @@ +[%# + # The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Example Plugin. + # + # The Initial Developer of the Original Code is Canonical Ltd. + # Portions created by Canonical Ltd. are Copyright (C) 2008 + # Canonical Ltd. All Rights Reserved. + # + # Contributor(s): Bradley Baetz + #%] +[% + title = "Example Extension" + desc = "Configure example extension" +%] + +[% param_descs = { + example_string => "Example string", +} +%] -- cgit v1.2.3-24-g4f1b