aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-09-30 22:39:28 +0000
committermkanat%bugzilla.org <>2009-09-30 22:39:28 +0000
commit58787923c838e5a1fc90d3f98e27a443bb1e1122 (patch)
tree52c55649b3d9283985a5612393ad1a9276435f94 /Bugzilla
parent832be61ce419f06cc682e7afc07d9197592a6bf5 (diff)
downloadbugs-58787923c838e5a1fc90d3f98e27a443bb1e1122.tar
bugs-58787923c838e5a1fc90d3f98e27a443bb1e1122.tar.gz
bugs-58787923c838e5a1fc90d3f98e27a443bb1e1122.tar.bz2
bugs-58787923c838e5a1fc90d3f98e27a443bb1e1122.tar.xz
bugs-58787923c838e5a1fc90d3f98e27a443bb1e1122.zip
Bug 509053: Implement Bugzilla->feature (feature_enabled in the templates), and use it to detect when PatchReader is available.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Template.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index d6f665952..bea1639f3 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -281,12 +281,8 @@ sub get_attachment_link {
# If the attachment is a patch, try to link to the diff rather
# than the text, by default.
my $patchlink = "";
- if ($is_patch) {
- # Determine if PatchReader is installed
- my $patchviewer_installed = eval { require PatchReader; };
- if ($patchviewer_installed) {
- $patchlink = '&amp;action=diff';
- }
+ if ($is_patch and Bugzilla->feature('patch_viewer')) {
+ $patchlink = '&amp;action=diff';
}
# Whitespace matters here because these links are in <pre> tags.
@@ -745,6 +741,8 @@ sub create {
return \@bug_list;
},
+ 'feature_enabled' => sub { return Bugzilla->feature(@_); },
+
# These don't work as normal constants.
DB_MODULE => \&Bugzilla::Constants::DB_MODULE,
REQUIRED_MODULES =>