Completed
Pull Request — master (#965)
by Nick
05:26
created
www/includes/easyparliament/templates/html/hansard_search_min.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         ?>
35 35
                     <dt><a href="<?php echo $row['listurl']; ?>"><?php
36 36
         if (isset($row['parent']) && count($row['parent']) > 0) {
37
-            echo ('<strong>' . $row['parent']['body'] . '</strong>');
37
+            echo ('<strong>'.$row['parent']['body'].'</strong>');
38 38
         }
39 39
         echo '</a>';
40 40
         if (isset($row['video_status']) && ($row['video_status'] == 5 || $row['video_status'] == 7)) {
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
         ?></dt>
45 45
         <dd>
46 46
         <div class="appearance-date">
47
-            <div class="day"><?php echo format_date($row['hdate'], 'j' ) ?></div><!--
47
+            <div class="day"><?php echo format_date($row['hdate'], 'j') ?></div><!--
48 48
             <?php if ($year < $cur_year) { ?>
49
-            --><div class="month"><?php echo format_date($row['hdate'], 'M y' ) ?></div>
49
+            --><div class="month"><?php echo format_date($row['hdate'], 'M y') ?></div>
50 50
             <?php } else { ?>
51
-            --><div class="month"><?php echo format_date($row['hdate'], 'M' ) ?></div>
51
+            --><div class="month"><?php echo format_date($row['hdate'], 'M') ?></div>
52 52
             <?php } ?>
53 53
         </div>
54 54
 
55 55
         <p>&#8220;<?php
56 56
 
57
-        echo $row['extract'] . "&#8221;</p></dd>\n";
57
+        echo $row['extract']."&#8221;</p></dd>\n";
58 58
     }
59 59
     ?>
60 60
                 </dl>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_calendar.php 2 patches
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -135,12 +135,16 @@  discard block
 block discarded – undo
135 135
                 }
136 136
 
137 137
                 $recess_major = 1; # For all of UK Parliament
138
-                if ($hansardmajors[$data['info']['major']]['location'] == 'NI')
139
-                    $recess_major = 5;
140
-                elseif ($hansardmajors[$data['info']['major']]['location'] == 'Scotland')
141
-                    $recess_major = 4; # For all of Scotland
142
-                elseif ($data['info']['major'] == 101)
143
-                    $recess_major = 101; # Lords slightly different
138
+                if ($hansardmajors[$data['info']['major']]['location'] == 'NI') {
139
+                                    $recess_major = 5;
140
+                } elseif ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') {
141
+                                    $recess_major = 4;
142
+                }
143
+                # For all of Scotland
144
+                elseif ($data['info']['major'] == 101) {
145
+                                    $recess_major = 101;
146
+                }
147
+                # Lords slightly different
144 148
                 $recess = recess_prettify($currentDay, $month, $year, $recess_major);
145 149
 
146 150
                 // Is this day actually Today in the real world?
@@ -149,11 +153,15 @@  discard block
 block discarded – undo
149 153
                 // sittings - e.g. WH is only Tuesday-Thursday
150 154
                 if ($currentDay == $toDay) {
151 155
                     print '<td class="on"';
152
-                    if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"';
156
+                    if ($recess[0] && $recess[0]!=1) {
157
+                        print ' title="'.$recess[0].'"';
158
+                    }
153 159
                     print '>';
154 160
                 } elseif ($recess[0]) {
155 161
                     print '<td class="no"';
156
-                    if ($recess[0]!=1) print ' title="'.$recess[0].'"';
162
+                    if ($recess[0]!=1) {
163
+                        print ' title="'.$recess[0].'"';
164
+                    }
157 165
                     print '>';
158 166
                 } else {
159 167
                     print '<td>';
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 
41 41
 
42 42
             // Create array containing abbreviations of days of week.
43
-            $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun');
43
+            $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun');
44 44
 
45 45
             // What is the first day of the month in question?
46
-            $firstDayOfMonth = mktime(0,0,0,$month,1,$year);
46
+            $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year);
47 47
 
48 48
             // How many days does this month contain?
49
-            $numberDays = date('t',$firstDayOfMonth);
49
+            $numberDays = date('t', $firstDayOfMonth);
50 50
 
51 51
             // Retrieve some information about the first day of the
52 52
             // month in question.
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             if (isset($data['info']['onday'])) {
61 61
                 // 'onday' is like 'yyyy-mm-dd'.
62 62
                 $datebits = explode('-', $data['info']['onday']);
63
-                if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) {
63
+                if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) {
64 64
                     $toDay = $datebits[2];
65 65
                 } else {
66 66
                     $toDay = '';
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
                 // sittings - e.g. WH is only Tuesday-Thursday
150 150
                 if ($currentDay == $toDay) {
151 151
                     print '<td class="on"';
152
-                    if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"';
152
+                    if ($recess[0] && $recess[0] != 1) print ' title="'.$recess[0].'"';
153 153
                     print '>';
154 154
                 } elseif ($recess[0]) {
155 155
                     print '<td class="no"';
156
-                    if ($recess[0]!=1) print ' title="'.$recess[0].'"';
156
+                    if ($recess[0] != 1) print ' title="'.$recess[0].'"';
157 157
                     print '>';
158 158
                 } else {
159 159
                     print '<td>';
@@ -161,22 +161,22 @@  discard block
 block discarded – undo
161 161
 
162 162
                 // Is the $currentDay a member of $dates? If so,
163 163
                 // the day should be linked.
164
-                if (in_array($currentDay,$dates)) {
164
+                if (in_array($currentDay, $dates)) {
165 165
 
166 166
                     $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay);
167 167
 
168 168
                     if ($currentDay == $toDay) {
169
-                        print '<span>' . $currentDay . '</span></td>';
169
+                        print '<span>'.$currentDay.'</span></td>';
170 170
                     } else {
171 171
                         $DAYURL->insert(array('d'=>$date));
172
-                        print "<a href=\"" . $DAYURL->generate() . "\">$currentDay</a></td>";
172
+                        print "<a href=\"".$DAYURL->generate()."\">$currentDay</a></td>";
173 173
                     }
174 174
 
175 175
                     // $currentDay is not a member of $dates.
176 176
 
177 177
                 } else {
178 178
 
179
-                        print '<span>' . $currentDay . '</span></td>';
179
+                        print '<span>'.$currentDay.'</span></td>';
180 180
                 }
181 181
                 // Increment counters
182 182
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $year = $years[0];
210 210
             $URL = new \MySociety\TheyWorkForYou\Url($hansardmajors[$data['info']['major']]['page_year']);
211 211
             $URL->insert(array('y'=>$year));
212
-            print '<p><a href="' . $URL->generate() . '">See all of ' . $year . '</a></p>';
212
+            print '<p><a href="'.$URL->generate().'">See all of '.$year.'</a></p>';
213 213
         }
214 214
     }
215 215
 } else {
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/topic/topic.php 3 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -61,23 +61,23 @@
 block discarded – undo
61 61
               <?php else: ?>
62 62
                 <ul class="vote-descriptions">
63 63
                   <?php
64
-                  $policy_ids = array();
65
-
66
-                  foreach ($positions as $position) {
67
-                      if (!in_array($position['policy_id'], $policy_ids)) {
68
-                          $description = ucfirst($position['desc']);
69
-                          $link = sprintf(
70
-                              '%s/divisions?policy=%s',
71
-                              $member_url,
72
-                              $position['policy_id']
73
-                          );
74
-                          $show_link = $position['position'] != 'has never voted on';
75
-                          $key_vote = $position;
76
-                          include(dirname(__DIR__) . '/mp/_vote_description.php');
77
-
78
-                          $policy_ids[] = $position['policy_id'];
79
-                      }
80
-                  } ?>
64
+                    $policy_ids = array();
65
+
66
+                    foreach ($positions as $position) {
67
+                        if (!in_array($position['policy_id'], $policy_ids)) {
68
+                            $description = ucfirst($position['desc']);
69
+                            $link = sprintf(
70
+                                '%s/divisions?policy=%s',
71
+                                $member_url,
72
+                                $position['policy_id']
73
+                            );
74
+                            $show_link = $position['position'] != 'has never voted on';
75
+                            $key_vote = $position;
76
+                            include(dirname(__DIR__) . '/mp/_vote_description.php');
77
+
78
+                            $policy_ids[] = $position['policy_id'];
79
+                        }
80
+                    } ?>
81 81
                 </ul>
82 82
 
83 83
               <?php endif; ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                           );
74 74
                           $show_link = $position['position'] != 'has never voted on';
75 75
                           $key_vote = $position;
76
-                          include(dirname(__DIR__) . '/mp/_vote_description.php');
76
+                          include(dirname(__DIR__).'/mp/_vote_description.php');
77 77
 
78 78
                           $policy_ids[] = $position['policy_id'];
79 79
                       }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                 <ul class="business-list">
110 110
                   <?php foreach ($business as $item): ?>
111 111
                     <li>
112
-                        <?php include(dirname(__DIR__) . '/section/_business_list_item.php'); ?>
112
+                        <?php include(dirname(__DIR__).'/section/_business_list_item.php'); ?>
113 113
                     </li>
114 114
                   <?php endforeach; ?>
115 115
                 </ul>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,10 +58,12 @@
 block discarded – undo
58 58
                     to <a href="<?= $member_url ?>/votes">see all their votes</a>.
59 59
                 </p>
60 60
 
61
-              <?php else: ?>
61
+              <?php else {
62
+    : ?>
62 63
                 <ul class="vote-descriptions">
63 64
                   <?php
64 65
                   $policy_ids = array();
66
+}
65 67
 
66 68
                   foreach ($positions as $position) {
67 69
                       if (!in_array($position['policy_id'], $policy_ids)) {
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/comments_user.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,20 +39,20 @@
 block discarded – undo
39 39
 
40 40
         // Get the name of the member whose epobject was commented upon (if any).
41 41
         if (isset($comment['speaker']) && $comment['speaker']['name'] != '') {
42
-            $member_name = $comment['speaker']['name'] . ': ';
42
+            $member_name = $comment['speaker']['name'].': ';
43 43
         } else {
44 44
             $member_name = '';
45 45
         }
46 46
 
47
-        $user_name = _htmlentities($comment['firstname'] . ' ' . $comment['lastname']);
47
+        $user_name = _htmlentities($comment['firstname'].' '.$comment['lastname']);
48 48
 
49 49
         // We're grouping things by epobject_id, so we're going to display the number
50 50
         // of comments on this epobject.
51 51
         $plural = $comment['total_comments'] == 1 ? ' annotation' : ' annotations';
52 52
 
53
-        echo "\t\t\t\t<p><a href=\"$comment[url]\">$comment[total_comments]$plural</a> to <strong>" . $member_name . $hansardtext . "</strong><br>\n";
53
+        echo "\t\t\t\t<p><a href=\"$comment[url]\">$comment[total_comments]$plural</a> to <strong>".$member_name.$hansardtext."</strong><br>\n";
54 54
         echo "\t\t\t\t<small>(posted on $date)</small><br>\n";
55
-        echo "\t\t\t\t" . prepare_comment_for_display($comment['body']) . "</p>"; ?>
55
+        echo "\t\t\t\t".prepare_comment_for_display($comment['body'])."</p>"; ?>
56 56
 
57 57
 <?php
58 58
         $PAGE->stripe_end();
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/scotland/index.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
                 </div>
12 12
                 <div class="row">
13 13
                     <div class="medium-9 columns">
14
-                    <?php if ( count($data['regional']) > 0 ) { ?>
14
+                    <?php if (count($data['regional']) > 0) { ?>
15 15
                         <ul class="homepage-rep-list">
16 16
                         <li>Your Regional MSPs:</li>
17
-                        <?php foreach ( $data['regional'] as $msp ) { ?>
17
+                        <?php foreach ($data['regional'] as $msp) { ?>
18 18
                             <li class="homepage-rep-list__rep"><a href="/msp/?p=<?= $msp['person_id'] ?>"><?= $msp['name'] ?></a></li>
19 19
                         <?php } ?>
20 20
                         </ul>
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
             <div class="panel panel--flushtop clearfix">
58 58
                 <div class="row nested-row">
59 59
                     <div class="homepage-in-the-news homepage-content-section">
60
-                        <?php if ( $featured ) {
61
-                             include dirname(__FILE__) . "/../homepage/featured.php";
60
+                        <?php if ($featured) {
61
+                             include dirname(__FILE__)."/../homepage/featured.php";
62 62
                         } ?>
63 63
                     </div>
64 64
                     <div class="homepage-create-alert homepage-content-section">
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
                     <div class="homepage-recently homepage-content-section">
103 103
                         <h2>Recently in Parliament</h2>
104 104
                         <ul class="recently__list"><?php
105
-                            foreach ( $debates['recent'] as $recent ) {
106
-                                include dirname(__FILE__) . '/../homepage/recent-debates.php';
105
+                            foreach ($debates['recent'] as $recent) {
106
+                                include dirname(__FILE__).'/../homepage/recent-debates.php';
107 107
                             }
108 108
                         ?></ul>
109 109
                     </div>
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
                 <div class="row nested-row">
42 42
                     <div class="homepage-in-the-news homepage-content-section">
43 43
                         <?php if ( $featured ) {
44
-                             include dirname(__FILE__) . "/../homepage/featured.php";
44
+                                include dirname(__FILE__) . "/../homepage/featured.php";
45 45
                         } ?>
46 46
                     </div>
47 47
                     <div class="homepage-create-alert homepage-content-section">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_search_video.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,28 +24,28 @@
 block discarded – undo
24 24
     foreach ($data['rows'] as $n => $row) {
25 25
         echo '<dt>';
26 26
         if (isset($row['parent']) && count($row['parent']) > 0) {
27
-            echo ('<strong>' . $row['parent']['body'] . '</strong>');
27
+            echo ('<strong>'.$row['parent']['body'].'</strong>');
28 28
         }
29 29
         echo '</dt> <dd>';
30 30
         if (isset($row['speaker']) && count($row['speaker'])) {
31
-            echo "<em>" . ucfirst($row['speaker']['name']) . "</em>: ";
31
+            echo "<em>".ucfirst($row['speaker']['name'])."</em>: ";
32 32
         }
33 33
 
34
-        echo '&#8220;' . $row['extract'] . "&#8221;</dd>\n";
34
+        echo '&#8220;'.$row['extract']."&#8221;</dd>\n";
35 35
         echo '<dd><em><small>This speech is ';
36
-        if ($row['hpos']-$want['hpos']>0) {
37
-            echo ($row['hpos']-$want['hpos']) . ' later than';
36
+        if ($row['hpos'] - $want['hpos'] > 0) {
37
+            echo ($row['hpos'] - $want['hpos']).' later than';
38 38
         } else {
39
-            echo ($want['hpos']-$row['hpos']) . ' earlier than';
39
+            echo ($want['hpos'] - $row['hpos']).' earlier than';
40 40
         }
41 41
         echo ' the one you want &ndash; ';
42
-        if ($row['video_status']&8 || !($row['video_status']&1)) {
42
+        if ($row['video_status'] & 8 || !($row['video_status'] & 1)) {
43 43
             echo ' it doesn\'t have any video';
44
-        } elseif ($row['video_status']&4) {
44
+        } elseif ($row['video_status'] & 4) {
45 45
             echo ' it has already been matched';
46
-        } elseif ($row['video_status']&1) {
46
+        } elseif ($row['video_status'] & 1) {
47 47
             # Only for Commons currently
48
-            echo ' if you prefer, <a target="_top" onclick="t = parent.document[\'video\'].currentTime(); this.href += t;" href="/video/?gid=debate/' . $row['gid'] . '&amp;file=' . $want['file'] . '&amp;start=">switch to matching this speech instead</a>';
48
+            echo ' if you prefer, <a target="_top" onclick="t = parent.document[\'video\'].currentTime(); this.href += t;" href="/video/?gid=debate/'.$row['gid'].'&amp;file='.$want['file'].'&amp;start=">switch to matching this speech instead</a>';
49 49
         }
50 50
         echo '</small></em></dd>';
51 51
     }
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/trackbacks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 if (count($data) > 0) {
39 39
 
40 40
     if ($info['view'] == 'recent') {
41
-        $title = $info['num'] . ' most recent trackbacks';
41
+        $title = $info['num'].' most recent trackbacks';
42 42
     } else {
43 43
         $title = 'Some sites linking to this page';
44 44
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         ?>
65 65
         <dt><a href="<?php echo _htmlentities($trackback['url']); ?>"><?php echo _htmlentities($trackback['title']); ?></a></dt>
66 66
         <dd><?php echo _htmlentities($trackback['excerpt']); ?><br>
67
-            <small>At <?php echo _htmlentities($trackback['blog_name']); ?> on <?php echo $date . ' ' . $time; ?></small>
67
+            <small>At <?php echo _htmlentities($trackback['blog_name']); ?> on <?php echo $date.' '.$time; ?></small>
68 68
         </dd>
69 69
 <?php
70 70
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/vote.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
             </div>
114 114
 
115 115
              <ul class="debate-speech__meta debate-speech__links">
116
-             <?php if ( $division['debate_url'] ) { ?>
116
+             <?php if ($division['debate_url']) { ?>
117 117
                   <li class="link-to-speech">
118 118
                       <a class="link debate-speech__meta__link" href="<?= $division['debate_url'] ?>">Show full debate</a>
119 119
                   </li>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_vote_list.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
                     ?>
10 10
                     <ul class="division-list">
11 11
                         <?php foreach ($votes as $vote) {
12
-                          $voter = sprintf('<a href="/mp/?p=%d">%s</a>', $vote['person_id'], $vote['name']);
13
-                          if ($vote['teller']) {
14
-                              $tellers[] = $voter;
15
-                          } else { ?>
12
+                            $voter = sprintf('<a href="/mp/?p=%d">%s</a>', $vote['person_id'], $vote['name']);
13
+                            if ($vote['teller']) {
14
+                                $tellers[] = $voter;
15
+                            } else { ?>
16 16
                             <li><?= $voter ?></li>
17 17
                         <?php
18 18
                             }
Please login to merge, or discard this patch.