@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | }(document, 'script', 'facebook-jssdk')); |
158 | 158 | </script> |
159 | 159 | |
160 | - <?php if ( $banner_text ) { ?> |
|
160 | + <?php if ($banner_text) { ?> |
|
161 | 161 | <div class="banner"> |
162 | 162 | <div class="full-page__row"> |
163 | 163 | <div class="banner__content"> |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | <div class="site-nav__user"> |
236 | 236 | <ul> |
237 | - <?php foreach ($user_nav_links as $nav_link){ ?> |
|
237 | + <?php foreach ($user_nav_links as $nav_link) { ?> |
|
238 | 238 | <li><a href="<?= $nav_link['href']; ?>" title="<?= $nav_link['title']; ?>" class="<?= $nav_link['classes']; ?>"> |
239 | 239 | <?= $nav_link['text'] ?> |
240 | 240 | </a></li> |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | <div class="full-page legacy-page static-page"> |
269 | 269 | <div class="full-page__row"> |
270 | 270 | <div class="panel"> |
271 | - <?php foreach ( $page_errors as $error ) { ?> |
|
271 | + <?php foreach ($page_errors as $error) { ?> |
|
272 | 272 | <p><?= $error['text'] ?></p> |
273 | 273 | <?php } ?> |
274 | 274 | </div> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $menudata = $this->pagedata->page_metadata('userviewself', 'menu'); |
48 | 48 | $edittitle = $menudata['title']; |
49 | 49 | $EDITURL = new \MySociety\TheyWorkForYou\Url('userviewself'); |
50 | - if ($this->page == 'userviewself' || $this->page == 'useredit' ) { |
|
50 | + if ($this->page == 'userviewself' || $this->page == 'useredit') { |
|
51 | 51 | $editclass = 'on'; |
52 | 52 | } else { |
53 | 53 | $editclass = ''; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | // The 'Log out' link. |
57 | 57 | $menudata = $this->pagedata->page_metadata('userlogout', 'menu'); |
58 | 58 | $logouttext = $menudata['text']; |
59 | - $logouttitle= $menudata['title']; |
|
59 | + $logouttitle = $menudata['title']; |
|
60 | 60 | |
61 | 61 | $LOGOUTURL = new \MySociety\TheyWorkForYou\Url('userlogout'); |
62 | 62 | if ($this->page != 'userlogout') { |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | public function getDataSet() |
10 | 10 | { |
11 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/user.xml'); |
|
11 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/user.xml'); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | private function fetch_page($vars) |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | return $this->base_fetch_page($vars, 'user'); |
17 | 17 | } |
18 | 18 | |
19 | - private function fetch_user_page( $vars = array(), $page = 'user' ) |
|
19 | + private function fetch_user_page($vars = array(), $page = 'user') |
|
20 | 20 | { |
21 | - return $this->base_fetch_page_user( $vars, '1.fbb689a0c092f5534b929d302db2c8a9', $page ); |
|
21 | + return $this->base_fetch_page_user($vars, '1.fbb689a0c092f5534b929d302db2c8a9', $page); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function testLoginPageLoads() |
25 | 25 | { |
26 | - $page = $this->base_fetch_page( array(), 'user/login' ); |
|
26 | + $page = $this->base_fetch_page(array(), 'user/login'); |
|
27 | 27 | $this->assertContains('Sign in', $page); |
28 | 28 | } |
29 | 29 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | 'password' => 'password', |
35 | 35 | 'submitted' => 'true', |
36 | 36 | ); |
37 | - $page = $this->base_fetch_page( $vars, 'user/login' ); |
|
37 | + $page = $this->base_fetch_page($vars, 'user/login'); |
|
38 | 38 | # it's a redirect which means we should get nothing |
39 | 39 | # as we're using the cli version of php :( |
40 | 40 | $this->assertEquals('', $page); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function testEditUserInfo() |
51 | 51 | { |
52 | - $page = $this->fetch_user_page( array('pg' => 'edit' ) ); |
|
52 | + $page = $this->fetch_user_page(array('pg' => 'edit')); |
|
53 | 53 | $this->assertContains('Edit your details', $page); |
54 | 54 | $this->assertContains('name="pg" value="edit"', $page); |
55 | 55 | $this->assertContains('value="Test"', $page); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'email' => '[email protected]', |
63 | 63 | 'submitted' => 'true', |
64 | 64 | ); |
65 | - $page = $this->fetch_user_page( $vars ); |
|
65 | + $page = $this->fetch_user_page($vars); |
|
66 | 66 | $this->assertContains('Example User', $page); |
67 | 67 | } |
68 | 68 | } |
@@ -91,6 +91,6 @@ |
||
91 | 91 | <span class="formw"><input type="submit" name="submit" value="Update"></span> |
92 | 92 | </div> |
93 | 93 | </form> |
94 | -EOF; |
|
94 | +eof; |
|
95 | 95 | return $out; |
96 | 96 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | if ($row['constituency']) { |
48 | 48 | $desc .= ', ' . $row['constituency']; |
49 | 49 | } |
50 | - $out .= '<option value="'.$p_id.'">'.$desc.'</option>' . "\n"; |
|
50 | + $out .= '<option value="' . $p_id . '">' . $desc . '</option>' . "\n"; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $out .= ' </select></span> </div> '; |
@@ -43,7 +43,9 @@ |
||
43 | 43 | $house = $row['house']; |
44 | 44 | $desc = member_full_name($house, $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']) . |
45 | 45 | " " . $houses[$house]; |
46 | - if ($row['party']) $desc .= ' (' . $row['party'] . ')'; |
|
46 | + if ($row['party']) { |
|
47 | + $desc .= ' (' . $row['party'] . ')'; |
|
48 | + } |
|
47 | 49 | if ($row['constituency']) { |
48 | 50 | $desc .= ', ' . $row['constituency']; |
49 | 51 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/alerts.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/alerts.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $ALERT = new ALERT(); |
33 | 33 | |
34 | - $response = $ALERT->fetch(0,0); |
|
34 | + $response = $ALERT->fetch(0, 0); |
|
35 | 35 | |
36 | 36 | // Make sure we only get one response |
37 | 37 | $this->assertEquals(1, count($response['data'])); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $ALERT = new ALERT(); |
50 | 50 | |
51 | - $response = $ALERT->fetch(1,0); |
|
51 | + $response = $ALERT->fetch(1, 0); |
|
52 | 52 | |
53 | 53 | // Make sure we only get two responses |
54 | 54 | $this->assertEquals(2, count($response['data'])); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $ALERT = new ALERT(); |
67 | 67 | |
68 | - $response = $ALERT->fetch_between(1,0, '2014-02-03', '2014-02-04'); |
|
68 | + $response = $ALERT->fetch_between(1, 0, '2014-02-03', '2014-02-04'); |
|
69 | 69 | |
70 | 70 | // Make sure we only get one response |
71 | 71 | $this->assertEquals(1, count($response['alerts'])); |
@@ -111,7 +111,8 @@ |
||
111 | 111 | <?php if ( $house != HOUSE_TYPE_LORDS) { ?> |
112 | 112 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
113 | 113 | <?php } ?> |
114 | - <?php } else { // no $pid ?> |
|
114 | + <?php } else { |
|
115 | +// no $pid ?> |
|
115 | 116 | <?= $speaker['name'] ?> |
116 | 117 | <?php } ?> |
117 | 118 | </td> |
@@ -9,17 +9,17 @@ discard block |
||
9 | 9 | <div class="search-page__section__primary"> |
10 | 10 | <h2>Who says <em class="current-search-term"><?= _htmlentities($searchstring) ?></em> the most?</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_NI) { ?> |
|
22 | + <?php } else if ($house == HOUSE_TYPE_NI) { ?> |
|
23 | 23 | No results for MLAs only |
24 | 24 | <?php } ?> |
25 | 25 | | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <?php } ?> |
32 | 32 | <?php } ?> |
33 | 33 | |
34 | - <?php if ( $wtt ) { ?> |
|
34 | + <?php if ($wtt) { ?> |
|
35 | 35 | <p><strong>Now, try reading what a couple of these Lords are saying, |
36 | 36 | to help you find someone appropriate. When you've found someone, |
37 | 37 | follow the "I want to write to (name of lord)" link on their results page |
@@ -39,37 +39,37 @@ discard block |
||
39 | 39 | </strong></p> |
40 | 40 | <?php } ?> |
41 | 41 | |
42 | - <?php if ( isset($speakers) && count($speakers) ) { ?> |
|
42 | + <?php if (isset($speakers) && count($speakers)) { ?> |
|
43 | 43 | |
44 | - <?php if ( !$wtt ) { ?> |
|
44 | + <?php if (!$wtt) { ?> |
|
45 | 45 | <ul class="search-result-display-options"> |
46 | 46 | <li>Results grouped by person</li> |
47 | 47 | <li> |
48 | - <?php if ( $house == HOUSE_TYPE_ROYAL) { ?> |
|
48 | + <?php if ($house == HOUSE_TYPE_ROYAL) { ?> |
|
49 | 49 | Show All |
50 | 50 | <?php } else { ?> |
51 | 51 | <a href="<?= $this_url->generate('html') ?>">Show All</a> |
52 | 52 | <?php } ?> |
53 | 53 | | |
54 | - <?php if ( $house == HOUSE_TYPE_COMMONS) { ?> |
|
54 | + <?php if ($house == HOUSE_TYPE_COMMONS) { ?> |
|
55 | 55 | MPs only |
56 | 56 | <?php } else { ?> |
57 | 57 | <a href="<?= $this_url->generate('html', array('house'=>1)) ?>">MPs only</a> |
58 | 58 | <?php } ?> |
59 | 59 | | |
60 | - <?php if ( $house == HOUSE_TYPE_LORDS) { ?> |
|
60 | + <?php if ($house == HOUSE_TYPE_LORDS) { ?> |
|
61 | 61 | Peers only |
62 | 62 | <?php } else { ?> |
63 | 63 | <a href="<?= $this_url->generate('html', array('house'=>2)) ?>">Lords only</a> |
64 | 64 | <?php } ?> |
65 | 65 | | |
66 | - <?php if ( $house == HOUSE_TYPE_SCOTLAND) { ?> |
|
66 | + <?php if ($house == HOUSE_TYPE_SCOTLAND) { ?> |
|
67 | 67 | MSPs only |
68 | 68 | <?php } else { ?> |
69 | 69 | <a href="<?= $this_url->generate('html', array('house'=>4)) ?>">MSPs only</a> |
70 | 70 | <?php } ?> |
71 | 71 | | |
72 | - <?php if ( $house == HOUSE_TYPE_NI) { ?> |
|
72 | + <?php if ($house == HOUSE_TYPE_NI) { ?> |
|
73 | 73 | MLAs only |
74 | 74 | <?php } else { ?> |
75 | 75 | <a href="<?= $this_url->generate('html', array('house'=>HOUSE_TYPE_NI)) ?>">MLAs only</a> |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | </tr> |
91 | 91 | </thead> |
92 | 92 | <tbody> |
93 | - <?php foreach ( $speakers as $pid => $speaker ) { ?> |
|
93 | + <?php foreach ($speakers as $pid => $speaker) { ?> |
|
94 | 94 | |
95 | - <?php if ( $wtt && $pid == 0 ) { continue; } // skip heading count for WTT lords list ?> |
|
95 | + <?php if ($wtt && $pid == 0) { continue; } // skip heading count for WTT lords list ?> |
|
96 | 96 | |
97 | 97 | <tr> |
98 | 98 | <td><?= $speaker['count'] ?></td> |
99 | 99 | <td> |
100 | - <?php if ( $pid ) { ?> |
|
101 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
100 | + <?php if ($pid) { ?> |
|
101 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
102 | 102 | <a href="/search/?q=<?= _htmlentities($searchstring) ?>&pid=<?= $pid ?><?= isset($wtt) && $speaker['left'] == '9999-12-31' ? '&wtt=2' : '' ?>"> |
103 | 103 | <?php } ?> |
104 | 104 | <?= isset($speaker['name']) ? $speaker['name'] : 'N/A' ?> |
105 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
105 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
106 | 106 | </a> |
107 | 107 | <?php } ?> |
108 | - <?php if ( isset($speaker['party']) ) { ?> |
|
108 | + <?php if (isset($speaker['party'])) { ?> |
|
109 | 109 | <span class="search-results-grouped__speaker-party">(<?= $speaker['party'] ?>)</span> |
110 | 110 | <?php } ?> |
111 | - <?php if ( $house != HOUSE_TYPE_LORDS) { ?> |
|
111 | + <?php if ($house != HOUSE_TYPE_LORDS) { ?> |
|
112 | 112 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
113 | 113 | <?php } ?> |
114 | 114 | <?php } else { // no $pid ?> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | <?php } ?> |
117 | 117 | </td> |
118 | 118 | <td> |
119 | - <?php if ( format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y') ) { ?> |
|
119 | + <?php if (format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y')) { ?> |
|
120 | 120 | <?= format_date($speaker['pmindate'], 'M Y') ?> |
121 | 121 | <?php } else { ?> |
122 | 122 | <?= format_date($speaker['pmindate'], 'M Y') ?> – <?= format_date($speaker['pmaxdate'], 'M Y') ?> |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | // $Id: dbtypes.php,v 1.8 2009-04-28 13:13:04 matthew Exp $ |
4 | 4 | |
5 | 5 | // The type field in the epobject database table |
6 | -define ('EPTYPE_HANSARD', 1); |
|
7 | -define ('EPTYPE_GLOSSARY', 2); |
|
6 | +define('EPTYPE_HANSARD', 1); |
|
7 | +define('EPTYPE_GLOSSARY', 2); |
|
8 | 8 | |
9 | 9 | // The major field in the hansard database table |
10 | 10 | $hansardmajors = array( |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | ); |
122 | 122 | $hansardmajors[104] = $hansardmajors[4]; |
123 | 123 | |
124 | -$parties = array ( |
|
124 | +$parties = array( |
|
125 | 125 | 'Bp' => 'Bishop', |
126 | 126 | 'Con' => 'Conservative', |
127 | 127 | 'CWM' => 'Deputy Speaker', |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | */ |
163 | 163 | |
164 | 164 | // Constants for various house types |
165 | -define ('HOUSE_TYPE_ROYAL', 0); |
|
166 | -define ('HOUSE_TYPE_COMMONS', 1); |
|
167 | -define ('HOUSE_TYPE_LORDS', 2); |
|
168 | -define ('HOUSE_TYPE_NI', 3); |
|
169 | -define ('HOUSE_TYPE_SCOTLAND', 4); |
|
170 | -define ('HOUSE_TYPE_WALES', 5); |
|
165 | +define('HOUSE_TYPE_ROYAL', 0); |
|
166 | +define('HOUSE_TYPE_COMMONS', 1); |
|
167 | +define('HOUSE_TYPE_LORDS', 2); |
|
168 | +define('HOUSE_TYPE_NI', 3); |
|
169 | +define('HOUSE_TYPE_SCOTLAND', 4); |
|
170 | +define('HOUSE_TYPE_WALES', 5); |
@@ -160,9 +160,9 @@ |
||
160 | 160 | VALUES |
161 | 161 | (:id, :type, :enabled);', |
162 | 162 | array( |
163 | - ':id' => $q->insert_id(), |
|
164 | - ':type' => EPTYPE_GLOSSARY, |
|
165 | - ':enabled' => 1, |
|
163 | + ':id' => $q->insert_id(), |
|
164 | + ':type' => EPTYPE_GLOSSARY, |
|
165 | + ':enabled' => 1, |
|
166 | 166 | )); |
167 | 167 | // Again, no point carrying on if this fails, |
168 | 168 | // so remove the previous entry |
@@ -194,8 +194,7 @@ discard block |
||
194 | 194 | )); |
195 | 195 | if (!$q->success()) { |
196 | 196 | break; |
197 | - } |
|
198 | - else { |
|
197 | + } else { |
|
199 | 198 | // Now send them an email telling them they've been approved |
200 | 199 | |
201 | 200 | |
@@ -236,8 +235,7 @@ discard block |
||
236 | 235 | WHERE edit_id=" . $decline_id . ";"); |
237 | 236 | if (!$q->success()) { |
238 | 237 | break; |
239 | - } |
|
240 | - else { |
|
238 | + } else { |
|
241 | 239 | // Scrub that one from the list of pending items |
242 | 240 | unset ($this->pending[$decline_id]); |
243 | 241 | } |
@@ -275,8 +273,7 @@ discard block |
||
275 | 273 | $this->update_pending_count(); |
276 | 274 | |
277 | 275 | return true; |
278 | - } |
|
279 | - else { |
|
276 | + } else { |
|
280 | 277 | return false; |
281 | 278 | } |
282 | 279 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | } else if ($the_users_mp) { |
56 | 56 | $wtt_url = $wtt_url . "?a=WMC&pc=" . _htmlentities(urlencode($user_postcode)); |
57 | 57 | } |
58 | - ?> |
|
58 | + ?> |
|
59 | 59 | <a href="<?= $wtt_url ?>" class="button" onclick="trackLinkClick(this, 'Links', 'WriteToThem', 'Person'); return false;">Send a message</a> |
60 | 60 | <?php } ?> |
61 | 61 | <?php if ($has_email_alerts) { ?> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <div class="person-header <?= $current_member_anywhere ? '' : 'person-header--historical'; ?>"> |
2 | 2 | <div class="full-page__row"> |
3 | 3 | <div class="full-page__unit"> |
4 | - <?php if ( $image ) { ?> |
|
4 | + <?php if ($image) { ?> |
|
5 | 5 | <div class="person-header__image <?= $image['size'] == 'S' ? 'person-header__image--small' : '' ?>"> |
6 | - <?php if ( $image['size'] == 'S' ) { ?> |
|
6 | + <?php if ($image['size'] == 'S') { ?> |
|
7 | 7 | <span style="background-image: url('<?= $image['url'] ?>');"></span> |
8 | 8 | <?php } ?> |
9 | 9 | <img src="<?= $image['url'] ?>"> |
@@ -11,19 +11,19 @@ discard block |
||
11 | 11 | <?php } ?> |
12 | 12 | <div class="person-header__about"> |
13 | 13 | <h1 class="person-header__about__name"><?= ucfirst($full_name) ?></h1> |
14 | - <?php if ( $known_for ) { ?> |
|
14 | + <?php if ($known_for) { ?> |
|
15 | 15 | <p class="person-header__about__known-for"> |
16 | 16 | <?= $known_for ?> |
17 | 17 | </p> |
18 | 18 | <?php } ?> |
19 | - <?php if ( $latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL ) { ?> |
|
19 | + <?php if ($latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL) { ?> |
|
20 | 20 | <p class="person-header__about__position"> |
21 | 21 | <span class="person-header__about__position__role"> |
22 | 22 | <?= $latest_membership['current'] ? '' : 'Former' ?> |
23 | 23 | <?= $latest_membership['party'] == 'Bishop' ? '' : $latest_membership['party'] ?> |
24 | 24 | <?= $latest_membership['rep_name'] ?> |
25 | 25 | </span> |
26 | - <?php if ( $latest_membership['constituency'] ) { ?> |
|
26 | + <?php if ($latest_membership['constituency']) { ?> |
|
27 | 27 | for |
28 | 28 | <span class="person-header__about__position__constituency"> |
29 | 29 | <?= $latest_membership['constituency'] ?> |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | <?php } ?> |
34 | 34 | <?php if (count($social_links) > 0) { ?> |
35 | 35 | <p class="person-header__about__media"> |
36 | - <?php foreach ($social_links as $link){ ?> |
|
36 | + <?php foreach ($social_links as $link) { ?> |
|
37 | 37 | <a href="<?= $link['href'] ?>" onclick="trackLinkClick(this, 'Social-Link', '<?= $link['type'] ?>', '<?= $link['text'] ?>'); return false;"><?= $link['text'] ?></a> |
38 | 38 | <?php } ?> |
39 | 39 | </p> |