@@ -3,7 +3,7 @@ |
||
3 | 3 | $new_style_template = TRUE; |
4 | 4 | |
5 | 5 | include_once '../../../includes/easyparliament/init.php'; |
6 | -include_once INCLUDESPATH . 'easyparliament/member.php'; |
|
6 | +include_once INCLUDESPATH.'easyparliament/member.php'; |
|
7 | 7 | |
8 | 8 | $alert = new MySociety\TheyWorkForYou\AlertView\Simple($THEUSER); |
9 | 9 | $data = $alert->display(); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$new_style_template = TRUE; |
|
3 | +$new_style_template = true; |
|
4 | 4 | |
5 | 5 | include_once '../../../includes/easyparliament/init.php'; |
6 | 6 | include_once INCLUDESPATH . 'easyparliament/member.php'; |
@@ -7,7 +7,7 @@ |
||
7 | 7 | namespace MySociety\TheyWorkForYou; |
8 | 8 | |
9 | 9 | // Disable the old PAGE class. |
10 | -$new_style_template = TRUE; |
|
10 | +$new_style_template = true; |
|
11 | 11 | global $this_page; |
12 | 12 | $this_page = 'topics'; |
13 | 13 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | $topic = $topics->getTopic($slug); |
9 | 9 | } |
10 | 10 | |
11 | -if (!$slug || !isset($topic) || $topic === NULL) { |
|
11 | +if (!$slug || !isset($topic) || $topic === null) { |
|
12 | 12 | header('HTTP/1.0 404 Not Found'); |
13 | 13 | exit(); |
14 | 14 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | If the input is not OK, the form is displayed again with error messages. |
10 | 10 | */ |
11 | 11 | |
12 | -$new_style_template = TRUE; |
|
12 | +$new_style_template = true; |
|
13 | 13 | |
14 | 14 | include_once '../../../includes/easyparliament/init.php'; |
15 | 15 | # need to include this as login code uses error_message |
@@ -27,11 +27,11 @@ |
||
27 | 27 | |
28 | 28 | $data['fb_login_url'] = $login->getLoginURL(); |
29 | 29 | if (isset($data['token'])) { |
30 | - $success = $login->loginUser($data['token']); |
|
31 | - if (!$success) { |
|
30 | + $success = $login->loginUser($data['token']); |
|
31 | + if (!$success) { |
|
32 | 32 | $data['error'] = 'Could not login using Facebook token'; |
33 | 33 | \MySociety\TheyWorkForYou\Renderer::output('login/facebook', $data); |
34 | - } |
|
34 | + } |
|
35 | 35 | } else { |
36 | 36 | \MySociety\TheyWorkForYou\Renderer::output('login/facebook', $data); |
37 | 37 | } |
@@ -33,15 +33,15 @@ discard block |
||
33 | 33 | ':email' => $email |
34 | 34 | )); |
35 | 35 | $out = ''; |
36 | - for ($i=0; $i<$q->rows(); ++$i) { |
|
36 | + for ($i = 0; $i < $q->rows(); ++$i) { |
|
37 | 37 | $row = $q->row($i); |
38 | - $criteria = explode(' ',$row['criteria']); |
|
38 | + $criteria = explode(' ', $row['criteria']); |
|
39 | 39 | $ccc = array(); |
40 | 40 | $current = true; |
41 | 41 | foreach ($criteria as $c) { |
42 | - if (preg_match('#^speaker:(\d+)#',$c,$m)) { |
|
42 | + if (preg_match('#^speaker:(\d+)#', $c, $m)) { |
|
43 | 43 | $MEMBER = new \MEMBER(array('person_id'=>$m[1])); |
44 | - $ccc[] = 'spoken by ' . $MEMBER->full_name(); |
|
44 | + $ccc[] = 'spoken by '.$MEMBER->full_name(); |
|
45 | 45 | if (!$MEMBER->current_member_anywhere()) { |
46 | 46 | $current = false; |
47 | 47 | } |
@@ -49,24 +49,24 @@ discard block |
||
49 | 49 | $ccc[] = $c; |
50 | 50 | } |
51 | 51 | } |
52 | - $criteria = join(' ',$ccc); |
|
53 | - $token = $row['alert_id'] . '-' . $row['registrationtoken']; |
|
52 | + $criteria = join(' ', $ccc); |
|
53 | + $token = $row['alert_id'].'-'.$row['registrationtoken']; |
|
54 | 54 | $action = '<form action="/alert/" method="post"><input type="hidden" name="t" value="'.$token.'">'; |
55 | 55 | if (!$row['confirmed']) { |
56 | 56 | $action .= '<input type="submit" name="action" value="Confirm">'; |
57 | - } elseif ($row['deleted']==2) { |
|
57 | + } elseif ($row['deleted'] == 2) { |
|
58 | 58 | $action .= '<input type="submit" name="action" value="Resume">'; |
59 | 59 | } else { |
60 | 60 | $action .= '<input type="submit" name="action" value="Suspend"> <input type="submit" name="action" value="Delete">'; |
61 | 61 | } |
62 | 62 | $action .= '</form>'; |
63 | - $out .= '<tr><td>' . $criteria . '</td><td align="center">' . $action . '</td></tr>'; |
|
63 | + $out .= '<tr><td>'.$criteria.'</td><td align="center">'.$action.'</td></tr>'; |
|
64 | 64 | if (!$current) { |
65 | 65 | $out .= '<tr><td colspan="2"><small> — <em>not a current member of any body covered by TheyWorkForYou</em></small></td></tr>'; |
66 | 66 | } |
67 | 67 | } |
68 | 68 | if ($out) { |
69 | - print '<table cellpadding="3" cellspacing="0"><tr><th>Criteria</th><th>Action</th></tr>' . $out . '</table>'; |
|
69 | + print '<table cellpadding="3" cellspacing="0"><tr><th>Criteria</th><th>Action</th></tr>'.$out.'</table>'; |
|
70 | 70 | } else { |
71 | 71 | print '<p>You currently have no email alerts set up. You can create alerts <a href="/alert/">here</a>.</p>'; |
72 | 72 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // And make sure the user is allowed to do this! |
33 | 33 | |
34 | 34 | $template = 'user/form'; |
35 | - if (is_numeric( get_http_var("u") ) && $THEUSER->is_able_to("edituser")) { |
|
35 | + if (is_numeric(get_http_var("u")) && $THEUSER->is_able_to("edituser")) { |
|
36 | 36 | |
37 | 37 | $data = $user->getUserDetails(get_http_var('u')); |
38 | 38 | $data['showall'] = true; |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * page so leave it like that for now. |
6 | 6 | */ |
7 | 7 | |
8 | -$new_style_template = TRUE; |
|
8 | +$new_style_template = true; |
|
9 | 9 | |
10 | 10 | include_once '../../includes/easyparliament/init.php'; |
11 | 11 | # need to include this as login code uses error_message |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $data['errors'] = $results['errors']; |
128 | 128 | $template = 'user/form'; |
129 | 129 | } else { |
130 | - $data['edited'] = True; |
|
130 | + $data['edited'] = true; |
|
131 | 131 | if (isset($results['email_changed'])) { |
132 | 132 | $data['email_changed'] = $results['email_changed']; |
133 | 133 | } |
@@ -105,10 +105,10 @@ |
||
105 | 105 | |
106 | 106 | // if data has been submitted then handle that |
107 | 107 | if ( |
108 | - get_http_var("submitted") == "true" && ( |
|
108 | + get_http_var("submitted") == "true" && ( |
|
109 | 109 | $this_page == 'useredit' || $this_page == 'otheruseredit' || $this_page == 'userjoin' |
110 | - ) |
|
111 | - ) { |
|
110 | + ) |
|
111 | + ) { |
|
112 | 112 | // Put all the user-submitted data in an array. |
113 | 113 | $data = $user->getUpdateDetails($this_page, $THEUSER->facebook_user); |
114 | 114 |
@@ -125,7 +125,7 @@ |
||
125 | 125 | <span class="label">Security status:</span> |
126 | 126 | <span class="formw"><select name="status"> |
127 | 127 | <?php |
128 | - foreach ($statuses as $n => $status_name) { ?> |
|
128 | + foreach ($statuses as $n => $status_name) { ?> |
|
129 | 129 | <option value="<?= $status_name ?>"<?= $status_name == $status ? ' selected' : '' ?>> |
130 | 130 | <?= $status_name ?> |
131 | 131 | </option> |
@@ -174,7 +174,7 @@ |
||
174 | 174 | |
175 | 175 | <input type="hidden" name="submitted" value="true"> |
176 | 176 | |
177 | - <?php if (isset($ret) && $ret != '' ) { ?> |
|
177 | + <?php if (isset($ret) && $ret != '') { ?> |
|
178 | 178 | <input type="hidden" name="ret" value="<?= _htmlentities($ret) ?>"> |
179 | 179 | <?php } ?> |
180 | 180 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | <input type="hidden" name="pg" value="edit"> |
35 | 35 | </form> |
36 | 36 | <?php } else { ?> |
37 | - <?php if (isset($showall) && $showall == True && isset($user_id)) { ?> |
|
37 | + <?php if (isset($showall) && $showall == true && isset($user_id)) { ?> |
|
38 | 38 | <h1>Edit the user’s details</h1> |
39 | 39 | <?php } else { ?> |
40 | 40 | <h1>Edit your details</h1> |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | <input type="radio" name="emailpublic" id="emailpublicfalse" value="false" <?= $emailpublic == 'No' ? ' checked' : '' ?>> <label for="emailpublicfalse">No</label></span> |
143 | 143 | </div> |
144 | 144 | |
145 | - <?php if (isset($showall) && $showall == True) { ?> |
|
145 | + <?php if (isset($showall) && $showall == true) { ?> |
|
146 | 146 | <?php if (isset($errors['status'])) { ?> |
147 | 147 | <p class="error"> |
148 | 148 | <?= $errors['status'] ?> |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | <input type="hidden" name="pg" value="<?= $pg ?>"> |
211 | 211 | <?php } ?> |
212 | 212 | |
213 | - <?php if (isset($showall) && $showall == True && isset($user_id)) { ?> |
|
213 | + <?php if (isset($showall) && $showall == true && isset($user_id)) { ?> |
|
214 | 214 | <input type="hidden" name="u" value="<?= _htmlentities($user_id) ?>"> |
215 | 215 | <?php } ?> |
216 | 216 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | <div class="row"> |
15 | 15 | <span class="label">Website</span> |
16 | - <span class="formw"><?= $website == '' ? 'none' : '<a href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span> |
|
16 | + <span class="formw"><?= $website == '' ? 'none' : '<a href="'._htmlentities($website).'">'._htmlentities($website).'</a>' ?></span> |
|
17 | 17 | </div> |
18 | 18 | |
19 | 19 | <div class="row"> |
@@ -12,7 +12,7 @@ |
||
12 | 12 | <h1>Your details</h1> |
13 | 13 | <?php if (isset($edited)) { ?> |
14 | 14 | <p> |
15 | - <strong>have been updated<?= isset($email_changed) && $email_changed == True ? " and we’ve sent a confirmation email to your new email address" : '' ?>.</strong> |
|
15 | + <strong>have been updated<?= isset($email_changed) && $email_changed == true ? " and we’ve sent a confirmation email to your new email address" : '' ?>.</strong> |
|
16 | 16 | </p> |
17 | 17 | <?php } else { ?> |
18 | 18 | <p> |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | <div class="row"> |
44 | 44 | <span class="label">Website</span> |
45 | - <span class="formw"><?= $website == '' ? 'none' : '<a href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span> |
|
45 | + <span class="formw"><?= $website == '' ? 'none' : '<a href="'._htmlentities($website).'">'._htmlentities($website).'</a>' ?></span> |
|
46 | 46 | </div> |
47 | 47 | |
48 | 48 | <?php if ($facebook_user) { ?> |