@@ -116,24 +116,24 @@ discard block |
||
116 | 116 | <?php } ?> |
117 | 117 | |
118 | 118 | <?php |
119 | - if( |
|
120 | - $members || |
|
119 | + if( |
|
120 | + $members || |
|
121 | 121 | (isset($constituencies) && count($constituencies) > 0) || |
122 | 122 | ($alertsearch) |
123 | - ) { |
|
124 | - /* We need to disambiguate the user's instructions */ |
|
125 | - $member_options = false; |
|
126 | - ?> |
|
123 | + ) { |
|
124 | + /* We need to disambiguate the user's instructions */ |
|
125 | + $member_options = false; |
|
126 | + ?> |
|
127 | 127 | <div class="alert-section alert-section--disambiguation"> |
128 | 128 | <div class="alert-section__primary"> |
129 | 129 | |
130 | 130 | <?php if ($members) { |
131 | - $member_options = true; ?> |
|
131 | + $member_options = true; ?> |
|
132 | 132 | <h3><?= sprintf(gettext('Sign up for alerts when people matching <i>%s</i> speaks'), _htmlspecialchars($alertsearch)) ?></h3> |
133 | 133 | <ul> |
134 | 134 | <?php |
135 | 135 | foreach ($members as $row) { |
136 | - ?> |
|
136 | + ?> |
|
137 | 137 | <li> |
138 | 138 | <form action="<?= $actionurl ?>" method="post"> |
139 | 139 | <input type="hidden" name="t" value="<?= _htmlspecialchars($token) ?>"> |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | <?php } ?> |
155 | 155 | |
156 | 156 | <?php if (isset($constituencies) && count($constituencies) > 0) { |
157 | - $member_options = true; ?> |
|
157 | + $member_options = true; ?> |
|
158 | 158 | <h3><?= sprintf(gettext('Sign up for alerts when MPs for constituencies matching <i>%s</i> speaks'), _htmlspecialchars($alertsearch)) ?></h3> |
159 | 159 | <ul> |
160 | 160 | <?php foreach ($constituencies as $constituency => $member) { ?> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | are mentioned in the same debate.') ?> |
204 | 204 | <?php if (isset($member_alertsearch)) { |
205 | 205 | printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…')); |
206 | - } ?> |
|
206 | + } ?> |
|
207 | 207 | </em> |
208 | 208 | <?php } ?> |
209 | 209 | </li> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <div class="full-page"> |
2 | 2 | <div class="full-page__row"> |
3 | 3 | |
4 | - <?php if ( $message ) { ?> |
|
4 | + <?php if ($message) { ?> |
|
5 | 5 | <div class="alert-section alert-section--feedback"> |
6 | 6 | <div class="alert-section__primary"> |
7 | 7 | <h3><?= $message['title'] ?></h3> |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | </div> |
13 | 13 | <?php } ?> |
14 | 14 | |
15 | - <?php if ( $results ) { ?> |
|
15 | + <?php if ($results) { ?> |
|
16 | 16 | <div class="alert-section alert-section--feedback"> |
17 | 17 | <div class="alert-section__primary"> |
18 | - <?php if ( $results == 'alert-confirmed' ) { ?> |
|
18 | + <?php if ($results == 'alert-confirmed') { ?> |
|
19 | 19 | <h3><?= gettext('Your alert has been confirmed') ?></h3> |
20 | 20 | <p> |
21 | 21 | <?= gettext('You will now receive email alerts for the following criteria:') ?> |
@@ -44,31 +44,31 @@ discard block |
||
44 | 44 | </div> |
45 | 45 | </noscript> |
46 | 46 | |
47 | - <?php } elseif ( $results == 'alert-suspended' ) { ?> |
|
47 | + <?php } elseif ($results == 'alert-suspended') { ?> |
|
48 | 48 | <h3><?= gettext('Alert suspended') ?></h3> |
49 | 49 | <p> |
50 | 50 | <?= gettext('You can reactivate the alert at any time, from the sidebar below.') ?> |
51 | 51 | </p> |
52 | 52 | |
53 | - <?php } elseif ( $results == 'alert-resumed' ) { ?> |
|
53 | + <?php } elseif ($results == 'alert-resumed') { ?> |
|
54 | 54 | <h3><?= gettext('Alert resumed') ?></h3> |
55 | 55 | <p> |
56 | 56 | <?= gettext('You will now receive email alerts on any day when there are entries in Hansard that match your criteria.') ?> |
57 | 57 | </p> |
58 | 58 | |
59 | - <?php } elseif ( $results == 'alert-deleted' ) { ?> |
|
59 | + <?php } elseif ($results == 'alert-deleted') { ?> |
|
60 | 60 | <h3><?= gettext('Alert deleted') ?></h3> |
61 | 61 | <p> |
62 | 62 | <?= gettext('You will no longer receive this alert.') ?> |
63 | 63 | </p> |
64 | 64 | |
65 | - <?php } elseif ( $results == 'all-alerts-deleted' ) { ?> |
|
65 | + <?php } elseif ($results == 'all-alerts-deleted') { ?> |
|
66 | 66 | <h3><?= gettext('All alerts deleted') ?></h3> |
67 | 67 | <p> |
68 | 68 | <?= gettext('You will no longer receive any alerts.') ?> |
69 | 69 | </p> |
70 | 70 | |
71 | - <?php } elseif ( $results == 'alert-fail' ) { ?> |
|
71 | + <?php } elseif ($results == 'alert-fail') { ?> |
|
72 | 72 | <h3><?= gettext('Hmmm, something’s not right') ?></h3> |
73 | 73 | <p> |
74 | 74 | <?= gettext('The link you followed to reach this page appears to be incomplete.') ?> |
@@ -80,31 +80,31 @@ discard block |
||
80 | 80 | <?= sprintf(gettext('If you still get this message, please do <a href="mailto:%s">email us</a> and let us know, and we’ll help out!'), str_replace('@', '@', CONTACTEMAIL)) ?> |
81 | 81 | </p> |
82 | 82 | |
83 | - <?php } elseif ( $results == 'alert-added' ) { ?> |
|
83 | + <?php } elseif ($results == 'alert-added') { ?> |
|
84 | 84 | <h3><?= gettext('Your alert has been added') ?></h3> |
85 | 85 | <p> |
86 | 86 | <?= sprintf(gettext('You will now receive email alerts on any day when %s in parliament.'), _htmlspecialchars($criteria)) ?> |
87 | 87 | </p> |
88 | 88 | |
89 | - <?php } elseif ( $results == 'alert-confirmation' ) { ?> |
|
89 | + <?php } elseif ($results == 'alert-confirmation') { ?> |
|
90 | 90 | <h3><?= gettext('We’re nearly done…') ?></h3> |
91 | 91 | <p> |
92 | 92 | <?= gettext('You should receive an email shortly which will contain a link. You will need to follow that link to confirm your email address and receive future alerts. Thanks.') ?> |
93 | 93 | </p> |
94 | 94 | |
95 | - <?php } elseif ( $results == 'alert-exists' ) { ?> |
|
95 | + <?php } elseif ($results == 'alert-exists') { ?> |
|
96 | 96 | <h3><?= gettext('You’re already subscribed to that!') ?></h3> |
97 | 97 | <p> |
98 | 98 | <?= gettext('It’s good to know you’re keen though.') ?> |
99 | 99 | </p> |
100 | 100 | |
101 | - <?php } elseif ( $results == 'alert-already-signed' ) { ?> |
|
101 | + <?php } elseif ($results == 'alert-already-signed') { ?> |
|
102 | 102 | <h3><?= gettext('We’re nearly done') ?></h3> |
103 | 103 | <p> |
104 | 104 | <?= gettext('You should receive an email shortly which will contain a link. You will need to follow that link to confirm your email address and receive future alerts. Thanks.') ?> |
105 | 105 | </p> |
106 | 106 | |
107 | - <?php } elseif ( $results == 'alert-fail' ) { ?> |
|
107 | + <?php } elseif ($results == 'alert-fail') { ?> |
|
108 | 108 | <h3><?= gettext('Alert could not be created') ?></h3> |
109 | 109 | <p> |
110 | 110 | <?= sprintf(gettext('Sorry, we were unable to create that alert. Please <a href="mailto:%s">let us know</a>. Thanks.'), str_replace('@', '@', CONTACTEMAIL)) ?> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | <?php } ?> |
117 | 117 | |
118 | 118 | <?php |
119 | - if( |
|
119 | + if ( |
|
120 | 120 | $members || |
121 | 121 | (isset($constituencies) && count($constituencies) > 0) || |
122 | 122 | ($alertsearch) |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | <?php } ?> |
173 | 173 | |
174 | 174 | <?php if ($alertsearch) { |
175 | - if ( $member_options ) { ?> |
|
175 | + if ($member_options) { ?> |
|
176 | 176 | <h3><?= gettext('Sign up for alerts for topics') ?></h3> |
177 | 177 | <?php } else { ?> |
178 | 178 | <h3><?= gettext('Great! Can you just confirm what you mean?') ?></h3> |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | <?= sprintf(gettext('Receive alerts when %s'), _htmlspecialchars($alertsearch_pretty)) ?> |
187 | 187 | <input type="submit" class="button small" value="<?= gettext('Subscribe') ?>"> |
188 | 188 | </form> |
189 | - <?php if ( isset($mistakes['multiple']) ) { ?> |
|
189 | + <?php if (isset($mistakes['multiple'])) { ?> |
|
190 | 190 | <em class="error"><?= gettext(' |
191 | 191 | You have used a comma in your search term – |
192 | 192 | are you sure this is what you want? You cannot |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | for each individual term.') ?> |
196 | 196 | </em> |
197 | 197 | <?php } ?> |
198 | - <?php if ( isset($mistakes['postcode_and']) ) { ?> |
|
198 | + <?php if (isset($mistakes['postcode_and'])) { ?> |
|
199 | 199 | <em class="error"><?= gettext(' |
200 | 200 | You have used a postcode and something else in your |
201 | 201 | search term – are you sure this is what you |
@@ -253,11 +253,11 @@ discard block |
||
253 | 253 | <div class="alert-section__secondary"> |
254 | 254 | <?php if ($email_verified) { ?> |
255 | 255 | |
256 | - <?php if ( $alerts ) { ?> |
|
256 | + <?php if ($alerts) { ?> |
|
257 | 257 | <?php include('_list.php'); ?> |
258 | 258 | <?php } ?> |
259 | 259 | |
260 | - <?php if ( $current_mp ) { ?> |
|
260 | + <?php if ($current_mp) { ?> |
|
261 | 261 | <h3><?= gettext('Your MP alert') ?></h3> |
262 | 262 | <ul class="alerts-manage__list"> |
263 | 263 | <li> |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <h3><?= gettext('Your current email alerts') ?></h3> |
2 | 2 | |
3 | 3 | <ul class="alerts-manage__list"> |
4 | - <?php foreach ( $alerts as $alert ) { ?> |
|
4 | + <?php foreach ($alerts as $alert) { ?> |
|
5 | 5 | <li> |
6 | 6 | <?= sprintf(gettext('When %s'), _htmlspecialchars($alert['criteria'])) ?>. |
7 | 7 | <form action="<?= $actionurl ?>" method="POST"> |
8 | 8 | <input type="hidden" name="t" value="<?= _htmlspecialchars($alert['token']) ?>"> |
9 | - <?php if ( $alert['status'] == 'unconfirmed' ) { ?> |
|
9 | + <?php if ($alert['status'] == 'unconfirmed') { ?> |
|
10 | 10 | <input type="submit" class="button small" name="action" value="<?= gettext('Confirm') ?>"> |
11 | - <?php } elseif ( $alert['status'] == 'suspended' ) { ?> |
|
11 | + <?php } elseif ($alert['status'] == 'suspended') { ?> |
|
12 | 12 | <input type="submit" class="button small" name="action" value="<?= gettext('Resume') ?>"> |
13 | 13 | <?php } else { ?> |
14 | 14 | <input type="submit" class="button button--secondary small" name="action" value="<?= gettext('Suspend') ?>"> |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <input type="text" name="q" value="<?= _htmlentities($search_keyword) ?>" class="form-control"> |
5 | 5 | <input type="submit" class="button" value="<?= gettext('Search') ?>"> |
6 | 6 | </p> |
7 | - <?php if (isset($warnings) ) { ?> |
|
7 | + <?php if (isset($warnings)) { ?> |
|
8 | 8 | <p class="error"> |
9 | 9 | <?= $warnings ?> |
10 | 10 | </p> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <p> |
19 | 19 | <ul class="search-result-display-options"> |
20 | 20 | <li><a href="#options" class="search-options-toggle js-toggle-search-options"><?= gettext('Advanced search') ?></a></li> |
21 | - <?php if ( $is_adv ) { ?> |
|
21 | + <?php if ($is_adv) { ?> |
|
22 | 22 | <?= $search_phrase ? '<li>' . gettext('Exactly:') . ' ' . _htmlentities($search_phrase) . '</li>' : '' ?> |
23 | 23 | <?= $search_exclude ? '<li>' . gettext('Excluding:') . ' ' . _htmlentities($search_exclude) . '</li>' : '' ?> |
24 | 24 | <?= $search_from ? '<li>' . gettext('From:') . ' ' . _htmlentities($search_from) . '</li>' : '' ?> |
@@ -9,19 +9,19 @@ discard block |
||
9 | 9 | <div class="search-page__section__primary"> |
10 | 10 | <h2><?= sprintf(gettext('Who says <em class="current-search-term">%s</em> the most?'), _htmlentities($searchstring)) ?></h2> |
11 | 11 | |
12 | - <?php if ( isset($error) ) { ?> |
|
13 | - <?php if ( $error == 'No results' && isset( $house ) && $house != HOUSE_TYPE_ROYAL ) { ?> |
|
12 | + <?php if (isset($error)) { ?> |
|
13 | + <?php if ($error == 'No results' && isset($house) && $house != HOUSE_TYPE_ROYAL) { ?> |
|
14 | 14 | <ul class="search-result-display-options"> |
15 | 15 | <li> |
16 | - <?php if ( $house == HOUSE_TYPE_COMMONS) { ?> |
|
16 | + <?php if ($house == HOUSE_TYPE_COMMONS) { ?> |
|
17 | 17 | No results for MPs only |
18 | - <?php } else if ( $house == HOUSE_TYPE_LORDS) { ?> |
|
18 | + <?php } else if ($house == HOUSE_TYPE_LORDS) { ?> |
|
19 | 19 | No results for Peers only |
20 | - <?php } else if ( $house == HOUSE_TYPE_SCOTLAND) { ?> |
|
20 | + <?php } else if ($house == HOUSE_TYPE_SCOTLAND) { ?> |
|
21 | 21 | No results for MSPs only |
22 | - <?php } else if ( $house == HOUSE_TYPE_WALES) { ?> |
|
22 | + <?php } else if ($house == HOUSE_TYPE_WALES) { ?> |
|
23 | 23 | <?= gettext('No results for MSs only') ?> |
24 | - <?php } else if ( $house == HOUSE_TYPE_NI) { ?> |
|
24 | + <?php } else if ($house == HOUSE_TYPE_NI) { ?> |
|
25 | 25 | No results for MLAs only |
26 | 26 | <?php } ?> |
27 | 27 | | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | <?php } ?> |
34 | 34 | <?php } ?> |
35 | 35 | |
36 | - <?php if ( $wtt ) { ?> |
|
36 | + <?php if ($wtt) { ?> |
|
37 | 37 | <p><strong>Now, try reading what a couple of these Lords are saying, |
38 | 38 | to help you find someone appropriate. When you've found someone, |
39 | 39 | follow the "I want to write to (name of lord)" link on their results page |
@@ -41,43 +41,43 @@ discard block |
||
41 | 41 | </strong></p> |
42 | 42 | <?php } ?> |
43 | 43 | |
44 | - <?php if ( isset($speakers) && count($speakers) ) { ?> |
|
44 | + <?php if (isset($speakers) && count($speakers)) { ?> |
|
45 | 45 | |
46 | - <?php if ( !$wtt ) { ?> |
|
46 | + <?php if (!$wtt) { ?> |
|
47 | 47 | <ul class="search-result-display-options"> |
48 | 48 | <li><?= gettext('Results grouped by person') ?></li> |
49 | 49 | <li> |
50 | - <?php if ( $house == HOUSE_TYPE_ROYAL) { ?> |
|
50 | + <?php if ($house == HOUSE_TYPE_ROYAL) { ?> |
|
51 | 51 | <?= gettext('Show All') ?> |
52 | 52 | <?php } else { ?> |
53 | 53 | <a href="<?= $this_url->generate('html') ?>"><?= gettext('Show All') ?></a> |
54 | 54 | <?php } ?> |
55 | 55 | | |
56 | - <?php if ( $house == HOUSE_TYPE_COMMONS) { ?> |
|
56 | + <?php if ($house == HOUSE_TYPE_COMMONS) { ?> |
|
57 | 57 | MPs only |
58 | 58 | <?php } else { ?> |
59 | 59 | <a href="<?= $this_url->generate('html', array('house'=>1)) ?>">MPs only</a> |
60 | 60 | <?php } ?> |
61 | 61 | | |
62 | - <?php if ( $house == HOUSE_TYPE_LORDS) { ?> |
|
62 | + <?php if ($house == HOUSE_TYPE_LORDS) { ?> |
|
63 | 63 | Peers only |
64 | 64 | <?php } else { ?> |
65 | 65 | <a href="<?= $this_url->generate('html', array('house'=>2)) ?>">Lords only</a> |
66 | 66 | <?php } ?> |
67 | 67 | | |
68 | - <?php if ( $house == HOUSE_TYPE_SCOTLAND) { ?> |
|
68 | + <?php if ($house == HOUSE_TYPE_SCOTLAND) { ?> |
|
69 | 69 | MSPs only |
70 | 70 | <?php } else { ?> |
71 | 71 | <a href="<?= $this_url->generate('html', array('house'=>4)) ?>">MSPs only</a> |
72 | 72 | <?php } ?> |
73 | 73 | | |
74 | - <?php if ( $house == HOUSE_TYPE_WALES) { ?> |
|
74 | + <?php if ($house == HOUSE_TYPE_WALES) { ?> |
|
75 | 75 | <?= gettext('MSs only') ?> |
76 | 76 | <?php } else { ?> |
77 | 77 | <a href="<?= $this_url->generate('html', array('house'=>5)) ?>"><?= gettext('MSs only') ?></a> |
78 | 78 | <?php } ?> |
79 | 79 | | |
80 | - <?php if ( $house == HOUSE_TYPE_NI) { ?> |
|
80 | + <?php if ($house == HOUSE_TYPE_NI) { ?> |
|
81 | 81 | MLAs only |
82 | 82 | <?php } else { ?> |
83 | 83 | <a href="<?= $this_url->generate('html', array('house'=>HOUSE_TYPE_NI)) ?>">MLAs only</a> |
@@ -98,25 +98,25 @@ discard block |
||
98 | 98 | </tr> |
99 | 99 | </thead> |
100 | 100 | <tbody> |
101 | - <?php foreach ( $speakers as $pid => $speaker ) { ?> |
|
101 | + <?php foreach ($speakers as $pid => $speaker) { ?> |
|
102 | 102 | |
103 | - <?php if ( $wtt && $pid == 0 ) { continue; } // skip heading count for WTT lords list ?> |
|
103 | + <?php if ($wtt && $pid == 0) { continue; } // skip heading count for WTT lords list ?> |
|
104 | 104 | |
105 | 105 | <tr> |
106 | 106 | <td><?= $speaker['count'] ?></td> |
107 | 107 | <td> |
108 | - <?php if ( $pid ) { ?> |
|
109 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
108 | + <?php if ($pid) { ?> |
|
109 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
110 | 110 | <a href="/search/?q=<?= _htmlentities($searchstring) ?>&pid=<?= $pid ?><?= isset($wtt) && $speaker['left'] == '9999-12-31' ? '&wtt=2' : '' ?>"> |
111 | 111 | <?php } ?> |
112 | 112 | <?= isset($speaker['name']) ? $speaker['name'] : 'N/A' ?> |
113 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
113 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
114 | 114 | </a> |
115 | 115 | <?php } ?> |
116 | - <?php if ( isset($speaker['party']) ) { ?> |
|
116 | + <?php if (isset($speaker['party'])) { ?> |
|
117 | 117 | <span class="search-results-grouped__speaker-party">(<?= $speaker['party'] ?>)</span> |
118 | 118 | <?php } ?> |
119 | - <?php if ( $house != HOUSE_TYPE_LORDS) { ?> |
|
119 | + <?php if ($house != HOUSE_TYPE_LORDS) { ?> |
|
120 | 120 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
121 | 121 | <?php } ?> |
122 | 122 | <?php } else { // no $pid ?> |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | <?php } ?> |
125 | 125 | </td> |
126 | 126 | <td> |
127 | - <?php if ( format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y') ) { ?> |
|
127 | + <?php if (format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y')) { ?> |
|
128 | 128 | <?= format_date($speaker['pmindate'], 'M Y') ?> |
129 | 129 | <?php } else { ?> |
130 | 130 | <?= format_date($speaker['pmindate'], 'M Y') ?> – <?= format_date($speaker['pmaxdate'], 'M Y') ?> |
@@ -2,12 +2,12 @@ |
||
2 | 2 | <img src="<?= $member->image()['url'] ?>" alt=""> |
3 | 3 | <h3 class="search-result__title"><a href="<?= $member->url() ?>"><?= $member->full_name() ?></a></h3> |
4 | 4 | <?php $latest_membership = $member->getMostRecentMembership(); ?> |
5 | - <?php if ( $latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL ) { ?> |
|
5 | + <?php if ($latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL) { ?> |
|
6 | 6 | <p class="search-result__description"> |
7 | 7 | <?= $latest_membership['current'] ? '' : 'Former' ?> |
8 | 8 | <?= $latest_membership['party'] == 'Bishop' ? '' : $latest_membership['party'] ?> |
9 | 9 | <?= $latest_membership['rep_name'] ?> |
10 | - <?php if ( $latest_membership['constituency'] ) { ?> |
|
10 | + <?php if ($latest_membership['constituency']) { ?> |
|
11 | 11 | <?= sprintf(gettext('for %s'), $latest_membership['constituency']) ?> |
12 | 12 | <?php } ?> |
13 | 13 | (<?= format_date($latest_membership['start_date'], SHORTDATEFORMAT) ?> – <?= $latest_membership['current'] ? gettext('current') : format_date($latest_membership['end_date'], SHORTDATEFORMAT); ?>) |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <div class="full-page"> |
2 | - <div class="full-page__row search-page <?php if ( !$searchstring ) { ?>search-page--blank<?php } ?>"> |
|
2 | + <div class="full-page__row search-page <?php if (!$searchstring) { ?>search-page--blank<?php } ?>"> |
|
3 | 3 | |
4 | 4 | <form class="js-search-form-without-options"> |
5 | 5 | <?php include 'form_main.php'; ?> |
6 | 6 | </form> |
7 | 7 | |
8 | - <?php if ( $searchstring && !isset($warnings) ) { ?> |
|
8 | + <?php if ($searchstring && !isset($warnings)) { ?> |
|
9 | 9 | <div class="search-page__section search-page__section--results"> |
10 | 10 | <div class="search-page__section__primary"> |
11 | - <?php if ( $cons ) { ?> |
|
12 | - <?php if ( count($cons) > 1 ) { |
|
13 | - if ( $mp_types['mp'] > 0 && $mp_types['former'] > 0 ) { |
|
11 | + <?php if ($cons) { ?> |
|
12 | + <?php if (count($cons) > 1) { |
|
13 | + if ($mp_types['mp'] > 0 && $mp_types['former'] > 0) { |
|
14 | 14 | $desc = gettext('MPs and former MPs'); |
15 | - } elseif ( $mp_types['mp'] > 0 ) { |
|
15 | + } elseif ($mp_types['mp'] > 0) { |
|
16 | 16 | $desc = gettext('MPs'); |
17 | - } elseif ( $mp_types['former'] > 0 ) { |
|
17 | + } elseif ($mp_types['former'] > 0) { |
|
18 | 18 | $desc = gettext('Former MPs'); |
19 | 19 | } |
20 | 20 | ?> |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | <?php } else { // count($cons) <= 1 ?> |
25 | 25 | <h2><?= sprintf(gettext('MP for <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2> |
26 | 26 | <?php } ?> |
27 | - <?php foreach ( $cons as $member ) { ?> |
|
27 | + <?php foreach ($cons as $member) { ?> |
|
28 | 28 | <?php include('person.php'); ?> |
29 | 29 | <?php } ?> |
30 | 30 | <?php } ?> |
31 | 31 | |
32 | - <?php if ( $members ) { ?> |
|
32 | + <?php if ($members) { ?> |
|
33 | 33 | <h2><?= sprintf(gettext('People matching <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2> |
34 | - <?php foreach ( $members as $member ) { ?> |
|
34 | + <?php foreach ($members as $member) { ?> |
|
35 | 35 | <?php include('person.php'); ?> |
36 | 36 | <?php } ?> |
37 | 37 | <hr> |
@@ -39,43 +39,43 @@ discard block |
||
39 | 39 | |
40 | 40 | <?php if ($glossary) { ?> |
41 | 41 | <h2>Glossary items matching <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2> |
42 | - <?php foreach ( $glossary as $item ) { ?> |
|
42 | + <?php foreach ($glossary as $item) { ?> |
|
43 | 43 | <?php include('glossary.php'); ?> |
44 | 44 | <?php } ?> |
45 | 45 | <hr> |
46 | 46 | <?php } ?> |
47 | 47 | |
48 | - <?php if ( isset($pid) && $wtt == 2 ) { ?> |
|
48 | + <?php if (isset($pid) && $wtt == 2) { ?> |
|
49 | 49 | <p>I want to <a href="https://www.writetothem.com/lords/?pid=<?= $pid ?>">write to <?= $wtt_lord_name ?></a></p> |
50 | 50 | <?php } ?> |
51 | 51 | |
52 | - <?php if ( isset($error) ) { ?> |
|
52 | + <?php if (isset($error)) { ?> |
|
53 | 53 | There was an error – <?= $error ?> – searching for <em class="current-search-term"><?= _htmlentities($searchstring) ?></em>. |
54 | 54 | <?php } else { ?> |
55 | 55 | <h2> |
56 | 56 | <?php |
57 | 57 | $term = sprintf('<em class="current-search-term">%s</em>', _htmlentities($searchdescription)); |
58 | - if ( $pagination_links ) { ?> |
|
58 | + if ($pagination_links) { ?> |
|
59 | 59 | <?= sprintf(gettext('Results %s–%s of %s for %s'), $pagination_links['first_result'], $pagination_links['last_result'], $info['total_results'], $term) ?> |
60 | - <?php } else if ( $info['total_results'] == 1 ) { ?> |
|
60 | + <?php } else if ($info['total_results'] == 1) { ?> |
|
61 | 61 | <?= sprintf(gettext('The only result for %s'), $term) ?> |
62 | - <?php } else if ( $info['total_results'] == 0 ) { ?> |
|
62 | + <?php } else if ($info['total_results'] == 0) { ?> |
|
63 | 63 | <?= sprintf(gettext('There were no results for %s'), $term) ?> |
64 | 64 | <?php } else { ?> |
65 | 65 | <?= sprintf(gettext('All %s results for %s'), $info['total_results'], $term) ?> |
66 | 66 | <?php } ?> |
67 | 67 | </h2> |
68 | 68 | |
69 | - <?php if ( $info['spelling_correction'] ) { ?> |
|
70 | - <p><?= sprintf(gettext('Did you mean %s?'), '<a href="/search/?q=' . urlencode($info['spelling_correction']) . '">' . _htmlentities( $info['spelling_correction_display'] ) . '</a>') ?></p> |
|
69 | + <?php if ($info['spelling_correction']) { ?> |
|
70 | + <p><?= sprintf(gettext('Did you mean %s?'), '<a href="/search/?q=' . urlencode($info['spelling_correction']) . '">' . _htmlentities($info['spelling_correction_display']) . '</a>') ?></p> |
|
71 | 71 | <?php } ?> |
72 | 72 | |
73 | - <?php if ( $info['total_results'] ) { ?> |
|
73 | + <?php if ($info['total_results']) { ?> |
|
74 | 74 | <ul class="search-result-display-options"> |
75 | - <?php if ( $sort_order == 'relevance' ) { ?> |
|
75 | + <?php if ($sort_order == 'relevance') { ?> |
|
76 | 76 | <li><?= gettext('Sorted by relevance') ?></li> |
77 | 77 | <li><?= gettext('Sort by date') ?>: <a href="<?= $urls['newest'] ?>"><?= gettext('newest') ?></a> / <a href="<?= $urls['oldest'] ?>"><?= gettext('oldest') ?></a></li> |
78 | - <?php } else if ( $sort_order == 'oldest' ) { ?> |
|
78 | + <?php } else if ($sort_order == 'oldest') { ?> |
|
79 | 79 | <li><?= sprintf(gettext('Sort by <a href="%s">relevance</a>'), $urls['relevance']) ?></li> |
80 | 80 | <li><?= gettext('Sorted by date') ?>: <a href="<?= $urls['newest'] ?>"><?= gettext('newest') ?></a> / <?= gettext('oldest') ?></li> |
81 | 81 | <?php } else { ?> |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | </ul> |
87 | 87 | <?php } ?> |
88 | 88 | |
89 | - <?php foreach ( $rows as $result ) { ?> |
|
89 | + <?php foreach ($rows as $result) { ?> |
|
90 | 90 | <div class="search-result search-result--generic"> |
91 | 91 | <h3 class="search-result__title"><a href="<?= $result['listurl'] ?>"><?= $result['parent']['body'] ?></a> (<?= format_date($result['hdate'], SHORTDATEFORMAT) ?>)</h3> |
92 | 92 | <p class="search-result__description"><?= isset($result['speaker']) ? $result['speaker']['name'] . ': ' : '' ?><?= $result['extract'] ?></p> |
@@ -95,16 +95,16 @@ discard block |
||
95 | 95 | |
96 | 96 | <hr> |
97 | 97 | |
98 | - <?php if ( $pagination_links ) { ?> |
|
98 | + <?php if ($pagination_links) { ?> |
|
99 | 99 | <div class="search-result-pagination"> |
100 | - <?php if ( isset($pagination_links['prev']) ) { ?> |
|
100 | + <?php if (isset($pagination_links['prev'])) { ?> |
|
101 | 101 | <a href="<?= $pagination_links['firstpage']['url'] ?>" title="<?= gettext('First page') ?>"><<</a> |
102 | 102 | <a href="<?= $pagination_links['prev']['url'] ?>" title="<?= gettext('Previous page') ?>"><</a> |
103 | 103 | <?php } ?> |
104 | - <?php foreach ( $pagination_links['nums'] as $link ) { ?> |
|
104 | + <?php foreach ($pagination_links['nums'] as $link) { ?> |
|
105 | 105 | <a href="<?= $link['url'] ?>"<?= $link['current'] ? ' class="search-result-pagination__current-page"' : '' ?>><?= $link['page'] ?></a> |
106 | 106 | <?php } ?> |
107 | - <?php if ( isset($pagination_links['next']) ) { ?> |
|
107 | + <?php if (isset($pagination_links['next'])) { ?> |
|
108 | 108 | <a href="<?= $pagination_links['next']['url'] ?>" title="<?= gettext('Next page') ?>">></a> |
109 | 109 | <a href="<?= $pagination_links['lastpage']['url'] ?>" title="<?= gettext('Final page') ?>">>></a> |
110 | 110 | <?php } ?> |
@@ -19,9 +19,11 @@ |
||
19 | 19 | } |
20 | 20 | ?> |
21 | 21 | <h2><?= sprintf(gettext('%s in constituencies matching <em class="current-search-term">%s</em>'), $desc, _htmlentities($searchstring)) ?></h2> |
22 | - <?php } elseif ($mp_types['former']) { // count($cons) <= 1 ?> |
|
22 | + <?php } elseif ($mp_types['former']) { |
|
23 | +// count($cons) <= 1 ?> |
|
23 | 24 | <h2><?= sprintf(gettext('Former MP for <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2> |
24 | - <?php } else { // count($cons) <= 1 ?> |
|
25 | + <?php } else { |
|
26 | +// count($cons) <= 1 ?> |
|
25 | 27 | <h2><?= sprintf(gettext('MP for <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2> |
26 | 28 | <?php } ?> |
27 | 29 | <?php foreach ( $cons as $member ) { ?> |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <div class="search-page__section__secondary search-page-sidebar"> |
2 | - <?php if ( isset( $search_sidebar['email'] ) ) { ?> |
|
2 | + <?php if (isset($search_sidebar['email'])) { ?> |
|
3 | 3 | <h2><?= gettext('Create an alert') ?></h2> |
4 | 4 | <p class="sidebar-item-with-icon"> |
5 | 5 | <?= sprintf(gettext('<a href="%s">Subscribe to an email alert</a> for <em class="current-search-term">%s</em>'), $search_sidebar['email'], $search_sidebar['email_desc']) ?> |
6 | - <?php if (isset( $search_sidebar['email_section'] ) ) { ?> |
|
6 | + <?php if (isset($search_sidebar['email_section'])) { ?> |
|
7 | 7 | <br><small><?= sprintf(gettext('(or just <a href="%s">%s</a>)'), $search_sidebar['email_section'], $search_sidebar['email_desc_section']) ?></small> |
8 | 8 | <?php } ?> |
9 | 9 | </p> |
@@ -6,32 +6,32 @@ discard block |
||
6 | 6 | <?= $parent_title ?> |
7 | 7 | </h1> |
8 | 8 | <p class="business-section__header__date"> |
9 | - <?= format_date( $info['date'], LONGERDATEFORMAT ) ?> |
|
9 | + <?= format_date($info['date'], LONGERDATEFORMAT) ?> |
|
10 | 10 | </p> |
11 | 11 | </div> |
12 | - <?php if ( isset($rows) ) { ?> |
|
12 | + <?php if (isset($rows)) { ?> |
|
13 | 13 | <div class="business-section__primary"> |
14 | 14 | <ul class="business-list"> |
15 | 15 | <?php |
16 | 16 | $prevlevel = ''; |
17 | - foreach ( $rows as $row ) { ?> |
|
18 | - <?php if ( $row['htype'] == 10 ) { |
|
19 | - if ( $prevlevel == 'sub' ) { ?> |
|
17 | + foreach ($rows as $row) { ?> |
|
18 | + <?php if ($row['htype'] == 10) { |
|
19 | + if ($prevlevel == 'sub') { ?> |
|
20 | 20 | </ul> |
21 | 21 | </li> |
22 | - <?php } elseif ( $prevlevel == 'top' ) { ?> |
|
22 | + <?php } elseif ($prevlevel == 'top') { ?> |
|
23 | 23 | </li> |
24 | 24 | <?php } ?> |
25 | 25 | <li> |
26 | 26 | <?php } else { |
27 | - if ( $prevlevel == '' ) { ?> |
|
27 | + if ($prevlevel == '') { ?> |
|
28 | 28 | <li> |
29 | - <?php } elseif ( $prevlevel == 'top' ) { ?> |
|
29 | + <?php } elseif ($prevlevel == 'top') { ?> |
|
30 | 30 | <ul> |
31 | 31 | <li> |
32 | 32 | <?php } ?> |
33 | 33 | <?php } ?> |
34 | - <?php if ( isset($row['excerpt']) && strstr($row['excerpt'], "was asked—") ) { ?> |
|
34 | + <?php if (isset($row['excerpt']) && strstr($row['excerpt'], "was asked—")) { ?> |
|
35 | 35 | <div class="business-list__title"> |
36 | 36 | <h3> |
37 | 37 | <?= $row['body'] ?> |
@@ -42,26 +42,26 @@ discard block |
||
42 | 42 | <h3> |
43 | 43 | <?= $row['body'] ?> |
44 | 44 | </h3> |
45 | - <?php if ( isset($row['contentcount']) && $row['contentcount'] > 0 ) { ?> |
|
45 | + <?php if (isset($row['contentcount']) && $row['contentcount'] > 0) { ?> |
|
46 | 46 | <span class="business-list__meta"> |
47 | 47 | <?= sprintf(ngettext('%s speech', '%s speeches', $row['contentcount']), $row['contentcount']) ?> |
48 | 48 | </span> |
49 | 49 | <?php } ?> |
50 | 50 | </a> |
51 | 51 | <?php } |
52 | - if ( isset($row['excerpt']) ) { ?> |
|
52 | + if (isset($row['excerpt'])) { ?> |
|
53 | 53 | <p class="business-list__excerpt"> |
54 | - <?= trim_characters($row['excerpt'], 0, 200 ) ?> |
|
54 | + <?= trim_characters($row['excerpt'], 0, 200) ?> |
|
55 | 55 | </p> |
56 | 56 | <?php } ?> |
57 | - <?php if ( $row['htype'] == 10 ) { |
|
57 | + <?php if ($row['htype'] == 10) { |
|
58 | 58 | $prevlevel = 'top'; |
59 | 59 | } else { |
60 | 60 | $prevlevel = 'sub'; ?> |
61 | 61 | </li> |
62 | 62 | <?php } ?> |
63 | 63 | <?php } ?> |
64 | - <?php if ( $prevlevel == 'sub' ) { ?> |
|
64 | + <?php if ($prevlevel == 'sub') { ?> |
|
65 | 65 | </ul> |
66 | 66 | </li> |
67 | 67 | <?php } ?> |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <div class="calendar"> |
2 | - <?php if(isset($month)) { |
|
2 | + <?php if (isset($month)) { |
|
3 | 3 | // What is the first day of the month in question? |
4 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
4 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
5 | 5 | |
6 | 6 | // How many days does this month contain? |
7 | - $numberDays = date('t',$firstDayOfMonth); |
|
7 | + $numberDays = date('t', $firstDayOfMonth); |
|
8 | 8 | |
9 | 9 | // What is the name of the month in question? |
10 | 10 | $monthName = strftime('%B', $firstDayOfMonth); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | if (isset($info['onday'])) { |
13 | 13 | // 'onday' is like 'yyyy-mm-dd'. |
14 | 14 | $datebits = explode('-', $info['onday']); |
15 | - if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
15 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
16 | 16 | $toDay = $datebits[2]; |
17 | 17 | } else { |
18 | 18 | $toDay = ''; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <?php } |
40 | 40 | if (!isset($years)) { ?> |
41 | 41 | <div class="calendar__controls"> |
42 | - <?php if ( isset($prev) ) { ?> |
|
42 | + <?php if (isset($prev)) { ?> |
|
43 | 43 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">←</a> |
44 | 44 | <?php } else { ?> |
45 | 45 | <span class="calendar__controls__previous"> </span> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <span class="calendar__controls__current"> |
48 | 48 | <?= $monthName ?> <?= $year ?> |
49 | 49 | </span> |
50 | - <?php if ( isset($next) ) { ?> |
|
50 | + <?php if (isset($next)) { ?> |
|
51 | 51 | <a href="<?= $next['url'] ?>" class="calendar__controls__next">→</a> |
52 | 52 | <?php } else { ?> |
53 | 53 | <span class="calendar__controls__next"> </span> |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | // sittings - e.g. WH is only Tuesday-Thursday |
101 | 101 | if ($currentDay == $toDay) { |
102 | 102 | print '<td class="on"'; |
103 | - if ($recess[0] && $recess[0]!=1) { |
|
104 | - print ' title="'.$recess[0].'"'; |
|
103 | + if ($recess[0] && $recess[0] != 1) { |
|
104 | + print ' title="' . $recess[0] . '"'; |
|
105 | 105 | } |
106 | 106 | print '>'; |
107 | 107 | } elseif ($recess[0]) { |
108 | 108 | print '<td class="no"'; |
109 | - if ($recess[0]!=1) { |
|
110 | - print ' title="'.$recess[0].'"'; |
|
109 | + if ($recess[0] != 1) { |
|
110 | + print ' title="' . $recess[0] . '"'; |
|
111 | 111 | } |
112 | 112 | print '>'; |
113 | 113 | } else { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // Is the $currentDay a member of $dates? If so, |
118 | 118 | // the day should be linked. |
119 | - if (in_array($currentDay,$dates)) { |
|
119 | + if (in_array($currentDay, $dates)) { |
|
120 | 120 | |
121 | 121 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
122 | 122 | |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | </tr> |
155 | 155 | </tbody> |
156 | 156 | </table> |
157 | - <?php if(!isset($years)){ ?> |
|
157 | + <?php if (!isset($years)) { ?> |
|
158 | 158 | <div class="calendar__footer"> |
159 | 159 | <?php |
160 | 160 | $y = $urls['day']; |
161 | 161 | $y->reset(); |
162 | - $y->insert(array( 'y' => $year )); |
|
162 | + $y->insert(array('y' => $year)); |
|
163 | 163 | $url = $y->generate(); |
164 | 164 | ?> |
165 | 165 | <a href="<?= $url ?>"><?= sprintf(gettext('See all of %s'), $year) ?></a> |