@@ -174,8 +174,7 @@ discard block |
||
174 | 174 | WHERE edit_id=" . $approval_id . ";"); |
175 | 175 | if (!$q->success()) { |
176 | 176 | break; |
177 | - } |
|
178 | - else { |
|
177 | + } else { |
|
179 | 178 | // Now send them an email telling them they've been approved |
180 | 179 | |
181 | 180 | |
@@ -216,8 +215,7 @@ discard block |
||
216 | 215 | WHERE edit_id=" . $decline_id . ";"); |
217 | 216 | if (!$q->success()) { |
218 | 217 | break; |
219 | - } |
|
220 | - else { |
|
218 | + } else { |
|
221 | 219 | // Scrub that one from the list of pending items |
222 | 220 | unset ($this->pending[$decline_id]); |
223 | 221 | } |
@@ -255,8 +253,7 @@ discard block |
||
255 | 253 | $this->update_pending_count(); |
256 | 254 | |
257 | 255 | return true; |
258 | - } |
|
259 | - else { |
|
256 | + } else { |
|
260 | 257 | return false; |
261 | 258 | } |
262 | 259 | } |
@@ -368,8 +365,7 @@ discard block |
||
368 | 365 | WHERE edit_id=" . $approval_id . ";"); |
369 | 366 | if (!$q->success()) { |
370 | 367 | break; |
371 | - } |
|
372 | - else { |
|
368 | + } else { |
|
373 | 369 | // Scrub that one from the list of pending items |
374 | 370 | unset ($this->pending[$approval_id]); |
375 | 371 | } |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | |
85 | 85 | if ($q->success()) { |
86 | 86 | // Set the object variables up. |
87 | - $this->editqueue_id = $q->insert_id(); |
|
87 | + $this->editqueue_id = $q->insert_id(); |
|
88 | 88 | $this->title = $data['title']; |
89 | 89 | $this->body = $data['body']; |
90 | - $this->posted = $data['posted']; |
|
90 | + $this->posted = $data['posted']; |
|
91 | 91 | |
92 | 92 | return $this->editqueue_id; |
93 | 93 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // the new epobject id and approval details. |
168 | 168 | $q = $this->db->query("UPDATE editqueue |
169 | 169 | SET |
170 | - epobject_id_l='" . $this->current_epobject_id. "', |
|
170 | + epobject_id_l='" . $this->current_epobject_id . "', |
|
171 | 171 | editor_id='" . addslashes($THEUSER->user_id()) . "', |
172 | 172 | approved='1', |
173 | 173 | decided='" . $timestamp . "' |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $q = $this->db->query("SELECT eq.edit_id, eq.user_id, u.firstname, u.lastname, eq.glossary_id, eq.title, eq.body, eq.submitted FROM editqueue AS eq, users AS u WHERE eq.user_id = u.user_id AND eq.approved IS NULL ORDER BY eq.submitted DESC;"); |
250 | 250 | if ($q->success() && $q->rows()) { |
251 | 251 | for ($i = 0; $i < ($q->rows()); $i++) { |
252 | - $this->pending[ $q->field($i,"edit_id") ] = $q->row($i); |
|
252 | + $this->pending[$q->field($i, "edit_id")] = $q->row($i); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | $this->update_pending_count(); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | // the new epobject id and approval details. |
362 | 362 | $q = $this->db->query("UPDATE editqueue |
363 | 363 | SET |
364 | - glossary_id='" . $this->current_epobject_id. "', |
|
364 | + glossary_id='" . $this->current_epobject_id . "', |
|
365 | 365 | editor_id='" . addslashes($THEUSER->user_id()) . "', |
366 | 366 | approved='1', |
367 | 367 | decided='" . $timestamp . "' |
@@ -107,19 +107,19 @@ discard block |
||
107 | 107 | if (isset($args['glossary_id']) && ($args['glossary_id'] != "")) { |
108 | 108 | $next = 0; $first_term = null; |
109 | 109 | foreach ($this->terms as $term) { |
110 | - if (!$first_term) $first_term = $term; |
|
110 | + if (!$first_term) { |
|
111 | + $first_term = $term; |
|
112 | + } |
|
111 | 113 | $last_term = $term; |
112 | 114 | if ($next == 1) { |
113 | 115 | $this->next_term = $term; |
114 | 116 | break; |
115 | - } |
|
116 | - elseif ($term['glossary_id'] == $args['glossary_id']) { |
|
117 | + } elseif ($term['glossary_id'] == $args['glossary_id']) { |
|
117 | 118 | $this->glossary_id = $args['glossary_id']; |
118 | 119 | $this->current_term = $term; |
119 | 120 | $next = 1; |
120 | 121 | |
121 | - } |
|
122 | - else { |
|
122 | + } else { |
|
123 | 123 | $this->previous_term = $term; |
124 | 124 | } |
125 | 125 | } |
@@ -134,8 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | |
136 | 136 | return ($this->num_terms); |
137 | - } |
|
138 | - else { |
|
137 | + } else { |
|
139 | 138 | return false; |
140 | 139 | } |
141 | 140 | } |
@@ -278,8 +277,9 @@ discard block |
||
278 | 277 | |
279 | 278 | // check for any glossary terms to replace |
280 | 279 | foreach ($this->replace_order as $glossary_id => $count) { |
281 | - if ($glossary_id == $this->glossary_id) |
|
282 | - continue; |
|
280 | + if ($glossary_id == $this->glossary_id) { |
|
281 | + continue; |
|
282 | + } |
|
283 | 283 | |
284 | 284 | $term_body = $this->terms[$glossary_id]['body']; |
285 | 285 | $term_title = $this->terms[$glossary_id]['title']; |
@@ -290,12 +290,10 @@ discard block |
||
290 | 290 | // catch glossary terms within their own definitions |
291 | 291 | if ($glossary_id == $this->glossary_id) { |
292 | 292 | $replacewords[] = "<strong>\\1</strong>"; |
293 | - } |
|
294 | - else { |
|
293 | + } else { |
|
295 | 294 | if ($this_page == "admin_glossary") { |
296 | 295 | $link_url = "#gl".$glossary_id; |
297 | - } |
|
298 | - else { |
|
296 | + } else { |
|
299 | 297 | $link_url = $URL->generate('url'); |
300 | 298 | } |
301 | 299 | $title = _htmlentities(trim_characters($term_body, 0, 80)); |
@@ -304,8 +302,9 @@ discard block |
||
304 | 302 | } |
305 | 303 | // Highlight all occurrences of another glossary term in the definition. |
306 | 304 | $body = preg_replace($findwords, $replacewords, $body, 1); |
307 | - if (isset($this->glossary_id)) |
|
308 | - $body = preg_replace("/(?<![>\.\'\/])\b(" . $this->terms[$this->glossary_id]['title'] . ")\b(?![<\'])/i", '<strong>\\1</strong>', $body, 1); |
|
305 | + if (isset($this->glossary_id)) { |
|
306 | + $body = preg_replace("/(?<![>\.\'\/])\b(" . $this->terms[$this->glossary_id]['title'] . ")\b(?![<\'])/i", '<strong>\\1</strong>', $body, 1); |
|
307 | + } |
|
309 | 308 | |
310 | 309 | // Replace any phrases in wikipedia |
311 | 310 | // TODO: Merge this code into above, so our gloss and wikipedia |
@@ -21,22 +21,22 @@ discard block |
||
21 | 21 | */ |
22 | 22 | |
23 | 23 | // This handles basic insertion and approval functions for all epobjects |
24 | -include_once INCLUDESPATH."easyparliament/editqueue.php"; |
|
25 | -include_once INCLUDESPATH."easyparliament/searchengine.php"; |
|
26 | -include_once INCLUDESPATH."url.php"; |
|
24 | +include_once INCLUDESPATH . "easyparliament/editqueue.php"; |
|
25 | +include_once INCLUDESPATH . "easyparliament/searchengine.php"; |
|
26 | +include_once INCLUDESPATH . "url.php"; |
|
27 | 27 | |
28 | 28 | class GLOSSARY { |
29 | 29 | |
30 | - public $num_terms; // how many glossary entries do we have |
|
30 | + public $num_terms; // how many glossary entries do we have |
|
31 | 31 | // (changes depending on how GLOSSARY is called |
32 | - public $hansard_count; // how many times does the phrase appear in hansard? |
|
33 | - public $query; // search term |
|
34 | - public $glossary_id; // if this is set then we only have 1 glossary term |
|
35 | - public $current_term; // will only be set if we have a valid epobject_id |
|
32 | + public $hansard_count; // how many times does the phrase appear in hansard? |
|
33 | + public $query; // search term |
|
34 | + public $glossary_id; // if this is set then we only have 1 glossary term |
|
35 | + public $current_term; // will only be set if we have a valid epobject_id |
|
36 | 36 | public $current_letter; |
37 | 37 | |
38 | 38 | // constructor... |
39 | - public function __construct($args=array()) { |
|
39 | + public function __construct($args = array()) { |
|
40 | 40 | // We can optionally start the glossary with one of several arguments |
41 | 41 | // 1. glossary_id - treat the glossary as a single term |
42 | 42 | // 2. glossary_term - search within glossary for a term |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | |
76 | 76 | // These stop stupid submissions. |
77 | 77 | // everything should be lowercase. |
78 | - $this->stopwords = array( "the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate" ); |
|
78 | + $this->stopwords = array("the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate"); |
|
79 | 79 | |
80 | 80 | } |
81 | 81 | |
82 | - public function get_glossary_item($args=array()) { |
|
82 | + public function get_glossary_item($args = array()) { |
|
83 | 83 | // Search for and fetch glossary item with title or glossary_id |
84 | 84 | // We could also search glossary text that contains the title text, for cross references |
85 | 85 | |
86 | 86 | $this->alphabet = array(); |
87 | - foreach (range ("A", "Z") as $letter) { |
|
87 | + foreach (range("A", "Z") as $letter) { |
|
88 | 88 | $this->alphabet[$letter] = array(); |
89 | 89 | } |
90 | 90 | |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | WHERE g.glossary_id=eq.glossary_id AND u.user_id=eq.user_id AND g.visible=1 AND eq.approved=1 |
94 | 94 | ORDER by g.title"); |
95 | 95 | if ($q->success() && $q->rows()) { |
96 | - for ($i=0; $i < $q->rows(); $i++) { |
|
97 | - $this->terms[ $q->field($i,"glossary_id") ] = $q->row($i); |
|
96 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
97 | + $this->terms[$q->field($i, "glossary_id")] = $q->row($i); |
|
98 | 98 | // Now add the epobject to the alphabet navigation. |
99 | - $first_letter = strtoupper(substr($q->field($i,"title"),0,1)); |
|
100 | - $this->alphabet[$first_letter][] = $q->field($i,"glossary_id"); |
|
99 | + $first_letter = strtoupper(substr($q->field($i, "title"), 0, 1)); |
|
100 | + $this->alphabet[$first_letter][] = $q->field($i, "glossary_id"); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $this->num_terms = $q->rows(); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
143 | - public function search_glossary($args=array()) { |
|
143 | + public function search_glossary($args = array()) { |
|
144 | 144 | // Search for and fetch glossary item with a title |
145 | 145 | // Useful for the search page, and nowhere else (so far) |
146 | 146 | |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | ORDER by g.title"; |
156 | 156 | $q = $this->db->query($query); |
157 | 157 | if ($q->success() && $q->rows()) { |
158 | - for ($i=0; $i < $q->rows(); $i++) { |
|
159 | - $this->search_matches[ $q->field($i,"glossary_id") ] = $q->row($i); |
|
158 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
159 | + $this->search_matches[$q->field($i, "glossary_id")] = $q->row($i); |
|
160 | 160 | } |
161 | 161 | $this->num_search_matches = $q->rows(); |
162 | 162 | } |
@@ -192,12 +192,12 @@ discard block |
||
192 | 192 | global $THEUSER; |
193 | 193 | |
194 | 194 | if ($data['title'] == '') { |
195 | - error ("Sorry, you can't define a term without a title"); |
|
195 | + error("Sorry, you can't define a term without a title"); |
|
196 | 196 | return false; |
197 | 197 | } |
198 | 198 | |
199 | 199 | if ($data['body'] == '') { |
200 | - error ("You haven't entered a definition!"); |
|
200 | + error("You haven't entered a definition!"); |
|
201 | 201 | return false; |
202 | 202 | } |
203 | 203 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | - public function glossarise($body, $tokenize=0, $urlize=0) { |
|
253 | + public function glossarise($body, $tokenize = 0, $urlize = 0) { |
|
254 | 254 | // Turn a body of text into a link-up wonderland of glossary joy |
255 | 255 | |
256 | 256 | global $this_page; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | } |
294 | 294 | else { |
295 | 295 | if ($this_page == "admin_glossary") { |
296 | - $link_url = "#gl".$glossary_id; |
|
296 | + $link_url = "#gl" . $glossary_id; |
|
297 | 297 | } |
298 | 298 | else { |
299 | 299 | $link_url = $URL->generate('url'); |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | <p><?= $error ?></p> |
8 | 8 | |
9 | - <?php if ( $rep_search_url ) { ?> |
|
9 | + <?php if ($rep_search_url) { ?> |
|
10 | 10 | </div> |
11 | 11 | |
12 | 12 | <div class="full-page__unit"> |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | <?php foreach ($segment['votes']->positions as $key_vote) { |
61 | 61 | |
62 | 62 | if (isset($policy_last_update[$key_vote['policy_id']]) && $policy_last_update[$key_vote['policy_id']] > $most_recent) { |
63 | - $most_recent = $policy_last_update[$key_vote['policy_id']]; |
|
63 | + $most_recent = $policy_last_update[$key_vote['policy_id']]; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ( $key_vote['has_strong'] || $key_vote['position'] == 'has never voted on' ) { |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | include '_vote_description.php'; |
83 | 83 | |
84 | - } ?> |
|
84 | + } ?> |
|
85 | 85 | </ul> |
86 | 86 | |
87 | 87 | <div class="share-vote-descriptions"> |
@@ -110,13 +110,16 @@ |
||
110 | 110 | |
111 | 111 | <?php endif; ?> |
112 | 112 | |
113 | - <?php else: ?> |
|
113 | + <?php else { |
|
114 | + : ?> |
|
114 | 115 | |
115 | 116 | <div class="panel"> |
116 | 117 | <p>This person has not voted on any of the key issues which we keep track of.</p> |
117 | 118 | </div> |
118 | 119 | |
119 | - <?php endif; ?> |
|
120 | + <?php endif; |
|
121 | +} |
|
122 | +?> |
|
120 | 123 | |
121 | 124 | <?php endif; ?> |
122 | 125 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | <?php if ($has_voting_record): ?> |
44 | 44 | |
45 | - <?php $displayed_votes = FALSE; ?> |
|
45 | + <?php $displayed_votes = false; ?> |
|
46 | 46 | |
47 | 47 | <?php foreach ($key_votes_segments as $segment): ?> |
48 | 48 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | <small>Last updated: <?= format_date($most_recent, LONGDATEFORMAT) ?></small> |
95 | 95 | </div> |
96 | 96 | |
97 | - <?php $displayed_votes = TRUE; ?> |
|
97 | + <?php $displayed_votes = true; ?> |
|
98 | 98 | |
99 | 99 | <?php endif; ?> |
100 | 100 |
@@ -63,7 +63,7 @@ |
||
63 | 63 | $most_recent = $policy_last_update[$key_vote['policy_id']]; |
64 | 64 | } |
65 | 65 | |
66 | - if ( $key_vote['has_strong'] || $key_vote['position'] == 'has never voted on' ) { |
|
66 | + if ($key_vote['has_strong'] || $key_vote['position'] == 'has never voted on') { |
|
67 | 67 | $description = ucfirst($key_vote['desc']); |
68 | 68 | } else { |
69 | 69 | $description = sprintf( |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | if ( isset($divisions) && $divisions ) { |
39 | 39 | if ($has_voting_record) { |
40 | 40 | foreach ($divisions as $division) { |
41 | - $displayed_votes = TRUE; |
|
41 | + $displayed_votes = TRUE; |
|
42 | 42 | |
43 | - if ($current_date != $division['date']) { |
|
43 | + if ($current_date != $division['date']) { |
|
44 | 44 | if ($current_date != '' ) { |
45 | - print('</ul></div>'); |
|
45 | + print('</ul></div>'); |
|
46 | 46 | } |
47 | 47 | $current_date = $division['date']; |
48 | 48 | $sidebar_links[] = $division['date']; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | <h2><?= strftime('%e %b %Y', strtotime($division['date'])) ?></h2> |
52 | 52 | <ul class="vote-descriptions policy-votes"> |
53 | 53 | <?php } |
54 | - include('_division_description.php'); |
|
54 | + include('_division_description.php'); |
|
55 | 55 | } |
56 | 56 | echo('</div>'); |
57 | 57 | } |
@@ -30,15 +30,15 @@ |
||
30 | 30 | |
31 | 31 | <?php |
32 | 32 | |
33 | - $displayed_votes = FALSE; |
|
34 | - $show_all = TRUE; |
|
33 | + $displayed_votes = false; |
|
34 | + $show_all = true; |
|
35 | 35 | $current_date = ''; |
36 | 36 | $sidebar_links = array(); |
37 | 37 | |
38 | 38 | if ( isset($divisions) && $divisions ) { |
39 | 39 | if ($has_voting_record) { |
40 | 40 | foreach ($divisions as $division) { |
41 | - $displayed_votes = TRUE; |
|
41 | + $displayed_votes = true; |
|
42 | 42 | |
43 | 43 | if ($current_date != $division['date']) { |
44 | 44 | if ($current_date != '' ) { |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | $current_date = ''; |
36 | 36 | $sidebar_links = array(); |
37 | 37 | |
38 | - if ( isset($divisions) && $divisions ) { |
|
38 | + if (isset($divisions) && $divisions) { |
|
39 | 39 | if ($has_voting_record) { |
40 | 40 | foreach ($divisions as $division) { |
41 | 41 | $displayed_votes = TRUE; |
42 | 42 | |
43 | 43 | if ($current_date != $division['date']) { |
44 | - if ($current_date != '' ) { |
|
44 | + if ($current_date != '') { |
|
45 | 45 | print('</ul></div>'); |
46 | 46 | } |
47 | 47 | $current_date = $division['date']; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | <div class="sidebar__unit in-page-nav"> |
69 | 69 | <ul data-magellan-expedition="fixed"> |
70 | - <?php foreach($sidebar_links as $date) { ?> |
|
70 | + <?php foreach ($sidebar_links as $date) { ?> |
|
71 | 71 | <li data-magellan-arrival="<?= strftime('%Y-%m-%d', strtotime($date)) ?>"> |
72 | 72 | <a href="#<?= strftime('%Y-%m-%d', strtotime($date)) ?>"> |
73 | 73 | <?= strftime('%e %b %Y', strtotime($date)) ?> |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | include '_vote_description.php'; |
81 | 81 | |
82 | - } ?> |
|
82 | + } ?> |
|
83 | 83 | </ul> |
84 | 84 | |
85 | 85 | <p>We have <b>lots more</b> plain English analysis of <?= $full_name ?>’s voting record on issues like health, welfare, taxation and more. Visit <a href="<?= $member_url ?>/votes"><?= $full_name ?>’s full vote analysis page</a> for more.</p> |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | include '_vote_description.php'; |
121 | 121 | |
122 | - } ?> |
|
122 | + } ?> |
|
123 | 123 | </ul> |
124 | 124 | |
125 | 125 | <p>We have <b>lots more</b> plain English analysis of <?= $full_name ?>’s voting record on issues like health, welfare, taxation and more. Visit <a href="<?= $member_url ?>/votes"><?= $full_name ?>’s full vote analysis page</a> for more.</p> |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | include '_vote_description.php'; |
150 | 150 | |
151 | - } ?> |
|
151 | + } ?> |
|
152 | 152 | </ul> |
153 | 153 | |
154 | 154 | <p>We have <b>lots more</b> plain English analysis of <?= $full_name ?>’s voting record on issues like health, welfare, taxation and more. Visit <a href="<?= $member_url ?>/votes"><?= $full_name ?>’s full vote analysis page</a> for more.</p> |
@@ -190,11 +190,14 @@ |
||
190 | 190 | <?= $recent_appearances['additional_links'] ?> |
191 | 191 | <?php endif; ?> |
192 | 192 | |
193 | - <?php else: ?> |
|
193 | + <?php else { |
|
194 | + : ?> |
|
194 | 195 | |
195 | 196 | <p>No recent appearances to display.</p> |
196 | 197 | |
197 | - <?php endif; ?> |
|
198 | + <?php endif; |
|
199 | +} |
|
200 | +?> |
|
198 | 201 | |
199 | 202 | </div> |
200 | 203 | <?php endif; ?> |
@@ -105,7 +105,7 @@ |
||
105 | 105 | <ul class="vote-descriptions"> |
106 | 106 | <?php foreach ($sorted_diffs as $policy_id => $score) { |
107 | 107 | |
108 | - $key_vote = NULL; |
|
108 | + $key_vote = null; |
|
109 | 109 | $description = sprintf( |
110 | 110 | '%s <b>%s</b> %s, while most %s MPs <b>%s</b>.', |
111 | 111 | $full_name, |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | </div> |
59 | 59 | <?php endif; ?> |
60 | 60 | |
61 | - <?php if ( !$current_member[HOUSE_TYPE_COMMONS] ) { ?> |
|
61 | + <?php if (!$current_member[HOUSE_TYPE_COMMONS]) { ?> |
|
62 | 62 | <?php if (count($policyPositions->positions) > 0) { ?> |
63 | 63 | <div class="panel"> |
64 | 64 | <a name="votes"></a> |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | <p>We have <b>lots more</b> plain English analysis of <?= $full_name ?>’s voting record on issues like health, welfare, taxation and more. Visit <a href="<?= $member_url ?>/votes"><?= $full_name ?>’s full vote analysis page</a> for more.</p> |
126 | 126 | |
127 | - <?php elseif (count($policyPositions->positions) > 0 ): ?> |
|
127 | + <?php elseif (count($policyPositions->positions) > 0): ?> |
|
128 | 128 | <?php if (count($party_positions) && $party_member_count > 1) { ?> |
129 | 129 | <p> |
130 | 130 | <?= $full_name ?> is a <?= $party ?> MP, and on the <b>vast majority</b> of issues votes the <b>same way</b> as other <?= $party ?> MPs. |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | </ul> |
153 | 153 | |
154 | 154 | <p>We have <b>lots more</b> plain English analysis of <?= $full_name ?>’s voting record on issues like health, welfare, taxation and more. Visit <a href="<?= $member_url ?>/votes"><?= $full_name ?>’s full vote analysis page</a> for more.</p> |
155 | - <?php elseif (count($policyPositions->positions) == 0 ): ?> |
|
155 | + <?php elseif (count($policyPositions->positions) == 0): ?> |
|
156 | 156 | |
157 | 157 | <p>No votes to display.</p> |
158 | 158 |
@@ -27,7 +27,8 @@ discard block |
||
27 | 27 | <?php } ?> |
28 | 28 | </div> |
29 | 29 | <?php } ?> |
30 | - <?php else: ?> |
|
30 | + <?php else { |
|
31 | + : ?> |
|
31 | 32 | <div class="person-data-attribution"> |
32 | 33 | We’re missing a photo of <?= $full_name ?>. If you have a |
33 | 34 | photo <em>that you can release under a Creative Commons Attribution-ShareAlike |
@@ -36,7 +37,9 @@ discard block |
||
36 | 37 | Please do not email us about copyrighted photos elsewhere on the internet; we can’t |
37 | 38 | use them. |
38 | 39 | </div> |
39 | - <?php endif; ?> |
|
40 | + <?php endif; |
|
41 | +} |
|
42 | +?> |
|
40 | 43 | <div class="person-constituency"> |
41 | 44 | <?php if ( $constituency && $this_page != 'peer' && $this_page != 'royal' ) { ?> |
42 | 45 | <span class="constituency"><?= $constituency ?></span> |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <div class="regional-header regional-header--<?= $current_assembly ?>"> |
2 | 2 | <div class="regional-header__overlay"></div> |
3 | - <div class="person-header <?= $this_page ?> <?= (isset($data['photo_attribution_text'])?'has-data-attribution':'') ?>"> |
|
3 | + <div class="person-header <?= $this_page ?> <?= (isset($data['photo_attribution_text']) ? 'has-data-attribution' : '') ?>"> |
|
4 | 4 | <div class="full-page__row"> |
5 | 5 | <div class="full-page__unit"> |
6 | 6 | <div class="person-header__content"> |
7 | 7 | <div class="person-name"> |
8 | - <?php if ( $image ) { ?> |
|
8 | + <?php if ($image) { ?> |
|
9 | 9 | <div class="mp-image"> |
10 | 10 | <img src="<?= $image['url'] ?>" height="48"> |
11 | 11 | </div> |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | <?php } ?> |
18 | 18 | </div> |
19 | 19 | </div> |
20 | - <?php if($image && $image['exists']): ?> |
|
21 | - <?php if(isset($data['photo_attribution_text'])) { ?> |
|
20 | + <?php if ($image && $image['exists']): ?> |
|
21 | + <?php if (isset($data['photo_attribution_text'])) { ?> |
|
22 | 22 | <div class="person-data-attribution"> |
23 | - <?php if(isset($data['photo_attribution_link'])) { ?> |
|
23 | + <?php if (isset($data['photo_attribution_link'])) { ?> |
|
24 | 24 | Profile photo: <a href="<?= $data['photo_attribution_link'] ?>"><?= $data['photo_attribution_text'] ?></a> |
25 | 25 | <?php } else { ?> |
26 | 26 | Profile photo: <?= $data['photo_attribution_text'] ?> |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | </div> |
39 | 39 | <?php endif; ?> |
40 | 40 | <div class="person-constituency"> |
41 | - <?php if ( $constituency && $this_page != 'peer' && $this_page != 'royal' ) { ?> |
|
41 | + <?php if ($constituency && $this_page != 'peer' && $this_page != 'royal') { ?> |
|
42 | 42 | <span class="constituency"><?= $constituency ?></span> |
43 | 43 | <?php } ?> |
44 | - <?php if ( $party ) { ?> |
|
44 | + <?php if ($party) { ?> |
|
45 | 45 | <span class="party <?= $party_short ?>"><?= $party ?></span> |
46 | 46 | <?php } ?> |
47 | 47 | </div> |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <li> |
2 | 2 | <?= $description ?> |
3 | - <?php if ( $show_link ) { ?> |
|
3 | + <?php if ($show_link) { ?> |
|
4 | 4 | <a class="vote-description__source" href="<?= $link ?>">Show votes</a> |
5 | 5 | <?php if (isset($key_vote)) { ?> |
6 | 6 | <a class="vote-description__evidence" href="<?= $link ?>"><?= $key_vote['summary'] ?></a> |
@@ -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); |