@@ -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> '; |
@@ -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') ?> |
@@ -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> |
@@ -107,10 +107,10 @@ |
||
107 | 107 | |
108 | 108 | // if data has been submitted then handle that |
109 | 109 | if ( |
110 | - get_http_var("submitted") == "true" && ( |
|
110 | + get_http_var("submitted") == "true" && ( |
|
111 | 111 | $this_page == 'useredit' || $this_page == 'otheruseredit' || $this_page == 'userjoin' |
112 | - ) |
|
113 | - ) { |
|
112 | + ) |
|
113 | + ) { |
|
114 | 114 | // Put all the user-submitted data in an array. |
115 | 115 | $data = $user->getUpdateDetails($this_page, $THEUSER); |
116 | 116 | $data['ret'] = get_http_var("ret"); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | // We need a user_id. So make sure that exists. |
31 | 31 | // And make sure the user is allowed to do this! |
32 | 32 | $template = 'user/form'; |
33 | - if (is_numeric( get_http_var("u") ) && $THEUSER->is_able_to("edituser")) { |
|
33 | + if (is_numeric(get_http_var("u")) && $THEUSER->is_able_to("edituser")) { |
|
34 | 34 | |
35 | 35 | $data = $user->getUserDetails(get_http_var('u')); |
36 | 36 | $data['showall'] = true; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | <div class="row"> |
39 | 39 | <span class="label">Website</span> |
40 | - <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span> |
|
40 | + <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">' . _htmlentities($website) . '</a>' ?></span> |
|
41 | 41 | </div> |
42 | 42 | |
43 | 43 | <?php if ($facebook_user) { ?> |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | <div class="row"> |
10 | 10 | <span class="label">Website</span> |
11 | - <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span> |
|
11 | + <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">' . _htmlentities($website) . '</a>' ?></span> |
|
12 | 12 | </div> |
13 | 13 | |
14 | 14 | <div class="row"> |