@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public $token_checked = null; |
42 | 42 | private $alert_id = ""; |
43 | 43 | public $email = ""; |
44 | - public $criteria = ""; // Sets the terms that are used to produce the search results. |
|
44 | + public $criteria = ""; // Sets the terms that are used to produce the search results. |
|
45 | 45 | |
46 | 46 | private $db; |
47 | 47 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $contents = array('criteria' => $row['criteria'], 'count' => $row['cnt']); |
73 | 73 | $data[] = $contents; |
74 | 74 | } |
75 | - $data = array ('alerts' => $data); |
|
75 | + $data = array('alerts' => $data); |
|
76 | 76 | return $data; |
77 | 77 | } |
78 | 78 | |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | |
101 | 101 | $data = $q->fetchAll(); |
102 | 102 | $info = "Alert"; |
103 | - $data = array ('info' => $info, 'data' => $data); |
|
103 | + $data = array('info' => $info, 'data' => $data); |
|
104 | 104 | |
105 | 105 | return $data; |
106 | 106 | } |
107 | 107 | |
108 | - public function add($details, $confirmation_email=false, $instantly_confirm=true) { |
|
108 | + public function add($details, $confirmation_email = false, $instantly_confirm = true) { |
|
109 | 109 | |
110 | 110 | // Adds a new alert's info into the database. |
111 | 111 | // Then calls another function to send them a confirmation email. |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | // This gives a code for their email address which is then joined |
171 | 171 | // to the timestamp so as to provide a unique ID for each alert. |
172 | 172 | |
173 | - $token = substr( password_hash($details["email"] . microtime(), PASSWORD_BCRYPT), 29, 16 ); |
|
173 | + $token = substr(password_hash($details["email"] . microtime(), PASSWORD_BCRYPT), 29, 16); |
|
174 | 174 | |
175 | 175 | // Full stops don't work well at the end of URLs in emails, so |
176 | 176 | // replace them. And double slash would be treated as single and |
@@ -244,19 +244,19 @@ discard block |
||
244 | 244 | |
245 | 245 | $urltoken = $this->alert_id . '-' . $this->registrationtoken; |
246 | 246 | |
247 | - if ( isset($details['confirm_base']) && $details['confirm_base'] !== '' ) { |
|
247 | + if (isset($details['confirm_base']) && $details['confirm_base'] !== '') { |
|
248 | 248 | $confirmurl = $details['confirm_base'] . $urltoken; |
249 | 249 | } else { |
250 | 250 | $confirmurl = 'https://' . DOMAIN . '/A/' . $urltoken; |
251 | 251 | } |
252 | 252 | |
253 | 253 | // Arrays we need to send a templated email. |
254 | - $data = array ( |
|
254 | + $data = array( |
|
255 | 255 | 'to' => $details['email'], |
256 | 256 | 'template' => 'alert_confirmation' |
257 | 257 | ); |
258 | 258 | |
259 | - $merge = array ( |
|
259 | + $merge = array( |
|
260 | 260 | 'CONFIRMURL' => $confirmurl, |
261 | 261 | 'CRITERIA' => $this->criteria_pretty() |
262 | 262 | ); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | public function send_already_signedup_email($details) { |
273 | - $data = array ( |
|
273 | + $data = array( |
|
274 | 274 | 'to' => $details['email'], |
275 | 275 | 'template' => 'alert_already_signedup' |
276 | 276 | ); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $criteria = \MySociety\TheyWorkForYou\Utility\Alert::detailsToCriteria($details); |
279 | 279 | $this->criteria = $criteria; |
280 | 280 | |
281 | - $merge = array ( |
|
281 | + $merge = array( |
|
282 | 282 | 'CRITERIA' => $this->criteria_pretty() |
283 | 283 | ); |
284 | 284 | |
@@ -449,20 +449,20 @@ discard block |
||
449 | 449 | public function email() { return $this->email; } |
450 | 450 | public function criteria() { return $this->criteria; } |
451 | 451 | public function criteria_pretty($html = false) { |
452 | - $criteria = explode(' ',$this->criteria); |
|
452 | + $criteria = explode(' ', $this->criteria); |
|
453 | 453 | $spokenby = array_values(\MySociety\TheyWorkForYou\Utility\Search::speakerNamesForIDs($this->criteria)); |
454 | 454 | $words = array(); |
455 | 455 | foreach ($criteria as $c) { |
456 | - if (!preg_match('#^speaker:(\d+)#',$c,$m)) { |
|
456 | + if (!preg_match('#^speaker:(\d+)#', $c, $m)) { |
|
457 | 457 | $words[] = $c; |
458 | 458 | } |
459 | 459 | } |
460 | 460 | $criteria = ''; |
461 | 461 | if (count($words)) { |
462 | - $criteria .= ($html?'<li>':'* ') . sprintf(gettext('Mentions of [%s]'), implode(' ', $words)) . ($html?'</li>':'') . "\n"; |
|
462 | + $criteria .= ($html ? '<li>' : '* ') . sprintf(gettext('Mentions of [%s]'), implode(' ', $words)) . ($html ? '</li>' : '') . "\n"; |
|
463 | 463 | } |
464 | 464 | if ($spokenby) { |
465 | - $criteria .= ($html?'<li>':'* ') . sprintf(gettext("Things by %s"), implode(' or ', $spokenby)) . ($html?'</li>':'') . "\n"; |
|
465 | + $criteria .= ($html ? '<li>' : '* ') . sprintf(gettext("Things by %s"), implode(' or ', $spokenby)) . ($html ? '</li>' : '') . "\n"; |
|
466 | 466 | } |
467 | 467 | return $criteria; |
468 | 468 | } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if ( count($divisions) > 0 ) { ?> |
|
1 | +<?php if (count($divisions) > 0) { ?> |
|
2 | 2 | <h2 style="position: relative;"> |
3 | 3 | <?= gettext('Recent Votes') ?> |
4 | 4 | <div class="meta excerpt__category"><a href="/divisions/"><?= gettext('Show all recent votes') ?></a></div> |
@@ -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>' : '' ?> |
@@ -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> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $divisions_to_link = array(); |
4 | -foreach($data['rows'] as $speech) { |
|
4 | +foreach ($data['rows'] as $speech) { |
|
5 | 5 | |
6 | 6 | # Only care about divisions... |
7 | 7 | if ($speech['htype'] != 14) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | <li><a href="#g<?= gid_to_anchor($speech['gid']) ?>"><?= sprintf(gettext('Division number %s'), $division['number']) ?></a> |
35 | 35 | <?php if ($division['has_description']) { ?> |
36 | 36 | <br><span class="policy-vote__text"> |
37 | - <?php include( dirname(__FILE__) . '/../divisions/_vote_description.php'); ?> |
|
37 | + <?php include(dirname(__FILE__) . '/../divisions/_vote_description.php'); ?> |
|
38 | 38 | </span> |
39 | 39 | <?php } ?> |
40 | 40 |