Failed Conditions
Pull Request — master (#1325)
by Nick
26:10 queued 21:10
created
www/docs/admin/popularsearches.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
 
15 15
 $rows = array();
16 16
 foreach ($search_popular as $row) {
17
-    $rows[] = array (
18
-        '<a href="'.$row['url'].'">' . _htmlentities($row['query']) . '</a>',
17
+    $rows[] = array(
18
+        '<a href="'.$row['url'].'">'._htmlentities($row['query']).'</a>',
19 19
         $row['c'],
20 20
     );
21 21
 }
22 22
 
23
-$tabledata = array (
24
-    'header' => array (
23
+$tabledata = array(
24
+    'header' => array(
25 25
         'Query',
26 26
         'Count'
27 27
     ),
Please login to merge, or discard this patch.
www/docs/admin/alert_stats.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 $PAGE->page_start();
9 9
 $PAGE->stripe_start();
10
-$PAGE->block_start(array ('id'=>'alerts', 'title'=>'Alert Statistics'));
10
+$PAGE->block_start(array('id'=>'alerts', 'title'=>'Alert Statistics'));
11 11
 $db = new ParlDB;
12 12
 
13 13
 $q_confirmed = $db->query('select count(*) as c from alerts where confirmed and not deleted');
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
 
19 19
 print '<h3>Headline stats</h3> <table>';
20 20
 $data = array(
21
-    'header' => array( 'Alert Type', 'Count' ),
21
+    'header' => array('Alert Type', 'Count'),
22 22
     'rows' => array(
23
-        array( 'Confirmed', $q_confirmed->field('0', 'c') ),
24
-        array( 'Not Confirmed', $q_not_confirmed->field('0', 'c') ),
25
-        array( 'Deleted', $q_deleted->field('0', 'c') ),
26
-        array( 'For a Speaker<sup>*</sup>', $q_speaker->field('0', 'c') ),
27
-        array( 'For a Keyword', $q_keyword->field('0', 'c') ),
23
+        array('Confirmed', $q_confirmed->field('0', 'c')),
24
+        array('Not Confirmed', $q_not_confirmed->field('0', 'c')),
25
+        array('Deleted', $q_deleted->field('0', 'c')),
26
+        array('For a Speaker<sup>*</sup>', $q_speaker->field('0', 'c')),
27
+        array('For a Keyword', $q_keyword->field('0', 'c')),
28 28
     )
29 29
 );
30 30
 
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
 $q = $db->query('select alert_id, criteria from alerts where criteria not like "%speaker:%" and criteria like "%,%" and confirmed and not deleted');
36 36
 print '<h3>People who probably wanted separate signups</h3>';
37 37
 $rows = array();
38
-for ($i=0; $i<$q->rows(); $i++) {
38
+for ($i = 0; $i < $q->rows(); $i++) {
39 39
     $id = $q->field($i, 'alert_id');
40 40
     $criteria = $q->field($i, 'criteria');
41 41
     $rows[] = array($id, $critera);
42 42
 }
43
-$data = array( 'rows' => $rows );
43
+$data = array('rows' => $rows);
44 44
 $PAGE->display_table($data);
45 45
 
46 46
 $q = $db->query('select count(*) as c, criteria from alerts where criteria like "speaker:%" and confirmed and not deleted group by criteria order by c desc');
47 47
 $tots = array(); $name = array();
48
-for ($i=0; $i<$q->rows(); $i++) {
48
+for ($i = 0; $i < $q->rows(); $i++) {
49 49
     $c = $q->field($i, 'c');
50 50
     $criteria = $q->field($i, 'criteria');
51 51
     if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) continue;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 }
60 60
 $q = $db->query('select count(*) as c, criteria from alerts where criteria like "speaker:%" and not confirmed group by criteria order by c desc');
61 61
 $unconfirmed = array();
62
-for ($i=0; $i<$q->rows(); $i++) {
62
+for ($i = 0; $i < $q->rows(); $i++) {
63 63
     $c = $q->field($i, 'c');
64 64
     $criteria = $q->field($i, 'criteria');
65 65
     if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) continue;
@@ -70,15 +70,15 @@  discard block
 block discarded – undo
70 70
     }
71 71
 }
72 72
 
73
-$people_header = array( 'Name', 'Confirmed', 'Unconfirmed');
73
+$people_header = array('Name', 'Confirmed', 'Unconfirmed');
74 74
 print '<h3>Alert signups by MP/Peer</h3>';
75 75
 $rows = array();
76 76
 foreach ($tots as $person_id => $c) {
77 77
     $u = isset($unconfirmed[$person_id]) ? $unconfirmed[$person_id] : 0;
78
-    $rows[] = array( $name[$person_id], $c, $u );
78
+    $rows[] = array($name[$person_id], $c, $u);
79 79
 }
80 80
 $data = array(
81
-    'header' => array( 'Name', 'Confirmed', 'Unconfirmed'),
81
+    'header' => array('Name', 'Confirmed', 'Unconfirmed'),
82 82
     'rows' => $rows
83 83
 );
84 84
 $PAGE->display_table($data);
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 $confirmed = array();
88 88
 $total = array();
89 89
 $q = $db->query("select count(*) as c, criteria from alerts where criteria not like '%speaker:%' and confirmed and not deleted group by criteria having c>1 order by c desc");
90
-for ($i=0; $i<$q->rows(); $i++) {
90
+for ($i = 0; $i < $q->rows(); $i++) {
91 91
     $c = $q->field($i, 'c');
92 92
     $criteria = $q->field($i, 'criteria');
93 93
     $confirmed[$criteria] = $c;
94 94
     $total[$criteria] = 1;
95 95
 }
96 96
 $q = $db->query("select count(*) as c, criteria from alerts where criteria not like '%speaker:%' and not confirmed group by criteria having c>1 order by c desc");
97
-for ($i=0; $i<$q->rows(); $i++) {
97
+for ($i = 0; $i < $q->rows(); $i++) {
98 98
     $c = $q->field($i, 'c');
99 99
     $criteria = $q->field($i, 'criteria');
100 100
     $unconfirmed[$criteria] = $c;
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 foreach ($total as $criteria => $tot) {
106 106
     $c = isset($confirmed[$criteria]) ? $confirmed[$criteria] : 0;
107 107
     $u = isset($unconfirmed[$criteria]) ? $unconfirmed[$criteria] : 0;
108
-    $rows[] = array( $criteria, $c, $u );
108
+    $rows[] = array($criteria, $c, $u);
109 109
 }
110 110
 $data = array(
111
-    'header' => array( 'Criteria', 'Confirmed', 'Unconfirmed'),
111
+    'header' => array('Criteria', 'Confirmed', 'Unconfirmed'),
112 112
     'rows' => $rows
113 113
 );
114 114
 $PAGE->display_table($data);
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,11 +48,15 @@  discard block
 block discarded – undo
48 48
 for ($i=0; $i<$q->rows(); $i++) {
49 49
     $c = $q->field($i, 'c');
50 50
     $criteria = $q->field($i, 'criteria');
51
-    if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) continue;
51
+    if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) {
52
+        continue;
53
+    }
52 54
     $person_id = $m[1];
53 55
     $MEMBER = new MEMBER(array('person_id'=>$person_id));
54 56
     if ($MEMBER->valid) {
55
-        if (!array_key_exists($person_id, $tots)) $tots[$person_id] = 0;
57
+        if (!array_key_exists($person_id, $tots)) {
58
+            $tots[$person_id] = 0;
59
+        }
56 60
         $tots[$person_id] += $c;
57 61
         $name[$person_id] = $MEMBER->full_name();
58 62
     }
@@ -62,10 +66,14 @@  discard block
 block discarded – undo
62 66
 for ($i=0; $i<$q->rows(); $i++) {
63 67
     $c = $q->field($i, 'c');
64 68
     $criteria = $q->field($i, 'criteria');
65
-    if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) continue;
69
+    if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) {
70
+        continue;
71
+    }
66 72
     $person_id = $m[1];
67 73
     if (isset($name[$person_id])) {
68
-        if (!array_key_exists($person_id, $unconfirmed)) $unconfirmed[$person_id] = 0;
74
+        if (!array_key_exists($person_id, $unconfirmed)) {
75
+            $unconfirmed[$person_id] = 0;
76
+        }
69 77
         $unconfirmed[$person_id] += $c;
70 78
     }
71 79
 }
Please login to merge, or discard this patch.
www/docs/admin/featured.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 $out = '';
13 13
 if (get_http_var('preview')) {
14 14
     preview_featured();
15
-} else if ( get_http_var('confirm') ) {
15
+} else if (get_http_var('confirm')) {
16 16
     $out = update_featured();
17 17
 }
18 18
 
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 print '</div>';
24 24
 
25 25
 function gid_to_url($gid) {
26
-    if ( !$gid ) {
26
+    if (!$gid) {
27 27
         return '';
28 28
     }
29 29
     global $hansardmajors;
30 30
     global $db;
31 31
 
32
-    $q = $db->query("SELECT major FROM hansard WHERE gid = :gid", array( ':gid' => $gid ));
32
+    $q = $db->query("SELECT major FROM hansard WHERE gid = :gid", array(':gid' => $gid));
33 33
     $url_gid = fix_gid_from_db($gid);
34 34
     $url = new \URL($hansardmajors[$q->field(0, 'major')]['page']);
35 35
     $url->insert(array('id' => $url_gid));
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     $related = $featured->get_related();
44 44
     $context = $featured->get_context();
45 45
 
46
-    if ( get_http_var('url') ) {
46
+    if (get_http_var('url')) {
47 47
         $url = get_http_var('url');
48 48
         $title = get_http_var('title');
49 49
         $context = get_http_var('context');
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
     $related_gid3 = $related3 ? get_gid_from_url($related3) : NULL;
114 114
 
115 115
     print "<h2>Preview Content</h2>";
116
-    if ( $gid !== NULL ) {
116
+    if ($gid !== NULL) {
117 117
         $h = new MySociety\TheyWorkForYou\Homepage;
118
-        $featured = $h->getFeaturedDebate($gid, $title, $context, array( $related_gid1, $related_gid2, $related_gid3 ));
118
+        $featured = $h->getFeaturedDebate($gid, $title, $context, array($related_gid1, $related_gid2, $related_gid3));
119 119
 
120
-        include INCLUDESPATH . 'easyparliament/templates/html/homepage/featured.php';
120
+        include INCLUDESPATH.'easyparliament/templates/html/homepage/featured.php';
121 121
     } else {
122 122
         print "<p>A random debate from the last 7 days will be displayed</p>";
123 123
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     $parts = parse_url($url);
158 158
     parse_str($parts['query'], $query);
159 159
 
160
-    if ( $query['id'] ) {
160
+    if ($query['id']) {
161 161
         if (strpos($parts['path'], 'lords') !== false) {
162 162
             $gid = 'uk.org.publicwhip/lords/';
163 163
         } elseif (strpos($parts['path'], 'whall') !== false) {
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     $featured->set_related(array($related1, $related2, $related3));
187 187
 
188 188
     $out = "<h4>update successful</h4>";
189
-    $out .= "<p>Title set to " . _htmlspecialchars($title) . " and gid to " . _htmlspecialchars($gid) . "</p>";
189
+    $out .= "<p>Title set to "._htmlspecialchars($title)." and gid to "._htmlspecialchars($gid)."</p>";
190 190
 
191 191
     return $out;
192 192
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
     $related2 = get_http_var('related2');
108 108
     $related3 = get_http_var('related3');
109 109
 
110
-    $gid = $url ? get_gid_from_url($url) : NULL;
111
-    $related_gid1 = $related1 ? get_gid_from_url($related1) : NULL;
112
-    $related_gid2 = $related2 ? get_gid_from_url($related2) : NULL;
113
-    $related_gid3 = $related3 ? get_gid_from_url($related3) : NULL;
110
+    $gid = $url ? get_gid_from_url($url) : null;
111
+    $related_gid1 = $related1 ? get_gid_from_url($related1) : null;
112
+    $related_gid2 = $related2 ? get_gid_from_url($related2) : null;
113
+    $related_gid3 = $related3 ? get_gid_from_url($related3) : null;
114 114
 
115 115
     print "<h2>Preview Content</h2>";
116
-    if ( $gid !== NULL ) {
116
+    if ( $gid !== null ) {
117 117
         $h = new MySociety\TheyWorkForYou\Homepage;
118 118
         $featured = $h->getFeaturedDebate($gid, $title, $context, array( $related_gid1, $related_gid2, $related_gid3 ));
119 119
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 
155 155
 function get_gid_from_url($url) {
156
-    $gid = NULL;
156
+    $gid = null;
157 157
     $parts = parse_url($url);
158 158
     parse_str($parts['query'], $query);
159 159
 
Please login to merge, or discard this patch.
www/docs/admin/banner.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $out = '<form action="banner.php" method="post">';
51 51
     $out .= '<input name="action" type="hidden" value="Save">';
52 52
     $out .= '<p><label for="banner">Contents (HTML permitted)</label><br>';
53
-    $out .= '<textarea id="banner_text" name="banner" rows="5" cols="80">' . htmlentities($text) . "</textarea></p>\n";
53
+    $out .= '<textarea id="banner_text" name="banner" rows="5" cols="80">'.htmlentities($text)."</textarea></p>\n";
54 54
     $out .= '<span class="formw"><input type="button" id="preview" value="Preview"> <input name="btnaction" type="submit" value="Save"></span>';
55 55
     $out .= '</form>';
56 56
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     global $banner;
62 62
     $banner_text = get_http_var('banner');
63 63
 
64
-    if ( $banner->set_text($banner_text) ) {
64
+    if ($banner->set_text($banner_text)) {
65 65
         $out = "<h4>update successful</h4>";
66 66
         $out .= "<p>Banner text is now:</p><p>$banner_text</p>";
67 67
     } else {
Please login to merge, or discard this patch.
www/docs/admin/badusers.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
 $rows = array();
33 33
 $USERURL = new URL('userview');
34 34
 
35
-for ($row=0; $row<$q->rows(); $row++) {
35
+for ($row = 0; $row < $q->rows(); $row++) {
36 36
 
37 37
     $user_id = $q->field($row, 'user_id');
38 38
 
39 39
     // Get the total comments posted for this user.
40 40
     $r = $db->query("SELECT COUNT(*) AS totalcount
41 41
                     FROM	comments
42
-                    WHERE	user_id = '" . $user_id . "'");
42
+                    WHERE	user_id = '" . $user_id."'");
43 43
 
44 44
     $totalcomments = $r->field(0, 'totalcount');
45 45
 
46
-    $percentagedeleted = ( $q->field($row, 'deletedcount') / $totalcomments ) * 100;
46
+    $percentagedeleted = ($q->field($row, 'deletedcount') / $totalcomments) * 100;
47 47
 
48 48
 
49 49
     // Get complaints made about this user's comments, but not upheld.
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 
60 60
     $USERURL->insert(array('u'=>$user_id));
61 61
 
62
-    $rows[] = array (
63
-        '<a href="' . $USERURL->generate() . '">' . $q->field($row, 'firstname') . ' ' . $q->field($row, 'lastname') . '</a>',
62
+    $rows[] = array(
63
+        '<a href="'.$USERURL->generate().'">'.$q->field($row, 'firstname').' '.$q->field($row, 'lastname').'</a>',
64 64
         $totalcomments,
65 65
         $q->field($row, 'deletedcount'),
66 66
         $percentagedeleted.'%',
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
     );
69 69
 }
70 70
 
71
-$tabledata = array (
72
-    'header' => array (
71
+$tabledata = array(
72
+    'header' => array(
73 73
         'Name',
74 74
         'Total comments',
75 75
         'Number deleted',
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 $rows = array();
106 106
 $USERURL = new URL('userview');
107 107
 
108
-for ($row=0; $row<$q->rows(); $row++) {
108
+for ($row = 0; $row < $q->rows(); $row++) {
109 109
 
110 110
     $user_id = $q->field($row, 'user_id');
111 111
 
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
                     WHERE	user_id = '$user_id'
118 118
                     AND		upheld = '1'");
119 119
 
120
-    $rows[] = array (
121
-        '<a href="' . $USERURL->generate() . '">' . $q->field($row, 'firstname') . ' ' . $q->field($row, 'lastname') . '</a>',
120
+    $rows[] = array(
121
+        '<a href="'.$USERURL->generate().'">'.$q->field($row, 'firstname').' '.$q->field($row, 'lastname').'</a>',
122 122
         $q->field($row, 'rejectedcount'),
123 123
         $r->field(0, 'upheldcount')
124 124
     );
125 125
 
126 126
 }
127
-$tabledata = array (
128
-    'header' => array (
127
+$tabledata = array(
128
+    'header' => array(
129 129
         'Name',
130 130
         'Reports not upheld',
131 131
         'Reports upheld'
Please login to merge, or discard this patch.
www/docs/admin/reporting_stats.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 $PAGE->page_start();
9 9
 $PAGE->stripe_start();
10
-$PAGE->block_start(array ('id'=>'alerts', 'title'=>'Reporting Statistics'));
10
+$PAGE->block_start(array('id'=>'alerts', 'title'=>'Reporting Statistics'));
11 11
 $db = new ParlDB;
12 12
 $q = $db->query('select year(created) as the_year, month(created) as the_month, count(*) as c from alerts where confirmed and not deleted group by year(created) desc, month(created) desc');
13 13
 print '<h3>Alert signups per month</h3> <table>';
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 print '<thead><tr><th>Year</th><th style="padding-right: 15px;">Month</th><th>Sign Ups</th><tr></thead>';
17 17
 
18 18
 $row_count = $q->rows();
19
-for ($i=0; $i<$row_count; $i++) {
19
+for ($i = 0; $i < $row_count; $i++) {
20 20
     $year = $q->field($i, 'the_year');
21 21
     $month = $q->field($i, 'the_month');
22 22
     $count = $q->field($i, 'c');
Please login to merge, or discard this patch.
www/docs/admin/websites.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 include_once '../../includes/easyparliament/init.php';
4 4
 #include_once INCLUDESPATH . 'easyparliament/commentreportlist.php';
5 5
 #include_once INCLUDESPATH . 'easyparliament/searchengine.php';
6
-include_once INCLUDESPATH . 'easyparliament/member.php';
6
+include_once INCLUDESPATH.'easyparliament/member.php';
7 7
 #include_once INCLUDESPATH . 'easyparliament/people.php';
8 8
 
9 9
 $this_page = 'admin_mpurls';
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 
55 55
         $out = "<h3>Edit person: $name</h3>\n";
56 56
 
57
-        $out .= '<form action="websites.php?editperson=' . $q->field($row, 'person_id') . '" method="post">';
57
+        $out .= '<form action="websites.php?editperson='.$q->field($row, 'person_id').'" method="post">';
58 58
         $out .= '<input name="action" type="hidden" value="SaveURL">';
59 59
         $out .= '<label for="url">URL:</label>';
60
-        $out .= '<span class="formw"><input id="url" name="url" type="text"  size="60" value="' . $q->field($row, 'mp_website') . '"></span>' . "\n";
60
+        $out .= '<span class="formw"><input id="url" name="url" type="text"  size="60" value="'.$q->field($row, 'mp_website').'"></span>'."\n";
61 61
         $out .= '<span class="formw"><input name="btnaction" type="submit" value="Save URL"></span>';
62 62
         $out .= '</form>';
63 63
     }
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
         $out .= '<li>';
84 84
         $name = member_full_name($q->field($row, 'house'), $q->field($row, 'title'), $q->field($row, 'given_name'), $q->field($row, 'family_name'), $q->field($row, 'lordofname'));
85 85
         $mp_website = $q->field($row, 'data_value');
86
-        $out .= ' <small>[<a href="websites.php?editperson=' . $q->field($row, 'person_id') . '"';
86
+        $out .= ' <small>[<a href="websites.php?editperson='.$q->field($row, 'person_id').'"';
87 87
         if ($mp_website) {
88
-            $out .= ' title="Change URL ' . $mp_website . '">Edit URL</a>]</small>';
88
+            $out .= ' title="Change URL '.$mp_website.'">Edit URL</a>]</small>';
89 89
         } else {
90 90
             $out .= '>Add URL</a>]</small>';
91 91
         }
92
-        $out .= ' ' . $name;
92
+        $out .= ' '.$name;
93 93
         if ($q->field($row, 'constituency')) {
94
-            $out .= ' (' . $q->field($row, 'constituency') . ')';
94
+            $out .= ' ('.$q->field($row, 'constituency').')';
95 95
         }
96 96
         $out .= "</li>\n";
97 97
     }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $sysretval = 0;
108 108
     $personid = get_http_var('editperson');
109 109
 
110
-    $q  = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", array(
110
+    $q = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", array(
111 111
         ':person_id' => $personid
112 112
         ));
113 113
 
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
     }
120 120
 
121 121
     if ($q->success()) {
122
-        exec($scriptpath . "/db2xml.pl --update_person --personid=" . escapeshellarg($personid) . " --debug", $exec_output);
122
+        exec($scriptpath."/db2xml.pl --update_person --personid=".escapeshellarg($personid)." --debug", $exec_output);
123 123
         $out = '<p id="warning">';
124
-        foreach ($exec_output as $message) {$out .= $message . "<br>";}
124
+        foreach ($exec_output as $message) {$out .= $message."<br>"; }
125 125
         $out .= '</p>';
126 126
         # ../../../scripts/db2xml.pl  --update_person --personid=10001
127 127
     }
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
     $rettext .= '<div id="subnav_websites">';
142 142
     foreach ($subnav as $label => $path) {
143
-        $rettext .=  '<a href="'. $path . '">'. $label .'</a>';
143
+        $rettext .= '<a href="'.$path.'">'.$label.'</a>';
144 144
     }
145
-    $rettext .=  '</div>';
145
+    $rettext .= '</div>';
146 146
 
147 147
     return $rettext;
148 148
 }
Please login to merge, or discard this patch.
www/docs/admin/glossary.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 $EDITQUEUE = new GLOSSEDITQUEUE();
11 11
 
12
-$args = array (
12
+$args = array(
13 13
     'sort' => "regexp_replace"
14 14
 );
15 15
 
@@ -22,19 +22,19 @@  discard block
 block discarded – undo
22 22
 if (get_http_var('approve')) {
23 23
     $approve = get_http_var('approve');
24 24
     if (!is_array($approve)) {
25
-        $approve = array ( $approve );
25
+        $approve = array($approve);
26 26
     }
27 27
     // Add all approved items
28
-    $data = array (
28
+    $data = array(
29 29
         'approvals' => $approve,
30 30
         'epobject_type' => 2
31 31
     );
32 32
     $EDITQUEUE->approve($data);
33 33
 }
34 34
 elseif (get_http_var('decline')) {
35
-    $decline = array (get_http_var('decline'));
35
+    $decline = array(get_http_var('decline'));
36 36
     // Dump all declined items
37
-    $data = array (
37
+    $data = array(
38 38
         'declines' => $decline,
39 39
         'epobject_type' => 2
40 40
     );
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
         'epobject_type' => 2
31 31
     );
32 32
     $EDITQUEUE->approve($data);
33
-}
34
-elseif (get_http_var('decline')) {
33
+} elseif (get_http_var('decline')) {
35 34
     $decline = array (get_http_var('decline'));
36 35
     // Dump all declined items
37 36
     $data = array (
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
         'epobject_type' => 2
40 39
     );
41 40
     $EDITQUEUE->decline($data);
42
-}
43
-elseif (get_http_var('delete_confirm')) {
41
+} elseif (get_http_var('delete_confirm')) {
44 42
     $delete_id = get_http_var('delete_confirm');
45 43
     // Delete the existing glossary entry
46 44
     $GLOSSARY->delete($delete_id);
Please login to merge, or discard this patch.
www/docs/admin/policies.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 include_once '../../includes/easyparliament/init.php';
4 4
 #include_once INCLUDESPATH . 'easyparliament/commentreportlist.php';
5 5
 #include_once INCLUDESPATH . 'easyparliament/searchengine.php';
6
-include_once INCLUDESPATH . 'easyparliament/member.php';
6
+include_once INCLUDESPATH.'easyparliament/member.php';
7 7
 #include_once INCLUDESPATH . 'easyparliament/people.php';
8 8
 
9 9
 $this_page = 'admin_policies';
@@ -47,24 +47,24 @@  discard block
 block discarded – undo
47 47
 
48 48
     for ($row = 0; $row < $q->rows(); $row++) {
49 49
 
50
-        $out = "<h3>Edit policy: " . $q->field($row, 'title') . "</h3>\n";
50
+        $out = "<h3>Edit policy: ".$q->field($row, 'title')."</h3>\n";
51 51
 
52
-        $out .= '<form action="policies.php?editpolicy=' . $q->field($row, 'policy_id') . '" method="post">';
52
+        $out .= '<form action="policies.php?editpolicy='.$q->field($row, 'policy_id').'" method="post">';
53 53
         $out .= '<input name="action" type="hidden" value="Save">';
54 54
         $out .= '<p><label for="title">Title: </label>';
55
-        $out .= '<span class="formw"><input id="title-textbox" name="title" type="text"  size="60" value="' . htmlentities($q->field($row, 'title')) . '"></span>' . "</p>\n";
55
+        $out .= '<span class="formw"><input id="title-textbox" name="title" type="text"  size="60" value="'.htmlentities($q->field($row, 'title')).'"></span>'."</p>\n";
56 56
         $out .= '<p><label for="description">Description</label><br>';
57
-        $out .= '<span class="formw"><textarea id="description" name="description" rows="10" cols="100">' . htmlentities($q->field($row, 'description')) . '</textarea></span>' . "</p>\n";
57
+        $out .= '<span class="formw"><textarea id="description" name="description" rows="10" cols="100">'.htmlentities($q->field($row, 'description')).'</textarea></span>'."</p>\n";
58 58
         $out .= '<p><label for="image">Image URL: </label>';
59
-        $out .= '<span class="formw"><input id="image" name="image" type="text"  size="60" value="' . htmlentities($q->field($row, 'image')) . '"></span>' . "</p>\n";
59
+        $out .= '<span class="formw"><input id="image" name="image" type="text"  size="60" value="'.htmlentities($q->field($row, 'image')).'"></span>'."</p>\n";
60 60
         $out .= '<p><label for="image_attrib">Image attribution: </label>';
61
-        $out .= '<span class="formw"><input id="image_attrib" name="image_attrib" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_attrib')) . '"></span>' . "</p>\n";
61
+        $out .= '<span class="formw"><input id="image_attrib" name="image_attrib" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_attrib')).'"></span>'."</p>\n";
62 62
         $out .= '<p><label for="image_license">Image license: </label>';
63
-        $out .= '<span class="formw"><input id="image_license" name="image_license" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_license')) . '"></span>' . "</p>\n";
63
+        $out .= '<span class="formw"><input id="image_license" name="image_license" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_license')).'"></span>'."</p>\n";
64 64
         $out .= '<p><label for="image_license_url">Image license URL: </label>';
65
-        $out .= '<span class="formw"><input id="image_license_url" name="image_license_url" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_license_url')) . '"></span>' . "</p>\n";
65
+        $out .= '<span class="formw"><input id="image_license_url" name="image_license_url" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_license_url')).'"></span>'."</p>\n";
66 66
         $out .= '<p><label for="image_source">Image source: </label>';
67
-        $out .= '<span class="formw"><input id="image_source" name="image_source" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_source')) . '"></span>' . "</p>\n";
67
+        $out .= '<span class="formw"><input id="image_source" name="image_source" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_source')).'"></span>'."</p>\n";
68 68
         $out .= '<p><span class="formw"><input name="btnaction" type="submit" value="Save"></span>';
69 69
         $out .= '</form>';
70 70
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     for ($row = 0; $row < $q->rows(); $row++) {
82 82
         $out .= '<li style="margin-bottom: 1em;">';
83 83
         $out .= sprintf('<strong>%d</strong>: %s - %s', $q->field($row, 'policy_id'), htmlentities($q->field($row, 'title')), htmlentities($q->field($row, 'description')));
84
-        $out .= ' <small>[<a href="policies.php?editpolicy=' . $q->field($row, 'policy_id') . '">Edit Policy</a>]</small>';
84
+        $out .= ' <small>[<a href="policies.php?editpolicy='.$q->field($row, 'policy_id').'">Edit Policy</a>]</small>';
85 85
         $out .= "</li>\n";
86 86
     }
87 87
     $out .= '</ul>';
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         )
111 111
     );
112 112
 
113
-    if ( $q->success() ) {
113
+    if ($q->success()) {
114 114
         $out = "<h4>update successful</h4>";
115 115
     }
116 116
 
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
     $rettext .= '<div id="subnav_websites">';
127 127
     foreach ($subnav as $label => $path) {
128
-        $rettext .=  '<a href="'. $path . '">'. $label .'</a>';
128
+        $rettext .= '<a href="'.$path.'">'.$label.'</a>';
129 129
     }
130
-    $rettext .=  '</div>';
130
+    $rettext .= '</div>';
131 131
 
132 132
     return $rettext;
133 133
 }
Please login to merge, or discard this patch.