Passed
Push — master ( c67b7a...0b1408 )
by Matthew
04:47
created
www/includes/easyparliament/templates/html/search/results.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
         <div class="search-page__section search-page__section--results">
10 10
             <div class="search-page__section__primary">
11 11
               <?php
12
-              # XXX Hack
13
-              if (preg_match('#winter\s+fuel#', $searchstring)) { ?>
12
+                # XXX Hack
13
+                if (preg_match('#winter\s+fuel#', $searchstring)) { ?>
14 14
                 <h3 class="search-result__title"><a href="https://www.theyworkforyou.com/debates/?id=2024-09-10a.712.0">Read the debate on the winter fuel regulations</a></h3>
15 15
               <?php } ?>
16 16
 
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  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 11
               <?php
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
                 <h3 class="search-result__title"><a href="https://www.theyworkforyou.com/debates/?id=2024-09-10a.712.0">Read the debate on the winter fuel regulations</a></h3>
15 15
               <?php } ?>
16 16
 
17
-              <?php if ( $cons ) { ?>
18
-                <?php if ( count($cons) > 1 ) {
19
-                    if ( $mp_types['mp'] > 0 && $mp_types['former'] > 0 ) {
17
+              <?php if ($cons) { ?>
18
+                <?php if (count($cons) > 1) {
19
+                    if ($mp_types['mp'] > 0 && $mp_types['former'] > 0) {
20 20
                         $desc = gettext('MPs and former MPs');
21
-                    } elseif ( $mp_types['mp'] > 0 ) {
21
+                    } elseif ($mp_types['mp'] > 0) {
22 22
                         $desc = gettext('MPs');
23
-                    } elseif ( $mp_types['former'] > 0 ) {
23
+                    } elseif ($mp_types['former'] > 0) {
24 24
                         $desc = gettext('Former MPs');
25 25
                     }
26 26
                 ?>
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
                 <?php } else { // count($cons) <= 1 ?>
31 31
                   <h2><?= sprintf(gettext('MP for <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2>
32 32
                 <?php } ?>
33
-                <?php foreach ( $cons as $member ) { ?>
33
+                <?php foreach ($cons as $member) { ?>
34 34
                   <?php include('person.php'); ?>
35 35
                 <?php } ?>
36 36
               <?php } ?>
37 37
 
38
-              <?php if ( $members ) { ?>
38
+              <?php if ($members) { ?>
39 39
                 <h2><?= sprintf(gettext('People matching <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2>
40
-                <?php foreach ( $members as $member ) { ?>
40
+                <?php foreach ($members as $member) { ?>
41 41
                     <?php include('person.php'); ?>
42 42
                 <?php } ?>
43 43
                 <hr>
@@ -45,43 +45,43 @@  discard block
 block discarded – undo
45 45
 
46 46
               <?php if ($glossary) { ?>
47 47
                 <h2>Glossary items matching <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2>
48
-                <?php foreach ( $glossary as $item ) { ?>
48
+                <?php foreach ($glossary as $item) { ?>
49 49
                     <?php include('glossary.php'); ?>
50 50
                 <?php } ?>
51 51
                 <hr>
52 52
               <?php } ?>
53 53
 
54
-              <?php if ( isset($pid) && $wtt == 2 ) { ?>
54
+              <?php if (isset($pid) && $wtt == 2) { ?>
55 55
                 <p>I want to <a href="https://www.writetothem.com/lords/?pid=<?= $pid ?>">write to <?= $wtt_lord_name ?></a></p>
56 56
               <?php } ?>
57 57
 
58
-              <?php if ( isset($error) ) { ?>
58
+              <?php if (isset($error)) { ?>
59 59
                 There was an error &ndash; <?= $error ?> &ndash; searching for <em class="current-search-term"><?= _htmlentities($searchstring) ?></em>.
60 60
               <?php } else { ?>
61 61
                 <h2>
62 62
                   <?php
63 63
                         $term = sprintf('<em class="current-search-term">%s</em>', _htmlentities($searchdescription));
64
-                        if ( $pagination_links ) { ?>
64
+                        if ($pagination_links) { ?>
65 65
                     <?= sprintf(gettext('Results %s–%s of %s for %s'), $pagination_links['first_result'], $pagination_links['last_result'], $info['total_results'], $term) ?>
66
-                  <?php } else if ( $info['total_results'] == 1 ) { ?>
66
+                  <?php } else if ($info['total_results'] == 1) { ?>
67 67
                     <?= sprintf(gettext('The only result for %s'), $term) ?>
68
-                  <?php } else if ( $info['total_results'] == 0 ) { ?>
68
+                  <?php } else if ($info['total_results'] == 0) { ?>
69 69
                     <?= sprintf(gettext('There were no results for %s'), $term) ?>
70 70
                   <?php } else { ?>
71 71
                     <?= sprintf(gettext('All %s results for %s'), $info['total_results'], $term) ?>
72 72
                   <?php } ?>
73 73
                 </h2>
74 74
 
75
-                  <?php if ( $info['spelling_correction'] ) { ?>
76
-                    <p><?= sprintf(gettext('Did you mean %s?'), '<a href="/search/?q=' . urlencode($info['spelling_correction']) . '">' . _htmlentities( $info['spelling_correction_display'] ) . '</a>') ?></p>
75
+                  <?php if ($info['spelling_correction']) { ?>
76
+                    <p><?= sprintf(gettext('Did you mean %s?'), '<a href="/search/?q=' . urlencode($info['spelling_correction']) . '">' . _htmlentities($info['spelling_correction_display']) . '</a>') ?></p>
77 77
                   <?php } ?>
78 78
 
79
-                  <?php if ( $info['total_results'] ) { ?>
79
+                  <?php if ($info['total_results']) { ?>
80 80
                     <ul class="search-result-display-options">
81
-                      <?php if ( $sort_order == 'relevance' ) { ?>
81
+                      <?php if ($sort_order == 'relevance') { ?>
82 82
                         <li><?= gettext('Sorted by relevance') ?></li>
83 83
                         <li><?= gettext('Sort by date') ?>: <a href="<?= $urls['newest'] ?>"><?= gettext('newest') ?></a> / <a href="<?= $urls['oldest'] ?>"><?= gettext('oldest') ?></a></li>
84
-                      <?php } else if ( $sort_order == 'oldest' ) { ?>
84
+                      <?php } else if ($sort_order == 'oldest') { ?>
85 85
                         <li><?= sprintf(gettext('Sort by <a href="%s">relevance</a>'), $urls['relevance']) ?></li>
86 86
                         <li><?= gettext('Sorted by date') ?>: <a href="<?= $urls['newest'] ?>"><?= gettext('newest') ?></a> / <?= gettext('oldest') ?></li>
87 87
                       <?php } else { ?>
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                     </ul>
93 93
                   <?php } ?>
94 94
 
95
-                  <?php foreach ( $rows as $result ) { ?>
95
+                  <?php foreach ($rows as $result) { ?>
96 96
                     <div class="search-result search-result--generic">
97 97
                         <h3 class="search-result__title"><a href="<?= $result['listurl'] ?>"><?= $result['parent']['body'] ?></a> (<?= format_date($result['hdate'], SHORTDATEFORMAT) ?>)</h3>
98 98
                         <p class="search-result__description"><?= isset($result['speaker']) ? $result['speaker']['name'] . ': ' : '' ?><?= $result['extract'] ?></p>
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
 
102 102
                 <hr>
103 103
 
104
-                  <?php if ( $pagination_links ) { ?>
104
+                  <?php if ($pagination_links) { ?>
105 105
                     <div class="search-result-pagination">
106
-                      <?php if ( isset($pagination_links['prev']) ) { ?>
106
+                      <?php if (isset($pagination_links['prev'])) { ?>
107 107
                         <a href="<?= $pagination_links['firstpage']['url'] ?>" title="<?= gettext('First page') ?>">&lt;&lt;</a>
108 108
                         <a href="<?= $pagination_links['prev']['url'] ?>" title="<?= gettext('Previous page') ?>">&lt;</a>
109 109
                       <?php } ?>
110
-                      <?php foreach ( $pagination_links['nums'] as $link ) { ?>
110
+                      <?php foreach ($pagination_links['nums'] as $link) { ?>
111 111
                         <a href="<?= $link['url'] ?>"<?= $link['current'] ? ' class="search-result-pagination__current-page"' : '' ?>><?= $link['page'] ?></a>
112 112
                       <?php } ?>
113
-                      <?php if ( isset($pagination_links['next']) ) { ?>
113
+                      <?php if (isset($pagination_links['next'])) { ?>
114 114
                         <a href="<?= $pagination_links['next']['url'] ?>" title="<?= gettext('Next page') ?>">&gt;</a>
115 115
                         <a href="<?= $pagination_links['lastpage']['url'] ?>" title="<?= gettext('Final page') ?>">&gt;&gt;</a>
116 116
                       <?php } ?>
Please login to merge, or discard this patch.