Completed
Pull Request — master (#1322)
by Nick
07:54 queued 02:46
created
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.
www/includes/easyparliament/templates/html/section/_calendar.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     if ($dayOfWeek < 0) {
42 42
         $dayOfWeek = 6;
43 43
     }
44
-  ?>
44
+    ?>
45 45
   <?php }
46 46
     if (!isset($years)) { ?>
47 47
     <div class="calendar__controls">
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                     } else {
128 128
                         $day_section = $section;
129 129
                         if ($section == 'sp') {
130
-                          $day_section = 'spdebates';
130
+                            $day_section = 'spdebates';
131 131
                         }
132 132
                         $urls[$day_section . 'day']->insert(array('d'=>$date));
133 133
                         print "<a href=\"" . $urls[$day_section . 'day']->generate() . "\">$currentDay</a></td>";
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <div class="calendar">
2
-  <?php if(isset($month)){
3
-    $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun');
2
+  <?php if (isset($month)) {
3
+    $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun');
4 4
 
5 5
     // What is the first day of the month in question?
6
-    $firstDayOfMonth = mktime(0,0,0,$month,1,$year);
6
+    $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year);
7 7
 
8 8
     // How many days does this month contain?
9
-    $numberDays = date('t',$firstDayOfMonth);
9
+    $numberDays = date('t', $firstDayOfMonth);
10 10
 
11 11
     // Retrieve some information about the first day of the
12 12
     // month in question.
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     if (isset($info['onday'])) {
19 19
         // 'onday' is like 'yyyy-mm-dd'.
20 20
         $datebits = explode('-', $info['onday']);
21
-        if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) {
21
+        if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) {
22 22
             $toDay = $datebits[2];
23 23
         } else {
24 24
             $toDay = '';
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
   <?php }
46 46
     if (!isset($years)) { ?>
47 47
     <div class="calendar__controls">
48
-        <?php if ( isset($prev) ) { ?>
48
+        <?php if (isset($prev)) { ?>
49 49
         <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">&larr;</a>
50 50
         <?php } else { ?>
51 51
         <span class="calendar__controls__previous">&nbsp;</span>
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         <span class="calendar__controls__current">
54 54
             <?= $monthName ?> <?= $year ?>
55 55
         </span>
56
-        <?php if ( isset($next) ) { ?>
56
+        <?php if (isset($next)) { ?>
57 57
         <a href="<?= $next['url'] ?>" class="calendar__controls__next">&rarr;</a>
58 58
         <?php } else { ?>
59 59
         <span class="calendar__controls__next">&nbsp;</span>
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
                 // sittings - e.g. WH is only Tuesday-Thursday
107 107
                 if ($currentDay == $toDay) {
108 108
                     print '<td class="on"';
109
-                    if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"';
109
+                    if ($recess[0] && $recess[0] != 1) print ' title="'.$recess[0].'"';
110 110
                     print '>';
111 111
                 } elseif ($recess[0]) {
112 112
                     print '<td class="no"';
113
-                    if ($recess[0]!=1) print ' title="'.$recess[0].'"';
113
+                    if ($recess[0] != 1) print ' title="'.$recess[0].'"';
114 114
                     print '>';
115 115
                 } else {
116 116
                     print '<td>';
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
 
119 119
                 // Is the $currentDay a member of $dates? If so,
120 120
                 // the day should be linked.
121
-                if (in_array($currentDay,$dates)) {
121
+                if (in_array($currentDay, $dates)) {
122 122
 
123 123
                     $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay);
124 124
 
125 125
                     if ($currentDay == $toDay) {
126
-                        print '<span>' . $currentDay . '</span></td>';
126
+                        print '<span>'.$currentDay.'</span></td>';
127 127
                     } else {
128 128
                         $day_section = $section;
129 129
                         if ($section == 'sp') {
130 130
                           $day_section = 'spdebates';
131 131
                         }
132
-                        $urls[$day_section . 'day']->insert(array('d'=>$date));
133
-                        print "<a href=\"" . $urls[$day_section . 'day']->generate() . "\">$currentDay</a></td>";
132
+                        $urls[$day_section.'day']->insert(array('d'=>$date));
133
+                        print "<a href=\"".$urls[$day_section.'day']->generate()."\">$currentDay</a></td>";
134 134
                     }
135 135
 
136 136
                     // $currentDay is not a member of $dates.
137 137
 
138 138
                 } else {
139 139
 
140
-                        print '<span>' . $currentDay . '</span></td>';
140
+                        print '<span>'.$currentDay.'</span></td>';
141 141
                 }
142 142
                 // Increment counters
143 143
 
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
             </tr>
157 157
         </tbody>
158 158
     </table>
159
-  <?php if(!isset($years)){ ?>
159
+  <?php if (!isset($years)) { ?>
160 160
     <div class="calendar__footer">
161 161
     <?php
162 162
         $y = $urls['day'];
163 163
         $y->reset();
164
-        $y->insert(array( 'y' => $year ));
164
+        $y->insert(array('y' => $year));
165 165
         $url = $y->generate();
166 166
     ?>
167 167
     <a href="<?= $url ?>">See all of <?= $year ?></a>
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,11 +106,15 @@
 block discarded – undo
106 106
                 // sittings - e.g. WH is only Tuesday-Thursday
107 107
                 if ($currentDay == $toDay) {
108 108
                     print '<td class="on"';
109
-                    if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"';
109
+                    if ($recess[0] && $recess[0]!=1) {
110
+                        print ' title="'.$recess[0].'"';
111
+                    }
110 112
                     print '>';
111 113
                 } elseif ($recess[0]) {
112 114
                     print '<td class="no"';
113
-                    if ($recess[0]!=1) print ' title="'.$recess[0].'"';
115
+                    if ($recess[0]!=1) {
116
+                        print ' title="'.$recess[0].'"';
117
+                    }
114 118
                     print '>';
115 119
                 } else {
116 120
                     print '<td>';
Please login to merge, or discard this patch.