@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | echo '<?xml version="1.0" encoding="iso-8859-1"?>'; |
30 | 30 | |
31 | - ?> |
|
31 | + ?> |
|
32 | 32 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
33 | 33 | <svg width="1000" height="500" viewBox="0 0 1000 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" font-family="Droid Sans, Trebuchet"> |
34 | 34 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | <text font-size="24" font-weight="normal" fill="#000000"> |
54 | 54 | <?php foreach ($lines as $j=>$line) { ?> |
55 | 55 | <tspan x="40" y="<?= $stance_y + $stance_padding_top + $stance_baseline_offset + ($stance_lineheight * $j) ?>"><?php |
56 | - if (strpos($line, '*') !== False) { |
|
56 | + if (strpos($line, '*') !== false) { |
|
57 | 57 | echo preg_replace( |
58 | 58 | '#(?:^|[*])([^\r\n *][^*\n]*[^\r\n *])(?:$|[*])#i', |
59 | 59 | $tspan_bold_open . '$1' . $tspan_bold_close, |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $stances = array(); |
4 | 4 | |
5 | 5 | foreach ($segment['votes']->positions as $key_vote) { |
6 | - if ( $key_vote['has_strong'] || $key_vote['position'] == 'has never voted on' ) { |
|
6 | + if ($key_vote['has_strong'] || $key_vote['position'] == 'has never voted on') { |
|
7 | 7 | $stance = strip_tags($key_vote['desc'], '<b>'); |
8 | 8 | $stance = ucfirst($stance); |
9 | 9 | $stance = preg_replace('#</?b>#i', '*', $stance); |
@@ -59,7 +59,8 @@ |
||
59 | 59 | $tspan_bold_open . '$1' . $tspan_bold_close, |
60 | 60 | $line |
61 | 61 | ); |
62 | - } else { |
|
62 | + } |
|
63 | + else { |
|
63 | 64 | echo $line; |
64 | 65 | } |
65 | 66 | ?></tspan> |
@@ -122,25 +122,25 @@ discard block |
||
122 | 122 | <?php } ?> |
123 | 123 | |
124 | 124 | <?php |
125 | - if( |
|
126 | - (isset($members) && $members->rows() > 0) || |
|
125 | + if( |
|
126 | + (isset($members) && $members->rows() > 0) || |
|
127 | 127 | (isset($constituencies) && count($constituencies) > 0) || |
128 | 128 | ($alertsearch) |
129 | - ) { |
|
130 | - /* We need to disambiguate the user's instructions */ |
|
131 | - $member_options = false; |
|
132 | - ?> |
|
129 | + ) { |
|
130 | + /* We need to disambiguate the user's instructions */ |
|
131 | + $member_options = false; |
|
132 | + ?> |
|
133 | 133 | <div class="alert-section alert-section--disambiguation"> |
134 | 134 | <div class="alert-section__primary"> |
135 | 135 | |
136 | 136 | <?php if (isset($members) && $members->rows() > 0) { |
137 | - $member_options = true; ?> |
|
137 | + $member_options = true; ?> |
|
138 | 138 | <h3>Sign up for alerts when people matching <i><?= _htmlspecialchars($alertsearch) ?></i> speaks</h3> |
139 | 139 | <ul> |
140 | 140 | <?php |
141 | 141 | $q = $members; |
142 | 142 | for ($n=0; $n<$q->rows(); $n++) { |
143 | - ?> |
|
143 | + ?> |
|
144 | 144 | <li> |
145 | 145 | <form action="<?= $actionurl ?>" method="post"> |
146 | 146 | <input type="hidden" name="t" value="<?= _htmlspecialchars($token) ?>"> |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | <?php } ?> |
161 | 161 | |
162 | 162 | <?php if (isset($constituencies) && count($constituencies) > 0) { |
163 | - $member_options = true; ?> |
|
163 | + $member_options = true; ?> |
|
164 | 164 | <h3>Sign up for alerts when MPs for constituencies matching <i><?= _htmlspecialchars($alertsearch) ?></i> speaks</h3> |
165 | 165 | <ul> |
166 | 166 | <?php foreach ($constituencies as $constituency => $member) { ?> |
@@ -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>Your alert has been confirmed</h3> |
20 | 20 | <p> |
21 | 21 | You will now receive email alerts for the following criteria: |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | </div> |
46 | 46 | </noscript> |
47 | 47 | |
48 | - <?php } elseif ( $results == 'alert-suspended' ) { ?> |
|
48 | + <?php } elseif ($results == 'alert-suspended') { ?> |
|
49 | 49 | <h3>Alert suspended</h3> |
50 | 50 | <p> |
51 | 51 | You can reactivate the alert at any time, from the sidebar below. |
52 | 52 | </p> |
53 | 53 | |
54 | - <?php } elseif ( $results == 'alert-resumed' ) { ?> |
|
54 | + <?php } elseif ($results == 'alert-resumed') { ?> |
|
55 | 55 | <h3>Alert resumed</h3> |
56 | 56 | <p> |
57 | 57 | You will now receive email alerts on any day when there |
58 | 58 | are entries in Hansard that match your criteria. |
59 | 59 | </p> |
60 | 60 | |
61 | - <?php } elseif ( $results == 'alert-deleted' ) { ?> |
|
61 | + <?php } elseif ($results == 'alert-deleted') { ?> |
|
62 | 62 | <h3>Alert deleted</h3> |
63 | 63 | <p> |
64 | 64 | You will no longer receive this alert. |
65 | 65 | </p> |
66 | 66 | |
67 | - <?php } elseif ( $results == 'alert-fail' ) { ?> |
|
67 | + <?php } elseif ($results == 'alert-fail') { ?> |
|
68 | 68 | <h3>Hmmm, something’s not right</h3> |
69 | 69 | <p> |
70 | 70 | The link you followed to reach this page appears to be incomplete. |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | and let us know, and we'll help out! |
81 | 81 | </p> |
82 | 82 | |
83 | - <?php } elseif ( $results == 'alert-added' ) { ?> |
|
83 | + <?php } elseif ($results == 'alert-added') { ?> |
|
84 | 84 | <h3>Your alert has been added</h3> |
85 | 85 | <p> |
86 | 86 | You will now receive email alerts on any day when |
87 | 87 | <?= _htmlspecialchars($criteria) ?> in parliament. |
88 | 88 | </p> |
89 | 89 | |
90 | - <?php } elseif ( $results == 'alert-confirmation' ) { ?> |
|
90 | + <?php } elseif ($results == 'alert-confirmation') { ?> |
|
91 | 91 | <h3>We’re nearly done…</h3> |
92 | 92 | <p> |
93 | 93 | You should receive an email shortly which will contain a link. |
@@ -95,20 +95,20 @@ discard block |
||
95 | 95 | and receive future alerts. Thanks. |
96 | 96 | </p> |
97 | 97 | |
98 | - <?php } elseif ( $results == 'alert-exists' ) { ?> |
|
98 | + <?php } elseif ($results == 'alert-exists') { ?> |
|
99 | 99 | <h3>You’re already subscribed to that!</h3> |
100 | 100 | <p> |
101 | 101 | It’s good to know you’re keen though. |
102 | 102 | </p> |
103 | 103 | |
104 | - <?php } elseif ( $results == 'alert-already-signed' ) { ?> |
|
104 | + <?php } elseif ($results == 'alert-already-signed') { ?> |
|
105 | 105 | <h3>We’re nearly done</h3> |
106 | 106 | <p> |
107 | 107 | You should receive an email shortly which will contain a link. |
108 | 108 | You will need to follow that link to confirm your email address to receive the alert. Thanks. |
109 | 109 | </p> |
110 | 110 | |
111 | - <?php } elseif ( $results == 'alert-fail' ) { ?> |
|
111 | + <?php } elseif ($results == 'alert-fail') { ?> |
|
112 | 112 | <h3>Alert could not be created</h3> |
113 | 113 | <p> |
114 | 114 | Sorry, we were unable to create that alert. Please |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | <?php } ?> |
123 | 123 | |
124 | 124 | <?php |
125 | - if( |
|
125 | + if ( |
|
126 | 126 | (isset($members) && $members->rows() > 0) || |
127 | 127 | (isset($constituencies) && count($constituencies) > 0) || |
128 | 128 | ($alertsearch) |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | <ul> |
140 | 140 | <?php |
141 | 141 | $q = $members; |
142 | - for ($n=0; $n<$q->rows(); $n++) { |
|
142 | + for ($n = 0; $n < $q->rows(); $n++) { |
|
143 | 143 | ?> |
144 | 144 | <li> |
145 | 145 | <form action="<?= $actionurl ?>" method="post"> |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | <input type="hidden" name="email" value="<?= _htmlspecialchars($email) ?>"> |
148 | 148 | <input type="hidden" name="pid" value="<?= $q->field($n, 'person_id') ?>"> |
149 | 149 | When |
150 | - <?= member_full_name($q->field($n, 'house'), $q->field($n, 'title'), $q->field($n, 'given_name'), $q->field($n, 'family_name'), $q->field($n, 'lordofname') ) ?> |
|
150 | + <?= member_full_name($q->field($n, 'house'), $q->field($n, 'title'), $q->field($n, 'given_name'), $q->field($n, 'family_name'), $q->field($n, 'lordofname')) ?> |
|
151 | 151 | <?php if ($q->field($n, 'constituency')) { ?> |
152 | 152 | (<?= $q->field($n, 'constituency') ?>) |
153 | 153 | <?php } ?> |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | <?php } ?> |
179 | 179 | |
180 | 180 | <?php if ($alertsearch) { |
181 | - if ( $member_options ) { ?> |
|
181 | + if ($member_options) { ?> |
|
182 | 182 | <h3>Sign up for alerts for topics</h3> |
183 | 183 | <?php } else { ?> |
184 | 184 | <h3>Great! Can you just confirm what you mean?</h3> |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | Receive alerts when <?= _htmlspecialchars($alertsearch_pretty) ?> |
193 | 193 | <input type="submit" class="button small" value="Subscribe"> |
194 | 194 | </form> |
195 | - <?php if ( isset($mistakes['multiple']) ) { ?> |
|
195 | + <?php if (isset($mistakes['multiple'])) { ?> |
|
196 | 196 | <em class="error"> |
197 | 197 | You have used a comma in your search term – |
198 | 198 | are you sure this is what you want? You cannot |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | for each individual term. |
202 | 202 | </em> |
203 | 203 | <?php } ?> |
204 | - <?php if ( isset($mistakes['postcode_and']) ) { ?> |
|
204 | + <?php if (isset($mistakes['postcode_and'])) { ?> |
|
205 | 205 | <em class="error"> |
206 | 206 | You have used a postcode and something else in your |
207 | 207 | search term – are you sure this is what you |
@@ -350,17 +350,17 @@ discard block |
||
350 | 350 | <div class="alert-section__secondary"> |
351 | 351 | <?php if ($email_verified) { ?> |
352 | 352 | |
353 | - <?php if ( $alerts ) { ?> |
|
353 | + <?php if ($alerts) { ?> |
|
354 | 354 | <h3>Your current email alerts</h3> |
355 | 355 | <ul class="alerts-manage__list"> |
356 | - <?php foreach ( $alerts as $alert ) { ?> |
|
356 | + <?php foreach ($alerts as $alert) { ?> |
|
357 | 357 | <li> |
358 | 358 | When <?= _htmlspecialchars($alert['criteria']) ?>. |
359 | 359 | <form action="<?= $actionurl ?>" method="POST"> |
360 | 360 | <input type="hidden" name="t" value="<?= _htmlspecialchars($alert['token']) ?>"> |
361 | - <?php if ( $alert['status'] == 'unconfirmed' ) { ?> |
|
361 | + <?php if ($alert['status'] == 'unconfirmed') { ?> |
|
362 | 362 | <input type="submit" class="button small" name="action" value="Confirm"> |
363 | - <?php } elseif ( $alert['status'] == 'suspended' ) { ?> |
|
363 | + <?php } elseif ($alert['status'] == 'suspended') { ?> |
|
364 | 364 | <input type="submit" class="button small" name="action" value="Resume"> |
365 | 365 | <?php } else { ?> |
366 | 366 | <input type="submit" class="button button--secondary small" name="action" value="Suspend"> |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | </ul> |
373 | 373 | <?php } ?> |
374 | 374 | |
375 | - <?php if ( $current_mp ) { ?> |
|
375 | + <?php if ($current_mp) { ?> |
|
376 | 376 | <h3>Your MP alert</h3> |
377 | 377 | <ul class="alerts-manage__list"> |
378 | 378 | <li> |
@@ -45,26 +45,30 @@ discard block |
||
45 | 45 | </div> |
46 | 46 | </noscript> |
47 | 47 | |
48 | - <?php } elseif ( $results == 'alert-suspended' ) { ?> |
|
48 | + <?php } |
|
49 | +elseif ( $results == 'alert-suspended' ) { ?> |
|
49 | 50 | <h3>Alert suspended</h3> |
50 | 51 | <p> |
51 | 52 | You can reactivate the alert at any time, from the sidebar below. |
52 | 53 | </p> |
53 | 54 | |
54 | - <?php } elseif ( $results == 'alert-resumed' ) { ?> |
|
55 | + <?php } |
|
56 | +elseif ( $results == 'alert-resumed' ) { ?> |
|
55 | 57 | <h3>Alert resumed</h3> |
56 | 58 | <p> |
57 | 59 | You will now receive email alerts on any day when there |
58 | 60 | are entries in Hansard that match your criteria. |
59 | 61 | </p> |
60 | 62 | |
61 | - <?php } elseif ( $results == 'alert-deleted' ) { ?> |
|
63 | + <?php } |
|
64 | +elseif ( $results == 'alert-deleted' ) { ?> |
|
62 | 65 | <h3>Alert deleted</h3> |
63 | 66 | <p> |
64 | 67 | You will no longer receive this alert. |
65 | 68 | </p> |
66 | 69 | |
67 | - <?php } elseif ( $results == 'alert-fail' ) { ?> |
|
70 | + <?php } |
|
71 | +elseif ( $results == 'alert-fail' ) { ?> |
|
68 | 72 | <h3>Hmmm, something’s not right</h3> |
69 | 73 | <p> |
70 | 74 | The link you followed to reach this page appears to be incomplete. |
@@ -80,14 +84,16 @@ discard block |
||
80 | 84 | and let us know, and we'll help out! |
81 | 85 | </p> |
82 | 86 | |
83 | - <?php } elseif ( $results == 'alert-added' ) { ?> |
|
87 | + <?php } |
|
88 | +elseif ( $results == 'alert-added' ) { ?> |
|
84 | 89 | <h3>Your alert has been added</h3> |
85 | 90 | <p> |
86 | 91 | You will now receive email alerts on any day when |
87 | 92 | <?= _htmlspecialchars($criteria) ?> in parliament. |
88 | 93 | </p> |
89 | 94 | |
90 | - <?php } elseif ( $results == 'alert-confirmation' ) { ?> |
|
95 | + <?php } |
|
96 | +elseif ( $results == 'alert-confirmation' ) { ?> |
|
91 | 97 | <h3>We’re nearly done…</h3> |
92 | 98 | <p> |
93 | 99 | You should receive an email shortly which will contain a link. |
@@ -95,20 +101,23 @@ discard block |
||
95 | 101 | and receive future alerts. Thanks. |
96 | 102 | </p> |
97 | 103 | |
98 | - <?php } elseif ( $results == 'alert-exists' ) { ?> |
|
104 | + <?php } |
|
105 | +elseif ( $results == 'alert-exists' ) { ?> |
|
99 | 106 | <h3>You’re already subscribed to that!</h3> |
100 | 107 | <p> |
101 | 108 | It’s good to know you’re keen though. |
102 | 109 | </p> |
103 | 110 | |
104 | - <?php } elseif ( $results == 'alert-already-signed' ) { ?> |
|
111 | + <?php } |
|
112 | +elseif ( $results == 'alert-already-signed' ) { ?> |
|
105 | 113 | <h3>We’re nearly done</h3> |
106 | 114 | <p> |
107 | 115 | You should receive an email shortly which will contain a link. |
108 | 116 | You will need to follow that link to confirm your email address to receive the alert. Thanks. |
109 | 117 | </p> |
110 | 118 | |
111 | - <?php } elseif ( $results == 'alert-fail' ) { ?> |
|
119 | + <?php } |
|
120 | +elseif ( $results == 'alert-fail' ) { ?> |
|
112 | 121 | <h3>Alert could not be created</h3> |
113 | 122 | <p> |
114 | 123 | Sorry, we were unable to create that alert. Please |
@@ -180,7 +189,8 @@ discard block |
||
180 | 189 | <?php if ($alertsearch) { |
181 | 190 | if ( $member_options ) { ?> |
182 | 191 | <h3>Sign up for alerts for topics</h3> |
183 | - <?php } else { ?> |
|
192 | + <?php } |
|
193 | +else { ?> |
|
184 | 194 | <h3>Great! Can you just confirm what you mean?</h3> |
185 | 195 | <?php } ?> |
186 | 196 | <ul> |
@@ -255,11 +265,13 @@ discard block |
||
255 | 265 | (<?= _htmlspecialchars($pid_member->constituency()) ?>) |
256 | 266 | speaks. |
257 | 267 | </h3> |
258 | - <?php } elseif ($keyword) { ?> |
|
268 | + <?php } |
|
269 | +elseif ($keyword) { ?> |
|
259 | 270 | <h3> |
260 | 271 | Sign up for an alert when <?= _htmlspecialchars($display_keyword) ?>. |
261 | 272 | </h3> |
262 | - <?php } else { ?> |
|
273 | + <?php } |
|
274 | +else { ?> |
|
263 | 275 | <h3>Request a new TheyWorkForYou email alert</h3> |
264 | 276 | <?php } ?> |
265 | 277 | |
@@ -277,9 +289,11 @@ discard block |
||
277 | 289 | <?php if ($pid) { ?> |
278 | 290 | <input type="text" class="form-control" name="alertsearch" id="alertsearch" disabled="disabled" |
279 | 291 | value="<?= $pid_member->full_name() ?> (<?= _htmlspecialchars($pid_member->constituency()) ?>)"> |
280 | - <?php } elseif ($keyword) { ?> |
|
292 | + <?php } |
|
293 | +elseif ($keyword) { ?> |
|
281 | 294 | <input type="text" class="form-control" name="alertsearch" id="alertsearch" disabled="disabled" value="<?= _htmlspecialchars($display_keyword) ?>"> |
282 | - <?php } else { ?> |
|
295 | + <?php } |
|
296 | +else { ?> |
|
283 | 297 | <input type="text" class="form-control" placeholder="Search term, postcode, or MP name" name="alertsearch" id="alertsearch" value="<?= _htmlentities($search_text) ?>"> |
284 | 298 | <?php } ?> |
285 | 299 | <input type="submit" class="button" value="<?= ($pid || $keyword) ? 'Subscribe' : 'Search' ?>"> |
@@ -360,9 +374,11 @@ discard block |
||
360 | 374 | <input type="hidden" name="t" value="<?= _htmlspecialchars($alert['token']) ?>"> |
361 | 375 | <?php if ( $alert['status'] == 'unconfirmed' ) { ?> |
362 | 376 | <input type="submit" class="button small" name="action" value="Confirm"> |
363 | - <?php } elseif ( $alert['status'] == 'suspended' ) { ?> |
|
377 | + <?php } |
|
378 | +elseif ( $alert['status'] == 'suspended' ) { ?> |
|
364 | 379 | <input type="submit" class="button small" name="action" value="Resume"> |
365 | - <?php } else { ?> |
|
380 | + <?php } |
|
381 | +else { ?> |
|
366 | 382 | <input type="submit" class="button button--secondary small" name="action" value="Suspend"> |
367 | 383 | <input type="submit" class="button button--negative small" name="action" value="Delete"> |
368 | 384 | <?php } ?> |
@@ -387,7 +403,8 @@ discard block |
||
387 | 403 | </ul> |
388 | 404 | <?php } ?> |
389 | 405 | |
390 | - <?php } else { ?> |
|
406 | + <?php } |
|
407 | +else { ?> |
|
391 | 408 | <p> |
392 | 409 | If you <a href="/user/?pg=join">join</a> or |
393 | 410 | <a href="/user/login/?ret=%2Falert%2F">sign in</a>, |
@@ -1,8 +1,8 @@ discard block |
||
1 | - <?php if ( $featured['featured'] ) { ?> |
|
1 | + <?php if ($featured['featured']) { ?> |
|
2 | 2 | <h2>In the news</h2> |
3 | - <?php if ( isset($featured['headline']) ) { ?> |
|
3 | + <?php if (isset($featured['headline'])) { ?> |
|
4 | 4 | <h3 class="in-the-news__topic"><a href="<?= $featured['list_url'] ?>"><?= $featured['headline'] ?></a></h3> |
5 | - <?php if ( isset($featured['context']) ) { ?> |
|
5 | + <?php if (isset($featured['context'])) { ?> |
|
6 | 6 | <p class="in-the-news__context"><?= $featured['context'] ?></p> |
7 | 7 | <?php } ?> |
8 | 8 | <?php } ?> |
@@ -15,21 +15,21 @@ discard block |
||
15 | 15 | <p class="meta excerpt__category"><a href="<?= $featured['more_url'] ?>"><?= $featured['desc'] ?></a></p> |
16 | 16 | <p class="excerpt__statement"> |
17 | 17 | <q> |
18 | - <?php if ( $featured['child']['speaker'] ) { ?> |
|
18 | + <?php if ($featured['child']['speaker']) { ?> |
|
19 | 19 | <a href="<?= $featured['child']['speaker']['url'] ?>"><?= $featured['child']['speaker']['name'] ?></a> : |
20 | 20 | <?php } ?> |
21 | 21 | <?= trim_characters($featured['child']['body'], 0, 200) ?> |
22 | 22 | </q> |
23 | 23 | </p> |
24 | 24 | </div> |
25 | - <?php if ( count($featured['related']) ) { ?> |
|
25 | + <?php if (count($featured['related'])) { ?> |
|
26 | 26 | <div class="in-the-news__key-events"> |
27 | 27 | <!-- No maximum, but less than 4 looks best --> |
28 | 28 | <ul class="key-events__list"> |
29 | 29 | <li> |
30 | 30 | <h4>Key events</h4> |
31 | 31 | </li> |
32 | - <?php foreach ( $featured['related'] as $related ) { ?> |
|
32 | + <?php foreach ($featured['related'] as $related) { ?> |
|
33 | 33 | <li> |
34 | 34 | <a href="<?= $related['list_url'] ?>"><?= $related['parent']['body'] ?></a> |
35 | 35 | <p class="meta"><?= format_date($related['hdate'], SHORTDATEFORMAT) ?></p> |
@@ -6,7 +6,8 @@ |
||
6 | 6 | <p class="in-the-news__context"><?= $featured['context'] ?></p> |
7 | 7 | <?php } ?> |
8 | 8 | <?php } ?> |
9 | - <?php } else { ?> |
|
9 | + <?php } |
|
10 | +else { ?> |
|
10 | 11 | <h2>Random debate</h2> |
11 | 12 | <?php } ?> |
12 | 13 | <div class="parliamentary-excerpt"> |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <div class="business-section__primary"> |
2 | 2 | <ul class="business-list"> |
3 | - <?php foreach ( $data as $item ) { ?> |
|
3 | + <?php foreach ($data as $item) { ?> |
|
4 | 4 | <li> |
5 | 5 | <?php include '_business_list_item.php'; ?> |
6 | 6 | </li> |
@@ -24,7 +24,7 @@ |
||
24 | 24 | foreach ( $years as $year => $months ) { ?> |
25 | 25 | <div class="calendar-year"> |
26 | 26 | <?php foreach ($months as $month => $dates) { |
27 | - include '_calendar.php'; |
|
27 | + include '_calendar.php'; |
|
28 | 28 | } ?> |
29 | 29 | </div> |
30 | 30 | <?php } |
@@ -8,20 +8,20 @@ |
||
8 | 8 | </div> |
9 | 9 | <div class="business-section__solo"> |
10 | 10 | <div class="calendar__controls"> |
11 | - <?php if ( isset( $prev ) ) { ?> |
|
11 | + <?php if (isset($prev)) { ?> |
|
12 | 12 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">← <?= $prev['title'] ?></a> |
13 | 13 | <?php } else { ?> |
14 | 14 | <span class="calendar__controls__previous"></span> |
15 | 15 | <?php } ?> |
16 | 16 | <span class="calendar__controls__current"><?= $year ?></span> |
17 | - <?php if ( isset( $next ) ) { ?> |
|
17 | + <?php if (isset($next)) { ?> |
|
18 | 18 | <a href="<?= $next['url'] ?>" class="calendar__controls__next"><?= $next['title'] ?> →</a> |
19 | 19 | <?php } else { ?> |
20 | 20 | <span class="calendar__controls__next"></span> |
21 | 21 | <?php } ?> |
22 | 22 | </div> |
23 | - <?php if ( isset($years) ) { |
|
24 | - foreach ( $years as $year => $months ) { ?> |
|
23 | + <?php if (isset($years)) { |
|
24 | + foreach ($years as $year => $months) { ?> |
|
25 | 25 | <div class="calendar-year"> |
26 | 26 | <?php foreach ($months as $month => $dates) { |
27 | 27 | include '_calendar.php'; |
@@ -34,6 +34,6 @@ |
||
34 | 34 | </div> |
35 | 35 | </div> |
36 | 36 | |
37 | - <?php $search_title = "Search $title"; include '_search.php'; ?> |
|
37 | + <?php $search_title = "search $title"; include '_search.php'; ?> |
|
38 | 38 | |
39 | 39 | </div> |
@@ -10,13 +10,15 @@ discard block |
||
10 | 10 | <div class="calendar__controls"> |
11 | 11 | <?php if ( isset( $prev ) ) { ?> |
12 | 12 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">← <?= $prev['title'] ?></a> |
13 | - <?php } else { ?> |
|
13 | + <?php } |
|
14 | +else { ?> |
|
14 | 15 | <span class="calendar__controls__previous"></span> |
15 | 16 | <?php } ?> |
16 | 17 | <span class="calendar__controls__current"><?= $year ?></span> |
17 | 18 | <?php if ( isset( $next ) ) { ?> |
18 | 19 | <a href="<?= $next['url'] ?>" class="calendar__controls__next"><?= $next['title'] ?> →</a> |
19 | - <?php } else { ?> |
|
20 | + <?php } |
|
21 | +else { ?> |
|
20 | 22 | <span class="calendar__controls__next"></span> |
21 | 23 | <?php } ?> |
22 | 24 | </div> |
@@ -28,7 +30,8 @@ discard block |
||
28 | 30 | } ?> |
29 | 31 | </div> |
30 | 32 | <?php } |
31 | - } else { ?> |
|
33 | + } |
|
34 | + else { ?> |
|
32 | 35 | We don't seem to have any <?= $parent_title ?> for this year. |
33 | 36 | <?php } ?> |
34 | 37 | </div> |
@@ -22,14 +22,14 @@ |
||
22 | 22 | |
23 | 23 | <div class="business-section__primary"> |
24 | 24 | <ul class="business-list"> |
25 | - <?php foreach ( $content['data'] as $date => $bills ) { ?> |
|
25 | + <?php foreach ($content['data'] as $date => $bills) { ?> |
|
26 | 26 | <li> |
27 | 27 | <span class="business-list__title"> |
28 | 28 | <h3> |
29 | 29 | <?= $date ?> |
30 | 30 | </h3> |
31 | 31 | </span> |
32 | - <?php foreach ( $bills as $bill ) { ?> |
|
32 | + <?php foreach ($bills as $bill) { ?> |
|
33 | 33 | <p> |
34 | 34 | <a href="<?= $bill['url'] ?>" class="business-list__title"> |
35 | 35 | <?= $bill['bill'] ?> – <?= $bill['sitting'] ?> |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | foreach ( $calendar as $year => $months ) { |
3 | 3 | foreach ($months as $month => $dates) { |
4 | - include '_calendar.php'; |
|
4 | + include '_calendar.php'; |
|
5 | 5 | } |
6 | 6 | } ?> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - foreach ( $calendar as $year => $months ) { |
|
2 | + foreach ($calendar as $year => $months) { |
|
3 | 3 | foreach ($months as $month => $dates) { |
4 | 4 | include '_calendar.php'; |
5 | 5 | } |
@@ -32,8 +32,8 @@ |
||
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <?php } else { |
35 | - $section = false; include '_section_content.php'; |
|
36 | - } ?> |
|
35 | + $section = false; include '_section_content.php'; |
|
36 | + } ?> |
|
37 | 37 | |
38 | 38 | </div> |
39 | 39 |
@@ -19,11 +19,11 @@ |
||
19 | 19 | </div> |
20 | 20 | <div class="full-page"> |
21 | 21 | |
22 | - <?php if ( count($data['rows']) == 0 ) { ?> |
|
22 | + <?php if (count($data['rows']) == 0) { ?> |
|
23 | 23 | <div class="debate-speech"> |
24 | 24 | <div class="full-page__row"> |
25 | 25 | <div class="full-page__unit"> |
26 | - <?php if ( $col_country == 'SCOTLAND' || $col_country == 'NORTHERN IRELAND' ) { ?> |
|
26 | + <?php if ($col_country == 'SCOTLAND' || $col_country == 'NORTHERN IRELAND') { ?> |
|
27 | 27 | We only have information about columns for debates in the House of Commons and the House of Lords. |
28 | 28 | <?php } else { ?> |
29 | 29 | We can't find anything in column <?= $column ?> on <?= $debate_day_human ?>. |
@@ -25,13 +25,15 @@ |
||
25 | 25 | <div class="full-page__unit"> |
26 | 26 | <?php if ( $col_country == 'SCOTLAND' || $col_country == 'NORTHERN IRELAND' ) { ?> |
27 | 27 | We only have information about columns for debates in the House of Commons and the House of Lords. |
28 | - <?php } else { ?> |
|
28 | + <?php } |
|
29 | +else { ?> |
|
29 | 30 | We can't find anything in column <?= $column ?> on <?= $debate_day_human ?>. |
30 | 31 | <?php } ?> |
31 | 32 | </div> |
32 | 33 | </div> |
33 | 34 | </div> |
34 | - <?php } else { |
|
35 | + <?php } |
|
36 | +else { |
|
35 | 37 | $section = false; include '_section_content.php'; |
36 | 38 | } ?> |
37 | 39 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if ($dayOfWeek < 0) { |
42 | 42 | $dayOfWeek = 6; |
43 | 43 | } |
44 | - ?> |
|
44 | + ?> |
|
45 | 45 | <?php } |
46 | 46 | if (!isset($years)) { ?> |
47 | 47 | <div class="calendar__controls"> |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } else { |
128 | 128 | $day_section = $section; |
129 | 129 | if ($section == 'sp') { |
130 | - $day_section = 'spdebates'; |
|
130 | + $day_section = 'spdebates'; |
|
131 | 131 | } |
132 | 132 | $urls[$day_section . 'day']->insert(array('d'=>$date)); |
133 | 133 | print "<a href=\"" . $urls[$day_section . 'day']->generate() . "\">$currentDay</a></td>"; |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <div class="calendar"> |
2 | - <?php if(isset($month)){ |
|
3 | - $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
|
2 | + <?php if (isset($month)) { |
|
3 | + $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'); |
|
4 | 4 | |
5 | 5 | // What is the first day of the month in question? |
6 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
6 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
7 | 7 | |
8 | 8 | // How many days does this month contain? |
9 | - $numberDays = date('t',$firstDayOfMonth); |
|
9 | + $numberDays = date('t', $firstDayOfMonth); |
|
10 | 10 | |
11 | 11 | // Retrieve some information about the first day of the |
12 | 12 | // month in question. |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | if (isset($info['onday'])) { |
19 | 19 | // 'onday' is like 'yyyy-mm-dd'. |
20 | 20 | $datebits = explode('-', $info['onday']); |
21 | - if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
21 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
22 | 22 | $toDay = $datebits[2]; |
23 | 23 | } else { |
24 | 24 | $toDay = ''; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <?php } |
46 | 46 | if (!isset($years)) { ?> |
47 | 47 | <div class="calendar__controls"> |
48 | - <?php if ( isset($prev) ) { ?> |
|
48 | + <?php if (isset($prev)) { ?> |
|
49 | 49 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">←</a> |
50 | 50 | <?php } else { ?> |
51 | 51 | <span class="calendar__controls__previous"> </span> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <span class="calendar__controls__current"> |
54 | 54 | <?= $monthName ?> <?= $year ?> |
55 | 55 | </span> |
56 | - <?php if ( isset($next) ) { ?> |
|
56 | + <?php if (isset($next)) { ?> |
|
57 | 57 | <a href="<?= $next['url'] ?>" class="calendar__controls__next">→</a> |
58 | 58 | <?php } else { ?> |
59 | 59 | <span class="calendar__controls__next"> </span> |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | // sittings - e.g. WH is only Tuesday-Thursday |
107 | 107 | if ($currentDay == $toDay) { |
108 | 108 | print '<td class="on"'; |
109 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
109 | + if ($recess[0] && $recess[0] != 1) print ' title="' . $recess[0] . '"'; |
|
110 | 110 | print '>'; |
111 | 111 | } elseif ($recess[0]) { |
112 | 112 | print '<td class="no"'; |
113 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
113 | + if ($recess[0] != 1) print ' title="' . $recess[0] . '"'; |
|
114 | 114 | print '>'; |
115 | 115 | } else { |
116 | 116 | print '<td>'; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | // Is the $currentDay a member of $dates? If so, |
120 | 120 | // the day should be linked. |
121 | - if (in_array($currentDay,$dates)) { |
|
121 | + if (in_array($currentDay, $dates)) { |
|
122 | 122 | |
123 | 123 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
124 | 124 | |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | </tr> |
157 | 157 | </tbody> |
158 | 158 | </table> |
159 | - <?php if(!isset($years)){ ?> |
|
159 | + <?php if (!isset($years)) { ?> |
|
160 | 160 | <div class="calendar__footer"> |
161 | 161 | <?php |
162 | 162 | $y = $urls['day']; |
163 | 163 | $y->reset(); |
164 | - $y->insert(array( 'y' => $year )); |
|
164 | + $y->insert(array('y' => $year)); |
|
165 | 165 | $url = $y->generate(); |
166 | 166 | ?> |
167 | 167 | <a href="<?= $url ?>">See all of <?= $year ?></a> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="calendar"> |
2 | - <?php if(isset($month)){ |
|
2 | + <?php if(isset($month)) { |
|
3 | 3 | $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
4 | 4 | |
5 | 5 | // What is the first day of the month in question? |
@@ -20,17 +20,20 @@ discard block |
||
20 | 20 | $datebits = explode('-', $info['onday']); |
21 | 21 | if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
22 | 22 | $toDay = $datebits[2]; |
23 | - } else { |
|
23 | + } |
|
24 | + else { |
|
24 | 25 | $toDay = ''; |
25 | 26 | } |
26 | - } else { |
|
27 | + } |
|
28 | + else { |
|
27 | 29 | // If this calendar is for this current, real world, month |
28 | 30 | // we get the value of today, so we can highlight it. |
29 | 31 | $nowDateComponents = getdate(); |
30 | 32 | |
31 | 33 | if ($nowDateComponents['year'] == $year && $nowDateComponents['mon'] == $month) { |
32 | 34 | $toDay = $nowDateComponents['mday']; |
33 | - } else { |
|
35 | + } |
|
36 | + else { |
|
34 | 37 | $toDay = ''; |
35 | 38 | } |
36 | 39 | } |
@@ -47,7 +50,8 @@ discard block |
||
47 | 50 | <div class="calendar__controls"> |
48 | 51 | <?php if ( isset($prev) ) { ?> |
49 | 52 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">←</a> |
50 | - <?php } else { ?> |
|
53 | + <?php } |
|
54 | +else { ?> |
|
51 | 55 | <span class="calendar__controls__previous"> </span> |
52 | 56 | <?php } ?> |
53 | 57 | <span class="calendar__controls__current"> |
@@ -55,11 +59,13 @@ discard block |
||
55 | 59 | </span> |
56 | 60 | <?php if ( isset($next) ) { ?> |
57 | 61 | <a href="<?= $next['url'] ?>" class="calendar__controls__next">→</a> |
58 | - <?php } else { ?> |
|
62 | + <?php } |
|
63 | +else { ?> |
|
59 | 64 | <span class="calendar__controls__next"> </span> |
60 | 65 | <?php } ?> |
61 | 66 | </div> |
62 | - <?php } else { ?> |
|
67 | + <?php } |
|
68 | +else { ?> |
|
63 | 69 | <div class="calendar__header"> |
64 | 70 | <?= $monthName ?> |
65 | 71 | </div> |
@@ -106,13 +112,19 @@ discard block |
||
106 | 112 | // sittings - e.g. WH is only Tuesday-Thursday |
107 | 113 | if ($currentDay == $toDay) { |
108 | 114 | print '<td class="on"'; |
109 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
115 | + if ($recess[0] && $recess[0]!=1) { |
|
116 | + print ' title="'.$recess[0].'"'; |
|
117 | + } |
|
110 | 118 | print '>'; |
111 | - } elseif ($recess[0]) { |
|
119 | + } |
|
120 | + elseif ($recess[0]) { |
|
112 | 121 | print '<td class="no"'; |
113 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
122 | + if ($recess[0]!=1) { |
|
123 | + print ' title="'.$recess[0].'"'; |
|
124 | + } |
|
114 | 125 | print '>'; |
115 | - } else { |
|
126 | + } |
|
127 | + else { |
|
116 | 128 | print '<td>'; |
117 | 129 | } |
118 | 130 | |
@@ -124,7 +136,8 @@ discard block |
||
124 | 136 | |
125 | 137 | if ($currentDay == $toDay) { |
126 | 138 | print '<span>' . $currentDay . '</span></td>'; |
127 | - } else { |
|
139 | + } |
|
140 | + else { |
|
128 | 141 | $day_section = $section; |
129 | 142 | if ($section == 'sp') { |
130 | 143 | $day_section = 'spdebates'; |
@@ -135,7 +148,8 @@ discard block |
||
135 | 148 | |
136 | 149 | // $currentDay is not a member of $dates. |
137 | 150 | |
138 | - } else { |
|
151 | + } |
|
152 | + else { |
|
139 | 153 | |
140 | 154 | print '<span>' . $currentDay . '</span></td>'; |
141 | 155 | } |