aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Cobrands/Emptyhomes/Util.pm
blob: 9d9b92903e23a09bdf14a9961c04e867902bb111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/perl -w
#
# Util.pm:
# Emptyhomes Cobranding for FixMyStreet.
#
#
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org. WWW: http://www.mysociety.org
#
# $Id: Util.pm,v 1.7 2009-12-15 14:55:53 louise Exp $

package Cobrands::Emptyhomes::Util;
use Standard;
use strict;
use Carp;
use mySociety::Web qw(ent);

sub new{
    my $class = shift;
    return bless {}, $class;
}

=item site_restriction Q

Return a site restriction clause and a site key.

=cut
sub site_restriction{
    return ('', 0);
}

=item

Return the base url for this cobranded site

=cut

sub base_url {
   my $base_url = mySociety::Config::get('BASE_URL');
   if ($base_url !~ /emptyhomes/) {
       $base_url =~ s/http:\/\//http:\/\/emptyhomes\./g;
   }
   return $base_url;
}

=item set_lang_and_domain LANG UNICODE

Set the language and text domain for the site based on the query and host. 

=cut

sub set_lang_and_domain{
    my ($self, $lang, $unicode) = @_;
    mySociety::Locale::negotiate_language('en-gb,English,en_GB|cy,Cymraeg,cy_GB', $lang);
    mySociety::Locale::gettext_domain('FixMyStreet-EmptyHomes', $unicode);
    mySociety::Locale::change();
}

=item site_title

Return the title to be used in page heads

=cut 

sub site_title { 
    my ($self) = @_;
    return _('Report Empty Homes');
}

=item feed_xsl

Return the XSL file path to be used for feeds'

=cut
sub feed_xsl {
    my ($self) = @_;
    return '/xsl.eha.xsl';
}

1;