diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-24 19:08:51 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-28 14:37:11 +0100 |
commit | 4ebaa1cc000bc096ebaa41b5c12da74c69692915 (patch) | |
tree | 6919d12aefe1b3e6cff5199db240fb1f3c53bacd /perllib/FixMyStreet | |
parent | de66ef715820b3361a7124b0046cb9708c097d48 (diff) |
Add feature cobrand helper function.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index a8146128e..a08a8dff7 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -59,6 +59,21 @@ sub path_to_email_templates { return $paths; } +=item feature + +A helper utility to let you provide per-cobrand hooks for configuration. +Mostly useful if running a site with multiple cobrands. + +=cut + +sub feature { + my ($self, $feature) = @_; + my $features = FixMyStreet->config('COBRAND_FEATURES'); + return unless $features && ref $features eq 'HASH'; + return unless $features->{$feature} && ref $features->{$feature} eq 'HASH'; + return $features->{$feature}->{$self->moniker}; +} + =item password_minimum_length Returns the minimum length a password can be set to. |