Completed
Pull Request — master (#1322)
by Nick
11:36 queued 06:31
created
www/includes/easyparliament/templates/html/homepage/recent-debates.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1
-                            <?php if ( isset( $recent['child'] ) ) { ?>
1
+                            <?php if (isset($recent['child'])) { ?>
2 2
                             <li class="parliamentary-excerpt">
3 3
                             <h3 class="excerpt__title"><a href="<?= $recent['list_url'] ?>"><?= $recent['parent']['body'] ? $recent['parent']['body'] . ' : ' : '' ?><?= $recent['body'] ?></a></h3>
4 4
                                 <p class="meta"><?=format_date($recent['hdate'], LONGERDATEFORMAT); ?></p>
5 5
                                 <p class="meta excerpt__category"><a href="<?= $recent['more_url'] ?>"><?= $recent['desc'] ?></a></p>
6 6
                                 <p class="excerpt__statement">
7
-                                <?php if ( isset($recent['child']['speaker']) && count($recent['child']['speaker']) ) { ?>
7
+                                <?php if (isset($recent['child']['speaker']) && count($recent['child']['speaker'])) { ?>
8 8
                                 <a href="<?= $recent['child']['speaker']['url'] ?>"><?= $recent['child']['speaker']['name'] ?></a>
9 9
                                 <?php } ?>
10 10
                                 <?= trim_characters($recent['child']['body'], 0, 200) ?>
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
                             <?php } else { ?>
14 14
                             <li class="parliamentary-excerpt">
15 15
                             <h3 class="excerpt__title"><?= $recent['desc'] ?></h3>
16
-                                <?php foreach ( $recent['data'] as $date => $details ) { ?>
16
+                                <?php foreach ($recent['data'] as $date => $details) { ?>
17 17
                                 <p class="meta"><?= $date ?></p>
18 18
                                 <p class="meta excerpt__category"><a href="<?= $recent['more_url'] ?>"><?= $recent['desc'] ?></a></p>
19
-                                <?php foreach ( $details as $bill ) { ?>
19
+                                <?php foreach ($details as $bill) { ?>
20 20
                                 <p class="excerpt__statement">
21 21
                                     <a href="<?= $bill['url'] ?>"><?= $bill['bill'] ?>, <?= $bill['sitting'] ?></a>
22 22
                                 </p>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,8 @@
 block discarded – undo
10 10
                                 <?= trim_characters($recent['child']['body'], 0, 200) ?>
11 11
                                 </p>
12 12
                             </li>
13
-                            <?php } else { ?>
13
+                            <?php }
14
+else { ?>
14 15
                             <li class="parliamentary-excerpt">
15 16
                             <h3 class="excerpt__title"><?= $recent['desc'] ?></h3>
16 17
                                 <?php foreach ( $recent['data'] as $date => $details ) { ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/comments.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         if (!$comment['visible']) {
85 85
             $reporthtml = '';
86 86
         } elseif (($this_page != 'commentreport' &&
87
-            $this_page != 'addcomment'  &&
87
+            $this_page != 'addcomment' &&
88 88
             $this_page != 'admin_commentreport')
89 89
             && $THEUSER->is_able_to('reportcomment')
90 90
             && $THEUSER->user_id() != $comment['user_id']
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $date = format_date($date, SHORTDATEFORMAT);
120 120
         $time = format_time($time, TIMEFORMAT);
121 121
         ?>
122
-                    <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) .' '. _htmlentities($comment['lastname']); ?></strong></a><br>
122
+                    <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) . ' ' . _htmlentities($comment['lastname']); ?></strong></a><br>
123 123
                     <small>Posted on <?php echo $date;
124 124
 
125 125
         if (isset($comment['url'])) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
         } else {
129 129
             // There won't be a URL when we're just previewing a comment.
130
-            print ' '.$time;
130
+            print ' ' . $time;
131 131
         }
132 132
         ?> <?php echo $reporthtml; ?></small></p>
133 133
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             $body = prepare_comment_for_display($comment['body']); // In utility.php
140 140
             echo "<p class=\"comment\">$body</p>\n";
141 141
         } else {
142
-            print '<p class="comment"><em>This annotation has been removed</em></p>'."\n";
142
+            print '<p class="comment"><em>This annotation has been removed</em></p>' . "\n";
143 143
         }
144 144
 
145 145
         ?>
Please login to merge, or discard this patch.
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,13 +39,16 @@  discard block
 block discarded – undo
39 39
     // If we're just previewing a comment, we passed in 'preview' => true.
40 40
     $subheading = 'Your annotation would look like this:';
41 41
 
42
-} elseif ($this_page == 'addcomment') {
42
+}
43
+elseif ($this_page == 'addcomment') {
43 44
     $subheading = 'Previous annotations';
44 45
 
45
-} elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46
+}
47
+elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46 48
     $subheading = "";
47 49
 
48
-} else {
50
+}
51
+else {
49 52
     $subheading = 'Annotations';
50 53
 }
51 54
 
@@ -70,7 +73,8 @@  discard block
 block discarded – undo
70 73
 
71 74
         if (isset($comment['comment_id'])) {
72 75
             $id = 'c' . $comment['comment_id'];
73
-        } else {
76
+        }
77
+        else {
74 78
             $id = '';
75 79
         }
76 80
 
@@ -83,7 +87,8 @@  discard block
 block discarded – undo
83 87
 
84 88
         if (!$comment['visible']) {
85 89
             $reporthtml = '';
86
-        } elseif (($this_page != 'commentreport' &&
90
+        }
91
+        elseif (($this_page != 'commentreport' &&
87 92
             $this_page != 'addcomment'  &&
88 93
             $this_page != 'admin_commentreport')
89 94
             && $THEUSER->is_able_to('reportcomment')
@@ -102,9 +107,11 @@  discard block
 block discarded – undo
102 107
 
103 108
             $reporthtml = '(<a href="' . $URL->generate() . '" title="Notify moderators that this annotation should be deleted">Report this annotation</a>)';
104 109
 
105
-        } elseif ($comment['modflagged']) {
110
+        }
111
+        elseif ($comment['modflagged']) {
106 112
             $reporthtml = '(This annotation has been reported to moderators)';
107
-        } else {
113
+        }
114
+        else {
108 115
             // When previewing a comment...
109 116
             $reporthtml = '';
110 117
         }
@@ -125,7 +132,8 @@  discard block
 block discarded – undo
125 132
         if (isset($comment['url'])) {
126 133
             print ' <a href="' . $comment['url'] . '" title="Link to this annotation">' . $time . '</a>';
127 134
 
128
-        } else {
135
+        }
136
+        else {
129 137
             // There won't be a URL when we're just previewing a comment.
130 138
             print ' '.$time;
131 139
         }
@@ -138,7 +146,8 @@  discard block
 block discarded – undo
138 146
             // Make URLs into links and do <br>s.
139 147
             $body = prepare_comment_for_display($comment['body']); // In utility.php
140 148
             echo "<p class=\"comment\">$body</p>\n";
141
-        } else {
149
+        }
150
+        else {
142 151
             print '<p class="comment"><em>This annotation has been removed</em></p>'."\n";
143 152
         }
144 153
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_recent_mostvotes.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
32 32
             $URL = new URL('member');
33 33
             $URL->insert(array('id'=>$row['speaker']['member_id']));
34 34
             $member = '<a href="' . $URL->generate() . '">' . $row['speaker']['name'] . '</a>: ';
35
-        } else {
35
+        }
36
+        else {
36 37
             $member = '';
37 38
         }
38 39
         ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/comments_user.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@
 block discarded – undo
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 42
             $member_name = $comment['speaker']['name'] . ': ';
43
-        } else {
43
+        }
44
+        else {
44 45
             $member_name = '';
45 46
         }
46 47
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_section.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
         </div>
7 7
 
8 8
         <?php
9
-            if ( isset($content['data']['data']) ) {
9
+            if (isset($content['data']['data'])) {
10 10
                 $data = $content['data']['data'];
11 11
                 include '_business_list.php'; ?>
12 12
                 <div class="business-section__secondary">
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
                 <?php
18 18
                 $calendar = $content['calendar']['years'];
19 19
                 include '_calendar_section.php';
20
-                if ( !isset($no_survey) ) {
21
-                    include( dirname(__FILE__) . '/../sidebar/looking_for.php' );
20
+                if (!isset($no_survey)) {
21
+                    include(dirname(__FILE__) . '/../sidebar/looking_for.php');
22 22
                 }
23 23
                 ?>
24
-                <?php if ( isset($content['rssurl']) ) { ?>
24
+                <?php if (isset($content['rssurl'])) { ?>
25 25
                 <p class="rss-feed">
26 26
                     <a href="<?= WEBPATH . $content['rssurl'] ?>">RSS feed of <?= $title ?></a>
27 27
                 </p>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@
 block discarded – undo
27 27
                 </p>
28 28
                 <?php } ?>
29 29
                 </div>
30
-            <?php } else { ?>
30
+            <?php }
31
+else { ?>
31 32
              <div class="business-section__primary">
32 33
                 None.
33 34
             </div>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/pbc_session.php 2 patches
Spacing   +3 added lines, -3 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>
@@ -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.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@  discard block
 block discarded – undo
44 44
             <div class="calendar__controls">
45 45
                 <?php if ( isset($prev) ) { ?>
46 46
                 <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">&larr;</a>
47
-                <?php } else { ?>
47
+                <?php }
48
+else { ?>
48 49
                 <span class="calendar__controls__previous">&nbsp;</span>
49 50
                 <?php } ?>
50 51
                 <span class="calendar__controls__current">
@@ -52,7 +53,8 @@  discard block
 block discarded – undo
52 53
                 </span>
53 54
                 <?php if ( isset($next) ) { ?>
54 55
                 <a href="<?= $next['url'] ?>" class="calendar__controls__next">&rarr;</a>
55
-                <?php } else { ?>
56
+                <?php }
57
+else { ?>
56 58
                 <span class="calendar__controls__next">&nbsp;</span>
57 59
                 <?php } ?>
58 60
             </div>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/pbc_bill.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
             <ul class="business-list">
25 25
             <?php
26 26
                 $first = 0;
27
-                foreach ( $content['rows'] as $row ) {
28
-                    if ( $row['htype'] == 10 ) {
29
-                        if ( !$first ) {
27
+                foreach ($content['rows'] as $row) {
28
+                    if ($row['htype'] == 10) {
29
+                        if (!$first) {
30 30
                             print '</li>';
31 31
                             $first = 1;
32 32
                         } ?>
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
                                 </h3>
38 38
                             </a>
39 39
                             <p class="business-list__meta">
40
-                                <?php if ( isset($row['sitting']) ) { ?>
40
+                                <?php if (isset($row['sitting'])) { ?>
41 41
                                     <?= make_ranking($row['sitting']) ?> sitting &middot;
42 42
                                 <?php } ?>
43
-                                <?= format_date($row['hdate'], LONGERDATEFORMAT ) ?>
44
-                                <?php if ( $row['contentcount'] > 0 ) { ?>
43
+                                <?= format_date($row['hdate'], LONGERDATEFORMAT) ?>
44
+                                <?php if ($row['contentcount'] > 0) { ?>
45 45
                                 &middot; <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?>
46 46
                                 <?php } ?>
47 47
                             </p>
48 48
                             <p class="business-list__excerpt">
49
-                                <?= trim_characters($row['excerpt'], 0, 200 ) ?>
49
+                                <?= trim_characters($row['excerpt'], 0, 200) ?>
50 50
                             </p>
51 51
                     <?php } else { ?>
52 52
                     <ul>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                                     <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?>
62 62
                                 </p>
63 63
                             <?php } ?>
64
-                            <?php if ( isset($row['excerpt']) ) { ?>
64
+                            <?php if (isset($row['excerpt'])) { ?>
65 65
                                 <p class="business-list__excerpt">
66 66
                                     <?= trim_characters($row['excerpt'], 0, 200) ?>
67 67
                                 </p>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             </ul>
74 74
         </div>
75 75
 
76
-        <?php if ( isset($content['info']['committee']) ) {
76
+        <?php if (isset($content['info']['committee'])) {
77 77
             $committee = $content['info']['committee'];
78 78
         ?>
79 79
         <div class="business-section__secondary">
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 
86 86
             <p><strong>Chairpersons</strong></p>
87 87
             <ul>
88
-            <?php foreach( $committee['chairmen'] as $chair ) { ?>
88
+            <?php foreach ($committee['chairmen'] as $chair) { ?>
89 89
                 <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li>
90 90
             <?php } ?>
91 91
             </ul>
92 92
             <p><strong>Members</strong></p>
93 93
             <ul>
94
-            <?php foreach( $committee['members'] as $chair ) { ?>
94
+            <?php foreach ($committee['members'] as $chair) { ?>
95 95
                 <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li>
96 96
             <?php } ?>
97 97
             </ul>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@
 block discarded – undo
48 48
                             <p class="business-list__excerpt">
49 49
                                 <?= trim_characters($row['excerpt'], 0, 200 ) ?>
50 50
                             </p>
51
-                    <?php } else { ?>
51
+                    <?php }
52
+else { ?>
52 53
                     <ul>
53 54
                         <li>
54 55
                             <a href="<?= $row['listurl'] ?>" class="business-list__title">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_list_item.php 2 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,8 @@
 block discarded – undo
3 3
       <?php if ( isset( $item['parent'] ) ) { ?>
4 4
         <?= $item['parent']['body'] ?>
5 5
         <br><?= $item['body'] ?>
6
-      <?php } else { ?>
6
+      <?php }
7
+else { ?>
7 8
         <?= $item['body'] ?>
8 9
       <?php } ?>
9 10
     </h3>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_search_video.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@
 block discarded – undo
33 33
 
34 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 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
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,21 +35,25 @@
 block discarded – undo
35 35
         echo '<dd><em><small>This speech is ';
36 36
         if ($row['hpos']-$want['hpos']>0) {
37 37
             echo ($row['hpos']-$want['hpos']) . ' later than';
38
-        } else {
38
+        }
39
+        else {
39 40
             echo ($want['hpos']-$row['hpos']) . ' earlier than';
40 41
         }
41 42
         echo ' the one you want &ndash; ';
42 43
         if ($row['video_status']&8 || !($row['video_status']&1)) {
43 44
             echo ' it doesn\'t have any video';
44
-        } elseif ($row['video_status']&4) {
45
+        }
46
+        elseif ($row['video_status']&4) {
45 47
             echo ' it has already been matched';
46
-        } elseif ($row['video_status']&1) {
48
+        }
49
+        elseif ($row['video_status']&1) {
47 50
             # Only for Commons currently
48 51
             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 52
         }
50 53
         echo '</small></em></dd>';
51 54
     }
52 55
     echo '</dl>';
53
-} else {
56
+}
57
+else {
54 58
     echo '<p>No data to display.</p>';
55 59
 }
Please login to merge, or discard this patch.