@@ -87,7 +87,7 @@ |
||
87 | 87 | $group_name = $policies->getSetDescriptions()[$set_slug]; |
88 | 88 | $group_slug = $set_slug; |
89 | 89 | $comparison_period_slug = $period_slug; |
90 | - $policy_pairs = array_filter($pairs, function ($pair) use ($policy_ids) { |
|
90 | + $policy_pairs = array_filter($pairs, function($pair) use ($policy_ids) { |
|
91 | 91 | $is_policy_valid = in_array($pair->getPolicyID(), $policy_ids); |
92 | 92 | $has_own_distribution = $pair->member_distribution !== null && !$pair->member_distribution->noDataAvailable(); |
93 | 93 | return $is_policy_valid && $has_own_distribution; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | |
110 | 110 | private function getMemberFromPersonId($person_id) { |
111 | - return new MySociety\TheyWorkForYou\Member([ "person_id" => $person_id ]); |
|
111 | + return new MySociety\TheyWorkForYou\Member(["person_id" => $person_id]); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | public function testMPPartyPolicyTextWhenDiffersVotes() { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // this is a single person party i think - so no party comparison? |
138 | 138 | // need to check what votes would actually produce |
139 | 139 | |
140 | - $page = $this->fetch_page(['pid' => 4, 'pagetype' => 'votes','url' => '/mp/4/test_mp_d/test_westminster_constituency/votes']); |
|
140 | + $page = $this->fetch_page(['pid' => 4, 'pagetype' => 'votes', 'url' => '/mp/4/test_mp_d/test_westminster_constituency/votes']); |
|
141 | 141 | $this->assertStringContainsString('Test MP D', $page); |
142 | 142 | $this->assertStringContainsString('<li class="vote-description"', $page); |
143 | 143 | $this->assertStringNotContainsString('comparable B Party MPs voted', $page); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | // this is just a boring, person aligned with party example |
150 | 150 | |
151 | - $page = $this->fetch_page(['pagetype' => 'votes', 'pid' => 16, 'url' => '/mp/16/test_mp_g_party_2/test_westminster_constituency/votes']); |
|
151 | + $page = $this->fetch_page(['pagetype' => 'votes', 'pid' => 16, 'url' => '/mp/16/test_mp_g_party_2/test_westminster_constituency/votes']); |
|
152 | 152 | $this->assertStringContainsString('Test MP G Party 2', $page); |
153 | 153 | |
154 | 154 | $this->assertStringNotContainsString('sometimes differs from their party colleagues', $page); |
@@ -114,7 +114,10 @@ |
||
114 | 114 | <ul> |
115 | 115 | <li><span class="appg-property-label">Purpose:</span> <?= $membership->appg->purpose ?></li> |
116 | 116 | <li><span class="appg-property-label">Membership Source:</span> <a href="<?= $membership->membership_source_url ?>">Source</a></li> |
117 | - <li><span class="appg-property-label">APPG Website:</span> <?php if ($membership->appg->website): ?><a href="<?= $membership->appg->website ?>"><?= $membership->appg->website ?></a><?php else: ?>N/A<?php endif; ?></li> |
|
117 | + <li><span class="appg-property-label">APPG Website:</span> <?php if ($membership->appg->website): ?><a href="<?= $membership->appg->website ?>"><?= $membership->appg->website ?></a><?php else { |
|
118 | + : ?>N/A<?php endif; |
|
119 | +} |
|
120 | +?></li> |
|
118 | 121 | <li><span class="appg-property-label">APPG register:</span> <a href="<?= $membership->appg->source_url ?>">Parliament website</a></li> |
119 | 122 | </ul> |
120 | 123 | </div> |
@@ -14,7 +14,7 @@ |
||
14 | 14 | </div> |
15 | 15 | <?php endif; ?> |
16 | 16 | |
17 | - <?php $vote_count = isset($divisions) ? count($divisions) : 0;?> |
|
17 | + <?php $vote_count = isset($divisions) ? count($divisions) : 0; ?> |
|
18 | 18 | |
19 | 19 | <div class="panel"> |
20 | 20 | <div class="policy-votes-intro"> |
@@ -12,11 +12,14 @@ |
||
12 | 12 | <?php $detail = $upper_detail; ?> |
13 | 13 | </ul> |
14 | 14 | </li> |
15 | -<?php else : ?> |
|
15 | +<?php else { |
|
16 | + : ?> |
|
16 | 17 | <li class="interest-detail"> |
17 | 18 | <?php if ($detail->has_value()): ?> |
18 | 19 | <span class="interest-detail-name"><?= $detail->display_as ?>: </span> |
19 | 20 | <span class="interest-detail-value"><?= htmlspecialchars($detail->value) ?></span> |
20 | - <?php endif; ?> |
|
21 | + <?php endif; |
|
22 | +} |
|
23 | +?> |
|
21 | 24 | </li> |
22 | 25 | <?php endif; ?> |
23 | 26 | \ No newline at end of file |
@@ -21,12 +21,12 @@ |
||
21 | 21 | <p>It seems we already have <?= ngettext('a definition', 'some definitions', $glossary->num_search_matches) ?> for that. Would you care to see <?= ngettext('it', 'them', $glossary->num_search_matches) ?>?</p> |
22 | 22 | <ul class="glossary"> |
23 | 23 | <?php |
24 | - foreach ($glossary->search_matches as $match) { |
|
25 | - $URL = new \MySociety\TheyWorkForYou\Url('glossary'); |
|
26 | - $URL->insert(['gl' => $match['glossary_id']]); |
|
27 | - $URL->remove(['g']); |
|
28 | - $term_link = $URL->generate('url'); |
|
29 | - ?> |
|
24 | + foreach ($glossary->search_matches as $match) { |
|
25 | + $URL = new \MySociety\TheyWorkForYou\Url('glossary'); |
|
26 | + $URL->insert(['gl' => $match['glossary_id']]); |
|
27 | + $URL->remove(['g']); |
|
28 | + $term_link = $URL->generate('url'); |
|
29 | + ?> |
|
30 | 30 | <li> |
31 | 31 | <a href="<?= $term_link ?>"><?= $match['title']?></a> |
32 | 32 | </li> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | */ |
68 | 68 | |
69 | -$page = [ |
|
69 | +$page = [ |
|
70 | 70 | |
71 | 71 | // Things used on EVERY page, unless overridden for a page: |
72 | 72 | 'default' => [ |
@@ -498,24 +498,24 @@ discard block |
||
498 | 498 | 'url' => 'glossary/', |
499 | 499 | ], |
500 | 500 | 'glossary_addterm' => [ |
501 | - 'menu' => array ( |
|
501 | + 'menu' => array( |
|
502 | 502 | 'text' => 'Add a term', |
503 | 503 | 'title' => "Add a definition for a term to the glossary" |
504 | 504 | ), |
505 | 505 | 'parent' => 'help_us_out', |
506 | 506 | 'title' => 'Add a glossary item', |
507 | 507 | 'url' => 'addterm/', |
508 | - 'session_vars' => array ('g') |
|
508 | + 'session_vars' => array('g') |
|
509 | 509 | ], |
510 | 510 | 'glossary_addlink' => [ |
511 | - 'menu' => array ( |
|
511 | + 'menu' => array( |
|
512 | 512 | 'text' => 'Add a link', |
513 | 513 | 'title' => "Add an external link" |
514 | 514 | ), |
515 | 515 | 'parent' => 'help_us_out', |
516 | 516 | 'title' => 'Add a link', |
517 | 517 | 'url' => 'addlink/', |
518 | - 'session_vars' => array ('g') |
|
518 | + 'session_vars' => array('g') |
|
519 | 519 | ], |
520 | 520 | 'glossary_item' => [ |
521 | 521 | 'heading' => 'Glossary heading', |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | // The text displayed on the page itself will also be this, |
1362 | 1362 | // UNLESS the section has a 'heading', in which case that's used instead. |
1363 | 1363 | |
1364 | -$section = [ |
|
1364 | +$section = [ |
|
1365 | 1365 | |
1366 | 1366 | |
1367 | 1367 | 'about' => [ |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | include_once INCLUDESPATH . "easyparliament/searchengine.php"; |
25 | 25 | |
26 | 26 | class GLOSSARY { |
27 | - public $num_terms; // how many glossary entries do we have |
|
27 | + public $num_terms; // how many glossary entries do we have |
|
28 | 28 | // (changes depending on how GLOSSARY is called |
29 | - public $hansard_count; // how many times does the phrase appear in hansard? |
|
30 | - public $query; // search term |
|
31 | - public $glossary_id; // if this is set then we only have 1 glossary term |
|
32 | - public $current_term; // will only be set if we have a valid epobject_id |
|
29 | + public $hansard_count; // how many times does the phrase appear in hansard? |
|
30 | + public $query; // search term |
|
31 | + public $glossary_id; // if this is set then we only have 1 glossary term |
|
32 | + public $current_term; // will only be set if we have a valid epobject_id |
|
33 | 33 | public $current_letter; |
34 | 34 | |
35 | 35 | // constructor... |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | // These stop stupid submissions. |
74 | 74 | // everything should be lowercase. |
75 | - $this->stopwords = [ "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" ]; |
|
75 | + $this->stopwords = ["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"]; |
|
76 | 76 | |
77 | 77 | } |
78 | 78 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | global $THEUSER; |
190 | 190 | |
191 | 191 | if (!$THEUSER->is_able_to('addterm')) { |
192 | - error ("Sorry, you are not allowed to add Glossary terms."); |
|
192 | + error("Sorry, you are not allowed to add Glossary terms."); |
|
193 | 193 | return false; |
194 | 194 | } |
195 | 195 |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once INCLUDESPATH."easyparliament/glossary.php"; |
|
5 | -include_once INCLUDESPATH."easyparliament/glossarylist.php"; |
|
4 | +include_once INCLUDESPATH . "easyparliament/glossary.php"; |
|
5 | +include_once INCLUDESPATH . "easyparliament/glossarylist.php"; |
|
6 | 6 | |
7 | 7 | $this_page = "glossary_addlink"; |
8 | 8 | |
9 | -$args = array( 'action' => $this_page); |
|
9 | +$args = array('action' => $this_page); |
|
10 | 10 | |
11 | 11 | // First things first... |
12 | 12 | |
13 | -if ((get_http_var('g') != '') && (get_http_var('previewterm') == '') ) { |
|
13 | +if ((get_http_var('g') != '') && (get_http_var('previewterm') == '')) { |
|
14 | 14 | // We're searching for something. |
15 | 15 | $args['s'] = filter_user_input(get_http_var('g'), 'strict'); |
16 | 16 | $GLOSSARY = new GLOSSARY($args); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | $PAGE->stripe_start(); |
27 | 27 | |
28 | -$data = array ( |
|
28 | +$data = array( |
|
29 | 29 | 'title' => get_http_var('g'), |
30 | 30 | 'body' => get_http_var('definition') |
31 | 31 | ); |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | |
116 | 116 | $PAGE->glossary_atoz($GLOSSARY); |
117 | 117 | |
118 | - $PAGE->stripe_end(array ( |
|
119 | - array ( |
|
118 | + $PAGE->stripe_end(array( |
|
119 | + array( |
|
120 | 120 | 'type' => 'include', |
121 | 121 | 'content' => 'glossary_add' |
122 | 122 | ) |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | // We're searching for something. |
15 | 15 | $args['s'] = filter_user_input(get_http_var('g'), 'strict'); |
16 | 16 | $GLOSSARY = new GLOSSARY($args); |
17 | -} |
|
18 | -else { |
|
17 | +} else { |
|
19 | 18 | $args['sort'] = "regexp_replace"; |
20 | 19 | $GLOSSARY = new GLOSSARY($args); |
21 | 20 | $args['s'] = filter_user_input(get_http_var('g'), 'strict'); |
@@ -86,13 +85,11 @@ discard block |
||
86 | 85 | if ($args['count']) { |
87 | 86 | // Display the Add definition form |
88 | 87 | $PAGE->glossary_add_link_form($args); |
89 | - } |
|
90 | - else { |
|
88 | + } else { |
|
91 | 89 | print "<h4>No dice!</h4><p>Much as we'd love you to add a definition for <strong></strong>, it doesn't seem to appear in hansard at all...</p>"; |
92 | 90 | $PAGE->glossary_links(); |
93 | 91 | } |
94 | - } |
|
95 | - else { |
|
92 | + } else { |
|
96 | 93 | print "<h4>Humdinger!</h4><p>it would appear that you aren't allowed to add glossary terms. How odd...</p>"; |
97 | 94 | $PAGE->glossary_links(); |
98 | 95 | } |