Completed
Pull Request — master (#965)
by Nick
05:26
created
www/includes/easyparliament/templates/html/search/results.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <div class="full-page">
2
-    <div class="full-page__row search-page <?php if ( !$searchstring ) { ?>search-page--blank<?php } ?>">
2
+    <div class="full-page__row search-page <?php if (!$searchstring) { ?>search-page--blank<?php } ?>">
3 3
 
4 4
         <form class="js-search-form-without-options">
5 5
             <?php include 'form_main.php'; ?>
6 6
         </form>
7 7
 
8
-      <?php if ( $searchstring && !isset($warnings) ) { ?>
8
+      <?php if ($searchstring && !isset($warnings)) { ?>
9 9
         <div class="search-page__section search-page__section--results">
10 10
             <div class="search-page__section__primary">
11
-              <?php if ( $cons ) { ?>
12
-                <?php if ( count($cons) > 1 ) {
11
+              <?php if ($cons) { ?>
12
+                <?php if (count($cons) > 1) {
13 13
                     $types = array();
14
-                    if ( $mp_types['mp'] > 0 ) {
14
+                    if ($mp_types['mp'] > 0) {
15 15
                         $types[] = 'MPs';
16 16
                     }
17
-                    if ( $mp_types['former'] > 0 ) {
17
+                    if ($mp_types['former'] > 0) {
18 18
                         $types[] = 'former MPs';
19 19
                     }
20 20
                     $desc = ucfirst(implode(' and ', $types));
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
                 <?php } else { // count($cons) <= 1 ?>
24 24
                   <h2><?= $mp_types['former'] ? 'Former ' : '' ?>MP for <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2>
25 25
                 <?php } ?>
26
-                <?php foreach ( $cons as $member ) { ?>
26
+                <?php foreach ($cons as $member) { ?>
27 27
                   <?php include('person.php'); ?>
28 28
                 <?php } ?>
29 29
               <?php } ?>
30 30
 
31
-              <?php if ( $members ) { ?>
31
+              <?php if ($members) { ?>
32 32
                 <h2>People matching <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2>
33
-                <?php foreach ( $members as $member ) { ?>
33
+                <?php foreach ($members as $member) { ?>
34 34
                     <?php include('person.php'); ?>
35 35
                 <?php } ?>
36 36
                 <hr>
@@ -38,25 +38,25 @@  discard block
 block discarded – undo
38 38
 
39 39
               <?php if ($glossary) { ?>
40 40
                 <h2>Glossary items matching <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2>
41
-                <?php foreach ( $glossary as $item ) { ?>
41
+                <?php foreach ($glossary as $item) { ?>
42 42
                     <?php include('glossary.php'); ?>
43 43
                 <?php } ?>
44 44
                 <hr>
45 45
               <?php } ?>
46 46
 
47
-              <?php if ( isset($pid) && $wtt == 2 ) { ?>
47
+              <?php if (isset($pid) && $wtt == 2) { ?>
48 48
                 <p>I want to <a href="https://www.writetothem.com/lords/?pid=<?= $pid ?>">write to <?= $wtt_lord_name ?></a></p>
49 49
               <?php } ?>
50 50
 
51
-              <?php if ( isset($error) ) { ?>
51
+              <?php if (isset($error)) { ?>
52 52
                 There was an error &ndash; <?= $error ?> &ndash; searching for <em class="current-search-term"><?= _htmlentities($searchstring) ?></em>.
53 53
               <?php } else { ?>
54 54
                 <h2>
55
-                  <?php if ( $pagination_links ) { ?>
55
+                  <?php if ($pagination_links) { ?>
56 56
                     Results <?= $pagination_links['first_result'] ?>&ndash;<?= $pagination_links['last_result'] ?> of <?= $info['total_results'] ?>
57
-                  <?php } else if ( $info['total_results'] == 1 ) { ?>
57
+                  <?php } else if ($info['total_results'] == 1) { ?>
58 58
                     The only result
59
-                  <?php } else if ( $info['total_results'] == 0 ) { ?>
59
+                  <?php } else if ($info['total_results'] == 0) { ?>
60 60
                     There were no results
61 61
                   <?php } else { ?>
62 62
                     All <?= $info['total_results'] ?> results
@@ -64,16 +64,16 @@  discard block
 block discarded – undo
64 64
                     for <em class="current-search-term"><?= _htmlentities($searchdescription) ?></em>
65 65
                 </h2>
66 66
 
67
-                  <?php if ( $info['spelling_correction'] ) { ?>
68
-                    <p>Did you mean <a href="/search/?q=<?= urlencode($info['spelling_correction']) ?>"><?= _htmlentities( $info['spelling_correction_display'] ) ?></a>?</p>
67
+                  <?php if ($info['spelling_correction']) { ?>
68
+                    <p>Did you mean <a href="/search/?q=<?= urlencode($info['spelling_correction']) ?>"><?= _htmlentities($info['spelling_correction_display']) ?></a>?</p>
69 69
                   <?php } ?>
70 70
 
71
-                  <?php if ( $info['total_results'] ) { ?>
71
+                  <?php if ($info['total_results']) { ?>
72 72
                     <ul class="search-result-display-options">
73
-                      <?php if ( $sort_order == 'relevance' ) { ?>
73
+                      <?php if ($sort_order == 'relevance') { ?>
74 74
                         <li>Sorted by relevance</li>
75 75
                         <li>Sort by date: <a href="<?= $urls['newest'] ?>">newest</a> / <a href="<?= $urls['oldest'] ?>">oldest</a></li>
76
-                      <?php } else if ( $sort_order == 'oldest' ) { ?>
76
+                      <?php } else if ($sort_order == 'oldest') { ?>
77 77
                         <li>Sort by <a href="<?= $urls['relevance'] ?>">relevance</a></li>
78 78
                         <li>Sorted by date: <a href="<?= $urls['newest'] ?>">newest</a> / oldest</li>
79 79
                       <?php } else { ?>
@@ -84,25 +84,25 @@  discard block
 block discarded – undo
84 84
                     </ul>
85 85
                   <?php } ?>
86 86
 
87
-                  <?php foreach ( $rows as $result ) { ?>
87
+                  <?php foreach ($rows as $result) { ?>
88 88
                     <div class="search-result search-result--generic">
89 89
                         <h3 class="search-result__title"><a href="<?= $result['listurl'] ?>"><?= $result['parent']['body'] ?></a> (<?= format_date($result['hdate'], SHORTDATEFORMAT) ?>)</h3>
90
-                        <p class="search-result__description"><?= isset($result['speaker']) ? $result['speaker']['name'] . ': ' : '' ?><?= $result['extract'] ?></p>
90
+                        <p class="search-result__description"><?= isset($result['speaker']) ? $result['speaker']['name'].': ' : '' ?><?= $result['extract'] ?></p>
91 91
                     </div>
92 92
                   <?php } ?>
93 93
 
94 94
                 <hr>
95 95
 
96
-                  <?php if ( $pagination_links ) { ?>
96
+                  <?php if ($pagination_links) { ?>
97 97
                     <div class="search-result-pagination">
98
-                      <?php if ( isset($pagination_links['prev']) ) { ?>
98
+                      <?php if (isset($pagination_links['prev'])) { ?>
99 99
                         <a href="<?= $pagination_links['firstpage']['url'] ?>" title="First page">&lt;&lt;</a>
100 100
                         <a href="<?= $pagination_links['prev']['url'] ?>" title="Previous page">&lt;</a>
101 101
                       <?php } ?>
102
-                      <?php foreach ( $pagination_links['nums'] as $link ) { ?>
102
+                      <?php foreach ($pagination_links['nums'] as $link) { ?>
103 103
                         <a href="<?= $link['url'] ?>"<?= $link['current'] ? ' class="search-result-pagination__current-page"' : '' ?>><?= $link['page'] ?></a>
104 104
                       <?php } ?>
105
-                      <?php if ( isset($pagination_links['next']) ) { ?>
105
+                      <?php if (isset($pagination_links['next'])) { ?>
106 106
                         <a href="<?= $pagination_links['next']['url'] ?>" title="Next page">&gt;</a>
107 107
                         <a href="<?= $pagination_links['lastpage']['url'] ?>" title="Final page">&gt;&gt;</a>
108 108
                       <?php } ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/search/form_main.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
             <input type="text" name="q" value="<?= _htmlentities($search_keyword) ?>" class="form-control">
5 5
             <input type="submit" class="button" value="Search">
6 6
         </p>
7
-      <?php if (isset($warnings) ) { ?>
7
+      <?php if (isset($warnings)) { ?>
8 8
         <p class="error">
9 9
             <?= $warnings ?>
10 10
         </p>
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
         <p>
19 19
             <ul class="search-result-display-options">
20 20
                 <li><a href="#options" class="search-options-toggle js-toggle-search-options">Advanced search</a></li>
21
-              <?php if ( $is_adv ) { ?>
22
-                <?= $search_phrase ? '<li>Exactly: ' . _htmlentities($search_phrase) . '</li>' : '' ?>
23
-                <?= $search_exclude ? '<li>Excluding: ' . _htmlentities($search_exclude) . '</li>' : '' ?>
24
-                <?= $search_from ? '<li>From: ' . _htmlentities($search_from) . '</li>' : '' ?>
25
-                <?= $search_to ? '<li>To: ' . _htmlentities($search_to) . '</li>' : '' ?>
26
-                <?= $search_person ? '<li>Person: ' . _htmlentities($search_person) . '</li>' : '' ?>
27
-                <?= $search_section ? '<li>Section: ' . _htmlentities($search_section_pretty) . '</li>' : '' ?>
28
-                <?= $search_column ? '<li>Column: ' . _htmlentities($search_column) . '</li>' : '' ?>
21
+              <?php if ($is_adv) { ?>
22
+                <?= $search_phrase ? '<li>Exactly: '._htmlentities($search_phrase).'</li>' : '' ?>
23
+                <?= $search_exclude ? '<li>Excluding: '._htmlentities($search_exclude).'</li>' : '' ?>
24
+                <?= $search_from ? '<li>From: '._htmlentities($search_from).'</li>' : '' ?>
25
+                <?= $search_to ? '<li>To: '._htmlentities($search_to).'</li>' : '' ?>
26
+                <?= $search_person ? '<li>Person: '._htmlentities($search_person).'</li>' : '' ?>
27
+                <?= $search_section ? '<li>Section: '._htmlentities($search_section_pretty).'</li>' : '' ?>
28
+                <?= $search_column ? '<li>Column: '._htmlentities($search_column).'</li>' : '' ?>
29 29
               <?php } ?>
30 30
             </ul>
31 31
         </p>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/pbc_session.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             <ul class="business-list">
25 25
             <?php
26 26
                 $first = 0;
27
-                foreach ( $rows as $row ) { ?>
27
+                foreach ($rows as $row) { ?>
28 28
                     <li>
29 29
                         <a href="<?= $row['url'] ?>" class="business-list__title">
30 30
                             <h3>
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                         </a>
34 34
                         <?php if (isset($row['contentcount'])) { ?>
35 35
                             <p class="business-list__meta">
36
-                                <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?>
36
+                                <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'].' speeches' ?>
37 37
                             </p>
38 38
                         <?php } ?>
39 39
                     </li>
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         </div>
43 43
         <div class="business-section__secondary">
44 44
             <div class="calendar__controls">
45
-                <?php if ( isset($prev) ) { ?>
45
+                <?php if (isset($prev)) { ?>
46 46
                 <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">&larr;</a>
47 47
                 <?php } else { ?>
48 48
                 <span class="calendar__controls__previous">&nbsp;</span>
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 <span class="calendar__controls__current">
51 51
                     <?= $session ?> session
52 52
                 </span>
53
-                <?php if ( isset($next) ) { ?>
53
+                <?php if (isset($next)) { ?>
54 54
                 <a href="<?= $next['url'] ?>" class="calendar__controls__next">&rarr;</a>
55 55
                 <?php } else { ?>
56 56
                 <span class="calendar__controls__next">&nbsp;</span>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
         <div class="business-section__primary">
2 2
             <ul class="business-list">
3
-              <?php foreach ( $data as $item ) { ?>
3
+              <?php foreach ($data as $item) { ?>
4 4
                 <li>
5 5
                     <?php include '_business_list_item.php'; ?>
6 6
                 </li>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/year.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
                 foreach ( $years as $year => $months ) { ?>
25 25
             <div class="calendar-year">
26 26
                 <?php foreach ($months as $month => $dates) {
27
-                  include '_calendar.php';
27
+                    include '_calendar.php';
28 28
                 } ?>
29 29
             </div>
30 30
             <?php }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,20 +8,20 @@
 block discarded – undo
8 8
         </div>
9 9
         <div class="business-section__solo">
10 10
             <div class="calendar__controls">
11
-                <?php if ( isset( $prev ) ) { ?>
11
+                <?php if (isset($prev)) { ?>
12 12
                 <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">&larr; <?= $prev['title'] ?></a>
13 13
                 <?php } else { ?>
14 14
                 <span class="calendar__controls__previous"></span>
15 15
                 <?php } ?>
16 16
                 <span class="calendar__controls__current"><?= $year ?></span>
17
-                <?php if ( isset( $next ) ) { ?>
17
+                <?php if (isset($next)) { ?>
18 18
                 <a href="<?= $next['url'] ?>" class="calendar__controls__next"><?= $next['title'] ?> &rarr;</a>
19 19
                 <?php } else { ?>
20 20
                 <span class="calendar__controls__next"></span>
21 21
                 <?php } ?>
22 22
             </div>
23
-            <?php if ( isset($years) ) {
24
-                foreach ( $years as $year => $months ) { ?>
23
+            <?php if (isset($years)) {
24
+                foreach ($years as $year => $months) { ?>
25 25
             <div class="calendar-year">
26 26
                 <?php foreach ($months as $month => $dates) {
27 27
                   include '_calendar.php';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,6 +34,6 @@
 block discarded – undo
34 34
         </div>
35 35
     </div>
36 36
 
37
-    <?php $search_title = "Search $title"; include '_search.php'; ?>
37
+    <?php $search_title = "search $title"; include '_search.php'; ?>
38 38
 
39 39
 </div>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/pbc_index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@
 block discarded – undo
22 22
 
23 23
         <div class="business-section__primary">
24 24
             <ul class="business-list">
25
-                <?php foreach ( $content['data'] as $date => $bills ) { ?>
25
+                <?php foreach ($content['data'] as $date => $bills) { ?>
26 26
                 <li>
27 27
                     <span class="business-list__title">
28 28
                         <h3>
29 29
                             <?= $date ?>
30 30
                         </h3>
31 31
                     </span>
32
-                    <?php foreach ( $bills as $bill ) { ?>
32
+                    <?php foreach ($bills as $bill) { ?>
33 33
                     <p>
34 34
                     <a href="<?= $bill['url'] ?>" class="business-list__title">
35 35
                         <?= $bill['bill'] ?> &ndash; <?= $bill['sitting'] ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_calendar_section.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
             <?php
2 2
             foreach ( $calendar as $year => $months ) {
3 3
                 foreach ($months as $month => $dates) {
4
-                     include '_calendar.php';
4
+                        include '_calendar.php';
5 5
                 }
6 6
             } ?>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
             <?php
2
-            foreach ( $calendar as $year => $months ) {
2
+            foreach ($calendar as $year => $months) {
3 3
                 foreach ($months as $month => $dates) {
4 4
                      include '_calendar.php';
5 5
                 }
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_list_item.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <a href="<?= $item['list_url'] ?>" class="business-list__title">
2 2
     <h3>
3
-      <?php if ( isset( $item['parent'] ) ) { ?>
3
+      <?php if (isset($item['parent'])) { ?>
4 4
         <?= $item['parent']['body'] ?>
5 5
         <br><?= $item['body'] ?>
6 6
       <?php } else { ?>
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
     </h3>
10 10
     <span class="business-list__meta">
11 11
       <?= format_date($item['hdate'], LONGERDATEFORMAT) ?>
12
-      <?=  isset($item['contentcount']) ? '&middot; ' . $item['contentcount'] . ( $item['contentcount'] == 1 ? ' speech' : ' speeches' ) : '' ?>
12
+      <?=  isset($item['contentcount']) ? '&middot; '.$item['contentcount'].($item['contentcount'] == 1 ? ' speech' : ' speeches') : '' ?>
13 13
     </span>
14 14
 </a>
15
-<?php if ( isset( $item['child'] ) ) { ?>
15
+<?php if (isset($item['child'])) { ?>
16 16
 <p class="business-list__excerpt">
17
-  <?php if ( isset($item['child']['speaker']) && count($item['child']['speaker']) > 0 ) { ?>
17
+  <?php if (isset($item['child']['speaker']) && count($item['child']['speaker']) > 0) { ?>
18 18
     <a href="<?= $item['child']['speaker']['url'] ?>"><?= $item['child']['speaker']['name'] ?></a>
19 19
   <?php } ?>
20
-  <?= strip_tags(trim_characters( $item['child']['body'], 0, 200 )) ?>
20
+  <?= strip_tags(trim_characters($item['child']['body'], 0, 200)) ?>
21 21
 </p>
22 22
 <?php } ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/column.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
         </div>
33 33
     </div>
34 34
   <?php } else {
35
-      $section = false; include '_section_content.php';
36
-  } ?>
35
+        $section = false; include '_section_content.php';
36
+    } ?>
37 37
 
38 38
 </div>
39 39
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
 </div>
20 20
 <div class="full-page">
21 21
 
22
-  <?php if ( count($data['rows']) == 0 ) { ?>
22
+  <?php if (count($data['rows']) == 0) { ?>
23 23
     <div class="debate-speech">
24 24
         <div class="full-page__row">
25 25
             <div class="full-page__unit">
26
-                <?php if ( $col_country == 'SCOTLAND' || $col_country == 'NORTHERN IRELAND' ) { ?>
26
+                <?php if ($col_country == 'SCOTLAND' || $col_country == 'NORTHERN IRELAND') { ?>
27 27
                     We only have information about columns for debates in the House of Commons and the House of Lords.
28 28
                 <?php } else { ?>
29 29
                     We can't find anything in column <?= $column ?> on <?= $debate_day_human ?>.
Please login to merge, or discard this patch.