@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | // where rid is a report_id and cid is a comment_id. |
7 | 7 | |
8 | 8 | include_once '../../includes/easyparliament/init.php'; |
9 | -include_once (INCLUDESPATH."easyparliament/commentreport.php"); |
|
9 | +include_once (INCLUDESPATH . "easyparliament/commentreport.php"); |
|
10 | 10 | |
11 | 11 | $this_page = "admin_commentreport"; |
12 | 12 | |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | global $this_page; |
178 | 178 | |
179 | 179 | # $commentermail = preg_replace("/\n/", "<br>\n", get_template_contents('comment_deleted') ); |
180 | - $commentermail = preg_replace('/^Subject:.*\n/', '', get_template_contents('comment_deleted') ); |
|
181 | - $reportermail = preg_replace("/\n/", "<br>\n", get_template_contents('report_upheld') ); |
|
180 | + $commentermail = preg_replace('/^Subject:.*\n/', '', get_template_contents('comment_deleted')); |
|
181 | + $reportermail = preg_replace("/\n/", "<br>\n", get_template_contents('report_upheld')); |
|
182 | 182 | |
183 | 183 | ?> |
184 | 184 | <p><strong>You've chosen to delete this comment.</strong> You can now send an email to both the person who posted the comment, and the person who made the report. Uncheck a box to prevent an email from being sent. The comment will not be deleted until you click the button below.</p> |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | global $this_page; |
213 | 213 | |
214 | - $reportermail = preg_replace("/\n/", "<br>\n", get_template_contents('report_declined') ); |
|
214 | + $reportermail = preg_replace("/\n/", "<br>\n", get_template_contents('report_declined')); |
|
215 | 215 | |
216 | 216 | ?> |
217 | 217 | <p><strong>You have chosen not to delete this comment.</strong> You can now send an email to the person who made the report (uncheck the box to send no email). The report will not be resolved until you click the button below.</p> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $upheld = false; |
244 | 244 | } |
245 | 245 | |
246 | - $success = $REPORT->resolve ($upheld, $COMMENT); |
|
246 | + $success = $REPORT->resolve($upheld, $COMMENT); |
|
247 | 247 | |
248 | 248 | if ($success) { |
249 | 249 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | // The reporting user was logged in at the time, |
262 | 262 | // so get their email address. |
263 | 263 | $USER = new USER; |
264 | - $USER->init( $REPORT->user_id() ); |
|
264 | + $USER->init($REPORT->user_id()); |
|
265 | 265 | $email = $USER->email(); |
266 | 266 | } else { |
267 | 267 | // Non-logged-in user; they should have left their address. |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | } |
270 | 270 | |
271 | 271 | // Prepare the data needed for either email. |
272 | - $data = array ( |
|
272 | + $data = array( |
|
273 | 273 | 'to' => $email |
274 | 274 | ); |
275 | - $merge = array ( |
|
275 | + $merge = array( |
|
276 | 276 | 'REPORTBODY' => strip_tags($REPORT->body()) |
277 | 277 | ); |
278 | 278 | |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | // Remove the anchor for their now deleted comment. |
307 | 307 | $addcommentsurl = 'https://' . DOMAIN . preg_replace("/#.*$/", '#addcomment', $COMMENT->url()); |
308 | 308 | |
309 | - $data = array ( |
|
309 | + $data = array( |
|
310 | 310 | 'to' => $USER->email(), |
311 | 311 | 'template' => 'comment_deleted_blank', |
312 | 312 | 'subject' => 'One of your comments has been deleted', |
313 | 313 | ); |
314 | - $merge = array ( |
|
314 | + $merge = array( |
|
315 | 315 | 'REPLYBODY' => get_http_var('commentermail'), |
316 | 316 | # 'DELETEDREASON' => get_http_var('deletedreason'), |
317 | 317 | 'ADDCOMMENTURL' => $addcommentsurl, |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | public $firstname = ''; |
28 | 28 | public $lastname = ''; |
29 | 29 | public $body = ''; |
30 | - public $reported = null; // datetime |
|
31 | - public $resolved = null; // datetime |
|
32 | - public $resolvedby = ''; // user_id |
|
33 | - public $locked = null; // datetime |
|
34 | - public $lockedby = ''; // user_id |
|
35 | - public $upheld = ''; // boolean |
|
30 | + public $reported = null; // datetime |
|
31 | + public $resolved = null; // datetime |
|
32 | + public $resolvedby = ''; // user_id |
|
33 | + public $locked = null; // datetime |
|
34 | + public $lockedby = ''; // user_id |
|
35 | + public $upheld = ''; // boolean |
|
36 | 36 | |
37 | 37 | // If the user was logged in, this will be set: |
38 | 38 | public $user_id = ''; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public $email = ''; |
41 | 41 | |
42 | 42 | |
43 | - public function __construct($report_id='') { |
|
43 | + public function __construct($report_id = '') { |
|
44 | 44 | // Pass it a report id and it gets and sets this report's data. |
45 | 45 | |
46 | 46 | $this->db = new ParlDB; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | global $THEUSER, $PAGE; |
162 | 162 | |
163 | 163 | if (!$THEUSER->is_able_to('reportcomment')) { |
164 | - $PAGE->error_message ("Sorry, you are not allowed to post reports."); |
|
164 | + $PAGE->error_message("Sorry, you are not allowed to post reports."); |
|
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
@@ -229,19 +229,19 @@ discard block |
||
229 | 229 | |
230 | 230 | if ($q->success()) { |
231 | 231 | // Inserted OK, so set up this object's variables. |
232 | - $this->report_id = $q->insert_id(); |
|
233 | - $this->comment_id = $COMMENT->comment_id(); |
|
234 | - $this->body = $body; |
|
235 | - $this->reported = $time; |
|
232 | + $this->report_id = $q->insert_id(); |
|
233 | + $this->comment_id = $COMMENT->comment_id(); |
|
234 | + $this->body = $body; |
|
235 | + $this->reported = $time; |
|
236 | 236 | |
237 | 237 | if ($THEUSER->isloggedin()) { |
238 | - $this->user_id = $THEUSER->user_id(); |
|
238 | + $this->user_id = $THEUSER->user_id(); |
|
239 | 239 | $this->firstname = $THEUSER->firstname(); |
240 | 240 | $this->lastname = $THEUSER->lastname(); |
241 | 241 | } else { |
242 | - $this->email = $reportdata['email']; |
|
243 | - $this->firstname = $reportdata['firstname']; |
|
244 | - $this->lastname = $reportdata['lastname']; |
|
242 | + $this->email = $reportdata['email']; |
|
243 | + $this->firstname = $reportdata['firstname']; |
|
244 | + $this->lastname = $reportdata['lastname']; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -273,11 +273,11 @@ discard block |
||
273 | 273 | $email = $this->email(); |
274 | 274 | } |
275 | 275 | |
276 | - $data = array ( |
|
276 | + $data = array( |
|
277 | 277 | 'to' => $email, |
278 | 278 | 'template' => 'report_acknowledge' |
279 | 279 | ); |
280 | - $merge = array ( |
|
280 | + $merge = array( |
|
281 | 281 | 'COMMENTURL' => "https://" . DOMAIN . $COMMENT->url(), |
282 | 282 | 'REPORTBODY' => strip_tags($this->body()) |
283 | 283 | ); |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | $data = array(); |
300 | 300 | |
301 | 301 | if (is_numeric($this->report_id)) { |
302 | - $data = array ( |
|
302 | + $data = array( |
|
303 | 303 | 'report_id' => $this->report_id(), |
304 | 304 | 'comment_id' => $this->comment_id(), |
305 | 305 | 'user_id' => $this->user_id(), |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | if ($THEUSER->is_able_to('deletecomment')) { |
337 | 337 | $time = gmdate("Y-m-d H:i:s"); |
338 | 338 | |
339 | - $q = $this->db->query ("UPDATE commentreports |
|
339 | + $q = $this->db->query("UPDATE commentreports |
|
340 | 340 | SET locked = '$time', |
341 | 341 | lockedby = '" . $THEUSER->user_id() . "' |
342 | 342 | WHERE report_id = '" . $this->report_id . "' |
@@ -347,11 +347,11 @@ discard block |
||
347 | 347 | $this->lockedby = $THEUSER->user_id(); |
348 | 348 | return true; |
349 | 349 | } else { |
350 | - $PAGE->error_message ("Sorry, we were unable to lock this report."); |
|
350 | + $PAGE->error_message("Sorry, we were unable to lock this report."); |
|
351 | 351 | return false; |
352 | 352 | } |
353 | 353 | } else { |
354 | - $PAGE->error_message ("You are not authorised to delete annotations."); |
|
354 | + $PAGE->error_message("You are not authorised to delete annotations."); |
|
355 | 355 | return false; |
356 | 356 | } |
357 | 357 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | public function unlock() { |
361 | 361 | // Unlock a comment so it can be examined by someone else. |
362 | 362 | |
363 | - $q = $this->db->query ("UPDATE commentreports |
|
363 | + $q = $this->db->query("UPDATE commentreports |
|
364 | 364 | SET locked = NULL, |
365 | 365 | lockedby = NULL |
366 | 366 | WHERE report_id = '" . $this->report_id . "' |
@@ -434,16 +434,16 @@ discard block |
||
434 | 434 | |
435 | 435 | return true; |
436 | 436 | } else { |
437 | - $PAGE->error_message ("Sorry, we couldn't resolve this report."); |
|
437 | + $PAGE->error_message("Sorry, we couldn't resolve this report."); |
|
438 | 438 | return false; |
439 | 439 | } |
440 | 440 | } else { |
441 | - $PAGE->error_message ("This report has already been resolved (on " . $this->resolved . ")"); |
|
441 | + $PAGE->error_message("This report has already been resolved (on " . $this->resolved . ")"); |
|
442 | 442 | return false; |
443 | 443 | } |
444 | 444 | |
445 | 445 | } else { |
446 | - $PAGE->error_message ("You are not authorised to resolve reports."); |
|
446 | + $PAGE->error_message("You are not authorised to resolve reports."); |
|
447 | 447 | return false; |
448 | 448 | } |
449 | 449 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | return $cohorts; |
389 | 389 | } |
390 | 390 | |
391 | - public static function getCohortQuery(){ |
|
391 | + public static function getCohortQuery() { |
|
392 | 392 | $membership_query = ' |
393 | 393 | select member_periods.person_id as person_id, |
394 | 394 | md5(concat(start_party, "|", membership_key, "|", IFNULL(absence_key,""))) as cohort_hash |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | } |
418 | 418 | |
419 | 419 | |
420 | - public static function getHashforPerson($person_id){ |
|
420 | + public static function getHashforPerson($person_id) { |
|
421 | 421 | // given a person id, return the hash for that cohort |
422 | 422 | $db = new \ParlDB; |
423 | 423 | $row = $db->query("SELECT cohort_hash |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | } |
433 | 433 | } |
434 | 434 | |
435 | - public static function calculatePositions($quiet=true){ |
|
435 | + public static function calculatePositions($quiet = true) { |
|
436 | 436 | // get current hashes available |
437 | 437 | $cohorts = PartyCohort::getCohorts(); |
438 | 438 | $db = new \ParlDB; |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | |
442 | 442 | // iterate through all hashes and create policy positions |
443 | 443 | $cohort_count = 0; |
444 | - foreach ( $cohorts as $cohort ) { |
|
444 | + foreach ($cohorts as $cohort) { |
|
445 | 445 | |
446 | 446 | $cohort = new PartyCohort($cohort, true); |
447 | 447 | |
@@ -450,8 +450,8 @@ discard block |
||
450 | 450 | $cohort_count++; |
451 | 451 | |
452 | 452 | $db->conn->beginTransaction(); |
453 | - foreach ( $positions as $position ) { |
|
454 | - $cohort->cache_position( $position ); |
|
453 | + foreach ($positions as $position) { |
|
454 | + $cohort->cache_position($position); |
|
455 | 455 | } |
456 | 456 | $db->conn->commit(); |
457 | 457 | if (!$quiet) { |
@@ -26,14 +26,14 @@ |
||
26 | 26 | if (isset($THEUSER) && $THEUSER->postcode_is_set()) { |
27 | 27 | try { |
28 | 28 | $MEMBER = new MySociety\TheyWorkForYou\Member(array('postcode' => $THEUSER->postcode(), 'house' => \MySociety\TheyWorkForYou\Utility\House::majorToHouse($view->major)[0])); |
29 | - } catch ( MySociety\TheyWorkForYou\MemberException $e ) { |
|
29 | + } catch (MySociety\TheyWorkForYou\MemberException $e) { |
|
30 | 30 | $MEMBER = null; |
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | 34 | $data = $view->display(); |
35 | 35 | if ($data) { |
36 | - if ( !empty($data['template']) ) { |
|
36 | + if (!empty($data['template'])) { |
|
37 | 37 | $template = $data['template']; |
38 | 38 | } else { |
39 | 39 | $template = 'section/section'; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | $type = ucfirst(get_http_var('type')); |
16 | -$class_name = "MySociety\TheyWorkForYou\SectionView\\${type}View"; |
|
16 | +$class_name = "MySociety\TheyWorkForYou\SectionView\\${type}view"; |
|
17 | 17 | if (!$type || !class_exists($class_name)) { |
18 | 18 | $PAGE->error_message("No type specified", true); |
19 | 19 | exit; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once INCLUDESPATH."easyparliament/member.php"; |
|
4 | +include_once INCLUDESPATH . "easyparliament/member.php"; |
|
5 | 5 | |
6 | 6 | $pc = get_http_var('pc'); |
7 | 7 | $pc = preg_replace('#[^a-z0-9]#i', '', $pc); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $errors['pc'] = "Sorry, we couldn't check your postcode right now. Please use the 'All Mps' link above to browse MPs"; |
16 | 16 | } elseif ($constituency == "") { |
17 | 17 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode"; |
18 | - twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
18 | + twfy_debug('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
19 | 19 | } else { |
20 | 20 | $MEMBER = new MEMBER(array('constituency' => $constituency)); |
21 | 21 | if ($MEMBER->person_id()) { |
@@ -29,5 +29,5 @@ discard block |
||
29 | 29 | } |
30 | 30 | } else { |
31 | 31 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a valid postcode"; |
32 | - twfy_debug ('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
32 | + twfy_debug('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
33 | 33 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | public function display() { |
8 | 8 | $data = array(); |
9 | 9 | $data['recent_election'] = false; |
10 | - if ( $this->user->loggedin() ) { |
|
10 | + if ($this->user->loggedin()) { |
|
11 | 11 | $data['user_signed_in'] = true; |
12 | 12 | } |
13 | 13 | |
@@ -17,21 +17,21 @@ discard block |
||
17 | 17 | $data['postcode'] = trim(get_http_var('postcode')); |
18 | 18 | |
19 | 19 | $result = $this->createAlertForPostCode($data['email'], $data['postcode']); |
20 | - $data = array_merge( $data, $result ); |
|
20 | + $data = array_merge($data, $result); |
|
21 | 21 | } elseif (get_http_var('update')) { |
22 | 22 | $result = $this->getNewMP(get_http_var('update')); |
23 | - $data = array_merge( $data, $result ); |
|
23 | + $data = array_merge($data, $result); |
|
24 | 24 | } elseif (get_http_var('update-alert')) { |
25 | - $success = $this->replaceAlert( get_http_var('confirmation') ); |
|
25 | + $success = $this->replaceAlert(get_http_var('confirmation')); |
|
26 | 26 | $data['confirmation_received'] = $success; |
27 | 27 | } elseif (get_http_var('confirmed')) { |
28 | - $success = $this->confirmAlert( get_http_var('confirmed') ); |
|
28 | + $success = $this->confirmAlert(get_http_var('confirmed')); |
|
29 | 29 | $data['confirmation_received'] = $success; |
30 | 30 | } else { |
31 | 31 | $data['email'] = $this->user->email() ? $this->user->email() : ''; |
32 | 32 | $data['postcode'] = $this->user->postcode_is_set() ? $this->user->postcode() : ''; |
33 | 33 | |
34 | - if ( $this->isEmailSignedUpForPostCode( $data['email'], $data['postcode'] ) ) { |
|
34 | + if ($this->isEmailSignedUpForPostCode($data['email'], $data['postcode'])) { |
|
35 | 35 | $data['already_signed_up'] = true; |
36 | 36 | $mp = $this->getPersonFromPostcode($data['postcode']); |
37 | 37 | $data['mp_name'] = $mp->full_name(); |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | private function createAlertForPostCode($email, $postcode) { |
69 | - if ( !$this->validateDetails($email, $postcode) ) { |
|
69 | + if (!$this->validateDetails($email, $postcode)) { |
|
70 | 70 | return array('invalid-postcode-or-email' => true); |
71 | 71 | } |
72 | 72 | |
73 | 73 | try { |
74 | 74 | $person = $this->getPersonFromPostcode($postcode); |
75 | - } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
|
75 | + } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
|
76 | 76 | return array('bad-constituency' => true); |
77 | 77 | } |
78 | 78 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | switch ($result) { |
91 | 91 | case self::ALERT_EXISTS: |
92 | - if ( $not_logged_in ) { |
|
92 | + if ($not_logged_in) { |
|
93 | 93 | // no logged in user so send them an email to let them |
94 | 94 | // know someone tried to create an alert |
95 | 95 | $this->alert->send_already_signedup_email($details); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $data['error'] = true; |
103 | 103 | break; |
104 | 104 | default: // alert created |
105 | - if ( $not_logged_in ) { |
|
105 | + if ($not_logged_in) { |
|
106 | 106 | $data['confirmation_sent'] = true; |
107 | 107 | } else { |
108 | 108 | $data['signedup_no_confirm'] = true; |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | $existing = $this->alert->fetch_by_token($confirmation); |
117 | 117 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
118 | 118 | $old_mp_id = $matches[1]; |
119 | - $old_mp = new \MySociety\TheyWorkForYou\Member(array( 'person_id' => $old_mp_id ) ); |
|
120 | - $new_mp = new \MySociety\TheyWorkForYou\Member(array( 'constituency' => $old_mp->constituency, 'house' => 1 )); |
|
119 | + $old_mp = new \MySociety\TheyWorkForYou\Member(array('person_id' => $old_mp_id)); |
|
120 | + $new_mp = new \MySociety\TheyWorkForYou\Member(array('constituency' => $old_mp->constituency, 'house' => 1)); |
|
121 | 121 | |
122 | 122 | $q = $this->db->query( |
123 | 123 | "SELECT alert_id, criteria, registrationtoken FROM alerts |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'pid' => $new_mp->person_id, |
142 | 142 | 'pc' => '', |
143 | 143 | ); |
144 | - if ( $other_criteria ) { |
|
144 | + if ($other_criteria) { |
|
145 | 145 | $details['keyword'] = $other_criteria; |
146 | 146 | } |
147 | 147 | |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | private function isEmailSignedUpForPostCode($email, $postcode) { |
159 | 159 | $is_signed_up = false; |
160 | 160 | |
161 | - if ( $email && $postcode ) { |
|
161 | + if ($email && $postcode) { |
|
162 | 162 | try { |
163 | 163 | $person = $this->getPersonFromPostcode($postcode); |
164 | 164 | $is_signed_up = $this->alert->fetch_by_mp($email, $person->person_id); |
165 | - } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
|
165 | + } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
|
166 | 166 | $is_signed_up = false; |
167 | 167 | } |
168 | 168 | } |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
179 | 179 | $criteria = $matches[1]; |
180 | 180 | |
181 | - $old_mp = new \MySociety\TheyWorkForYou\Member(array( 'person_id' => $criteria ) ); |
|
182 | - $new_mp = new \MySociety\TheyWorkForYou\Member(array( 'constituency' => $old_mp->constituency, 'house' => 1 )); |
|
181 | + $old_mp = new \MySociety\TheyWorkForYou\Member(array('person_id' => $criteria)); |
|
182 | + $new_mp = new \MySociety\TheyWorkForYou\Member(array('constituency' => $old_mp->constituency, 'house' => 1)); |
|
183 | 183 | |
184 | - if ( $this->alert->fetch_by_mp( $existing['email'], $new_mp->person_id) ) { |
|
184 | + if ($this->alert->fetch_by_mp($existing['email'], $new_mp->person_id)) { |
|
185 | 185 | $data = array( |
186 | 186 | 'already_signed_up' => true, |
187 | 187 | 'old_mp' => $old_mp->full_name(), |
@@ -54,42 +54,42 @@ |
||
54 | 54 | |
55 | 55 | public static function getCountryDetails($house) { |
56 | 56 | $details = array( |
57 | - HOUSE_TYPE_COMMONS => array ( |
|
57 | + HOUSE_TYPE_COMMONS => array( |
|
58 | 58 | 'country' => 'UK', |
59 | 59 | 'assembly' => 'uk-commons', |
60 | 60 | 'location' => '– in the House of Commons', |
61 | 61 | 'cons_type' => 'WMC', |
62 | 62 | 'assembly_name' => 'House of Commons', |
63 | 63 | ), |
64 | - HOUSE_TYPE_NI => array ( |
|
64 | + HOUSE_TYPE_NI => array( |
|
65 | 65 | 'country' => 'NORTHERN IRELAND', |
66 | 66 | 'assembly' => 'ni', |
67 | 67 | 'location' => '– in the Northern Ireland Assembly', |
68 | 68 | 'cons_type' => 'NIE', |
69 | 69 | 'assembly_name' => 'Northern Ireland Assembly', |
70 | 70 | ), |
71 | - HOUSE_TYPE_SCOTLAND => array ( |
|
71 | + HOUSE_TYPE_SCOTLAND => array( |
|
72 | 72 | 'country' => 'SCOTLAND', |
73 | 73 | 'assembly' => 'scotland', |
74 | 74 | 'location' => '– in the Scottish Parliament', |
75 | 75 | 'cons_type' => 'SPC', |
76 | 76 | 'assembly_name' => 'Scottish Parliament', |
77 | 77 | ), |
78 | - HOUSE_TYPE_WALES => array ( |
|
78 | + HOUSE_TYPE_WALES => array( |
|
79 | 79 | 'country' => 'WALES', |
80 | 80 | 'assembly' => 'wales', |
81 | 81 | 'location' => '– in the Senedd', |
82 | 82 | 'cons_type' => 'WAC', |
83 | 83 | 'assembly_name' => 'Welsh Parliament', |
84 | 84 | ), |
85 | - HOUSE_TYPE_LORDS => array ( |
|
85 | + HOUSE_TYPE_LORDS => array( |
|
86 | 86 | 'country' => 'UK', |
87 | 87 | 'assembly' => 'uk-lords', |
88 | 88 | 'location' => '– in the House of Lords', |
89 | 89 | 'cons_type' => '', |
90 | 90 | 'assembly_name' => 'House of Lords', |
91 | 91 | ), |
92 | - HOUSE_TYPE_LONDON_ASSEMBLY => array ( |
|
92 | + HOUSE_TYPE_LONDON_ASSEMBLY => array( |
|
93 | 93 | 'country' => 'UK', |
94 | 94 | 'assembly' => 'london-assembly', |
95 | 95 | 'location' => '– in the London Assembly', |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $DEBATELIST = new \DEBATELIST; |
17 | 17 | $debates = array(); |
18 | 18 | $debates['data'] = $DEBATELIST->display('biggest_debates', array('days'=>7, 'num'=>10), 'none'); |
19 | - $args = array( 'months' => 1 ); |
|
19 | + $args = array('months' => 1); |
|
20 | 20 | $debates['calendar'] = $DEBATELIST->display('calendar', $args, 'none'); |
21 | 21 | $debates['rssurl'] = $DATA->page_metadata($this_page, 'rss'); |
22 | 22 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $WHALLLIST = new \WHALLLIST; |
28 | 28 | $whall['data'] = $WHALLLIST->display('biggest_debates', array('days'=>7, 'num'=>10), 'none'); |
29 | - $args = array( 'months' => 1 ); |
|
29 | + $args = array('months' => 1); |
|
30 | 30 | $whall['calendar'] = $WHALLLIST->display('calendar', $args, 'none'); |
31 | 31 | $whall['rssurl'] = $DATA->page_metadata($this_page, 'rss'); |
32 | 32 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $LORDSDEBATELIST = new \LORDSDEBATELIST; |
38 | 38 | $lords['data'] = $LORDSDEBATELIST->display('biggest_debates', array('days'=>7, 'num'=>10), 'none'); |
39 | - $args = array( 'months' => 1 ); |
|
39 | + $args = array('months' => 1); |
|
40 | 40 | $lords['calendar'] = $LORDSDEBATELIST->display('calendar', $args, 'none'); |
41 | 41 | |
42 | 42 | $lords['rssurl'] = $DATA->page_metadata($this_page, 'rss'); |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | |
56 | 56 | protected function getSearchSections() { |
57 | 57 | return array( |
58 | - array( 'section' => 'debates', 'title' => 'House of Commons' ), |
|
59 | - array( 'section' => 'lords', 'title' => 'House of Lords' ), |
|
60 | - array( 'section' => 'whall', 'title' => 'Westminster Hall' ) |
|
58 | + array('section' => 'debates', 'title' => 'House of Commons'), |
|
59 | + array('section' => 'lords', 'title' => 'House of Lords'), |
|
60 | + array('section' => 'whall', 'title' => 'Westminster Hall') |
|
61 | 61 | ); |
62 | 62 | } |
63 | 63 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/alertspage.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/alertspage.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | private function fetch_page($vars) |
@@ -21,37 +21,37 @@ discard block |
||
21 | 21 | |
22 | 22 | public function testFetchPage() |
23 | 23 | { |
24 | - $page = $this->fetch_page( array() ); |
|
24 | + $page = $this->fetch_page(array()); |
|
25 | 25 | $this->assertContains('TheyWorkForYou Email Alerts', $page); |
26 | 26 | } |
27 | 27 | |
28 | 28 | public function testKeywordOnly() { |
29 | - $page = $this->fetch_page( array( 'alertsearch' => 'elephant') ); |
|
29 | + $page = $this->fetch_page(array('alertsearch' => 'elephant')); |
|
30 | 30 | $this->assertContains('Receive alerts when [elephant] is mentioned', $page); |
31 | 31 | } |
32 | 32 | |
33 | 33 | public function testPostCodeOnly() { |
34 | - $page = $this->fetch_page( array( 'alertsearch' => 'SE17 3HE') ); |
|
34 | + $page = $this->fetch_page(array('alertsearch' => 'SE17 3HE')); |
|
35 | 35 | $this->assertContains('when Mrs Test Current-MP', $page); |
36 | 36 | } |
37 | 37 | |
38 | 38 | public function testPostCodeWithKeyWord() |
39 | 39 | { |
40 | - $page = $this->fetch_page( array( 'alertsearch' => 'SE17 3HE elephant') ); |
|
40 | + $page = $this->fetch_page(array('alertsearch' => 'SE17 3HE elephant')); |
|
41 | 41 | $this->assertContains('You have used a postcode and something else', $page); |
42 | 42 | $this->assertContains('Mentions of [elephant] by your MP, Mrs Test Current-MP', $page); |
43 | 43 | $this->assertNotContains('by your MSP', $page); |
44 | 44 | } |
45 | 45 | |
46 | 46 | public function testScottishPostcodeWithKeyword() { |
47 | - $page = $this->fetch_page( array( 'alertsearch' => 'PH6 2DB elephant') ); |
|
47 | + $page = $this->fetch_page(array('alertsearch' => 'PH6 2DB elephant')); |
|
48 | 48 | $this->assertContains('You have used a postcode and something else', $page); |
49 | 49 | $this->assertContains('Mentions of [elephant] by your MP, Mr Test2 Current-MP', $page); |
50 | 50 | $this->assertContains('Mentions of [elephant] by your MSP, Mrs Test Current-MSP', $page); |
51 | 51 | } |
52 | 52 | |
53 | 53 | public function testPostcodeAndKeywordWithNoSittingMP() { |
54 | - $page = $this->fetch_page( array( 'alertsearch' => 'OX1 4LF elephant') ); |
|
54 | + $page = $this->fetch_page(array('alertsearch' => 'OX1 4LF elephant')); |
|
55 | 55 | $this->assertContains('You have used a postcode and something else', $page); |
56 | 56 | $this->assertNotContains('Did you mean to get alerts for when your MP', $page); |
57 | 57 | } |