@@ -50,18 +50,18 @@ discard block |
||
50 | 50 | <?php |
51 | 51 | } else { |
52 | 52 | $rep_name = $MEMBER->full_name(); |
53 | - if ($MEMBER->house_disp==1) { |
|
53 | + if ($MEMBER->house_disp == 1) { |
|
54 | 54 | $rep_name .= ' MP'; |
55 | - } elseif ($MEMBER->house_disp==3) { |
|
55 | + } elseif ($MEMBER->house_disp == 3) { |
|
56 | 56 | $rep_name .= ' MLA'; |
57 | 57 | } |
58 | - $data = array ( |
|
58 | + $data = array( |
|
59 | 59 | 'template' => 'email_a_friend', |
60 | 60 | 'to' => $recipient_email, |
61 | 61 | 'subject' => 'Find out all about ' . $rep_name |
62 | 62 | ); |
63 | 63 | $url = $MEMBER->url(true); |
64 | - $merge = array ( |
|
64 | + $merge = array( |
|
65 | 65 | 'NAME' => $sender_name, |
66 | 66 | 'EMAIL' => $sender_email, |
67 | 67 | 'REP_NAME' => $rep_name, |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $success = send_template_email($data, $merge); |
72 | 72 | if ($success) { |
73 | - print "<p>Your email has been sent successfully. Thank you for using TheyWorkForYou.</p> <p><a href=\"$url\">Return to ".$MEMBER->full_name()."'s page</a></p>"; |
|
73 | + print "<p>Your email has been sent successfully. Thank you for using TheyWorkForYou.</p> <p><a href=\"$url\">Return to " . $MEMBER->full_name() . "'s page</a></p>"; |
|
74 | 74 | } else { |
75 | 75 | print "<p>Sorry, something went wrong trying to send an email. Please wait a few minutes and try again.</p>"; |
76 | 76 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | } |
7 | 7 | |
8 | 8 | include_once '../../includes/easyparliament/init.php'; |
9 | -include_once INCLUDESPATH."easyparliament/glossary.php"; |
|
9 | +include_once INCLUDESPATH . "easyparliament/glossary.php"; |
|
10 | 10 | |
11 | 11 | $args = array( |
12 | 12 | 'sort' => "regexp_replace", |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | if ($term) { |
50 | - $DATA->set_page_metadata($this_page, 'title', $term['title'].': Glossary item'); |
|
50 | + $DATA->set_page_metadata($this_page, 'title', $term['title'] . ': Glossary item'); |
|
51 | 51 | $DATA->set_page_metadata($this_page, 'heading', $term['title']); |
52 | 52 | } else { |
53 | - $DATA->set_page_metadata ($this_page, 'title', $GLOSSARY->current_letter.': Glossary index'); |
|
54 | - $DATA->set_page_metadata ($this_page, 'heading', 'Glossary index'); |
|
53 | + $DATA->set_page_metadata($this_page, 'title', $GLOSSARY->current_letter . ': Glossary index'); |
|
54 | + $DATA->set_page_metadata($this_page, 'heading', 'Glossary index'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $PAGE->page_start(); |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | $URL->update(array("gl" => $GLOSSARY->next_term['glossary_id'])); |
71 | 71 | $next_link = $URL->generate('url'); |
72 | 72 | |
73 | - $nextprev = array ( |
|
74 | - 'next' => array ( |
|
73 | + $nextprev = array( |
|
74 | + 'next' => array( |
|
75 | 75 | 'url' => $next_link, |
76 | 76 | 'title' => 'Next term', |
77 | 77 | 'body' => $GLOSSARY->next_term['title'] |
78 | 78 | ), |
79 | - 'prev' => array ( |
|
79 | + 'prev' => array( |
|
80 | 80 | 'url' => $previous_link, |
81 | 81 | 'title' => 'Previous term', |
82 | 82 | 'body' => $GLOSSARY->previous_term['title'] |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | -$PAGE->stripe_end(array ( |
|
113 | - array ( |
|
112 | +$PAGE->stripe_end(array( |
|
113 | + array( |
|
114 | 114 | 'type' => 'nextprev', |
115 | 115 | 'content' => '' |
116 | 116 | ) |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $date = format_date($date, SHORTDATEFORMAT); |
36 | 36 | $time = format_time($time, TIMEFORMAT); |
37 | 37 | |
38 | - $count = $n+1; |
|
38 | + $count = $n + 1; |
|
39 | 39 | |
40 | 40 | $USERURL->insert(array('u'=>$comment['user_id'])); |
41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | if ($this_page == 'home') { |
50 | 50 | $MOREURL = new \MySociety\TheyWorkForYou\Url('comments_recent'); |
51 | 51 | ?> |
52 | - <p><a href="<?php echo $MOREURL->generate(); ?>#c<?php echo count($data['comments'])+1; ?>">See more annotations posted recently</a></p> |
|
52 | + <p><a href="<?php echo $MOREURL->generate(); ?>#c<?php echo count($data['comments']) + 1; ?>">See more annotations posted recently</a></p> |
|
53 | 53 | <?php |
54 | 54 | } |
55 | 55 | if ($this_page != 'home') { |
@@ -7,7 +7,7 @@ |
||
7 | 7 | </div> |
8 | 8 | <div class="business-section__primary"> |
9 | 9 | <?php |
10 | - if ( isset($divisions) && $divisions ) { |
|
10 | + if (isset($divisions) && $divisions) { |
|
11 | 11 | $current_date = ''; |
12 | 12 | ?> |
13 | 13 | <ul class="business-list"> |
@@ -1,6 +1,6 @@ |
||
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 | } ?> |
@@ -41,7 +41,7 @@ |
||
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"> |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <div class="calendar"> |
2 | - <?php if(isset($month)) { |
|
2 | + <?php if (isset($month)) { |
|
3 | 3 | // What is the first day of the month in question? |
4 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
4 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
5 | 5 | |
6 | 6 | // How many days does this month contain? |
7 | - $numberDays = date('t',$firstDayOfMonth); |
|
7 | + $numberDays = date('t', $firstDayOfMonth); |
|
8 | 8 | |
9 | 9 | // What is the name of the month in question? |
10 | 10 | $monthName = strftime('%B', $firstDayOfMonth); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | if (isset($info['onday'])) { |
13 | 13 | // 'onday' is like 'yyyy-mm-dd'. |
14 | 14 | $datebits = explode('-', $info['onday']); |
15 | - if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
15 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
16 | 16 | $toDay = $datebits[2]; |
17 | 17 | } else { |
18 | 18 | $toDay = ''; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <?php } |
40 | 40 | if (!isset($years)) { ?> |
41 | 41 | <div class="calendar__controls"> |
42 | - <?php if ( isset($prev) ) { ?> |
|
42 | + <?php if (isset($prev)) { ?> |
|
43 | 43 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">←</a> |
44 | 44 | <?php } else { ?> |
45 | 45 | <span class="calendar__controls__previous"> </span> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <span class="calendar__controls__current"> |
48 | 48 | <?= $monthName ?> <?= $year ?> |
49 | 49 | </span> |
50 | - <?php if ( isset($next) ) { ?> |
|
50 | + <?php if (isset($next)) { ?> |
|
51 | 51 | <a href="<?= $next['url'] ?>" class="calendar__controls__next">→</a> |
52 | 52 | <?php } else { ?> |
53 | 53 | <span class="calendar__controls__next"> </span> |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | // sittings - e.g. WH is only Tuesday-Thursday |
101 | 101 | if ($currentDay == $toDay) { |
102 | 102 | print '<td class="on"'; |
103 | - if ($recess[0] && $recess[0]!=1) { |
|
104 | - print ' title="'.$recess[0].'"'; |
|
103 | + if ($recess[0] && $recess[0] != 1) { |
|
104 | + print ' title="' . $recess[0] . '"'; |
|
105 | 105 | } |
106 | 106 | print '>'; |
107 | 107 | } elseif ($recess[0]) { |
108 | 108 | print '<td class="no"'; |
109 | - if ($recess[0]!=1) { |
|
110 | - print ' title="'.$recess[0].'"'; |
|
109 | + if ($recess[0] != 1) { |
|
110 | + print ' title="' . $recess[0] . '"'; |
|
111 | 111 | } |
112 | 112 | print '>'; |
113 | 113 | } else { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // Is the $currentDay a member of $dates? If so, |
118 | 118 | // the day should be linked. |
119 | - if (in_array($currentDay,$dates)) { |
|
119 | + if (in_array($currentDay, $dates)) { |
|
120 | 120 | |
121 | 121 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
122 | 122 | |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | </tr> |
155 | 155 | </tbody> |
156 | 156 | </table> |
157 | - <?php if(!isset($years)){ ?> |
|
157 | + <?php if (!isset($years)) { ?> |
|
158 | 158 | <div class="calendar__footer"> |
159 | 159 | <?php |
160 | 160 | $y = $urls['day']; |
161 | 161 | $y->reset(); |
162 | - $y->insert(array( 'y' => $year )); |
|
162 | + $y->insert(array('y' => $year)); |
|
163 | 163 | $url = $y->generate(); |
164 | 164 | ?> |
165 | 165 | <a href="<?= $url ?>"><?= sprintf(gettext('See all of %s'), $year) ?></a> |
@@ -12,20 +12,20 @@ discard block |
||
12 | 12 | ), |
13 | 13 | 2001 => array( |
14 | 14 | 1=>array('less'=>8), |
15 | - 2=>array('between'=>array(15,26)), |
|
16 | - 4=>array('between'=>array(10,23)), |
|
15 | + 2=>array('between'=>array(15, 26)), |
|
16 | + 4=>array('between'=>array(10, 23)), |
|
17 | 17 | 5=>array('more'=>13), |
18 | 18 | 6=>array('less'=>13), |
19 | 19 | 7=>array('more'=>20), |
20 | 20 | 8=>array('all'=>1), |
21 | 21 | 9=>array('less'=>14, 'more'=>14), |
22 | - 10=>array('less'=>4, 'between'=>array(4,8, 8,15)), |
|
22 | + 10=>array('less'=>4, 'between'=>array(4, 8, 8, 15)), |
|
23 | 23 | 12=>array('more'=>19) ), |
24 | 24 | 2002 => array( |
25 | 25 | 1=>array('less'=>8), |
26 | - 2=>array('between'=>array(14,25)), |
|
26 | + 2=>array('between'=>array(14, 25)), |
|
27 | 27 | 3=>array('more'=>26), |
28 | - 4=>array('less'=>3, 'between'=>array(3,10)), |
|
28 | + 4=>array('less'=>3, 'between'=>array(3, 10)), |
|
29 | 29 | 5=>array('more'=>24), |
30 | 30 | 6=>array('less'=>10), |
31 | 31 | 7=>array('more'=>24), |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | 12=>array('more'=>19) ), |
36 | 36 | 2003 => array( |
37 | 37 | 1=>array('less'=>7), |
38 | - 2=>array('between'=>array(13,24)), |
|
39 | - 4=>array('between'=>array(14,28)), |
|
38 | + 2=>array('between'=>array(13, 24)), |
|
39 | + 4=>array('between'=>array(14, 28)), |
|
40 | 40 | 5=>array('more'=>22), |
41 | 41 | 6=>array('less'=>3), |
42 | 42 | 7=>array('more'=>17), |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | 12=>array('more'=>18)), |
47 | 47 | 2004 => array( |
48 | 48 | 1=>array('less'=>5), |
49 | - 2=>array('between'=>array(12,23)), |
|
50 | - 4=>array('between'=>array(1,19)), |
|
49 | + 2=>array('between'=>array(12, 23)), |
|
50 | + 4=>array('between'=>array(1, 19)), |
|
51 | 51 | 5=>array('more'=>27), |
52 | 52 | 6=>array('less'=>7), |
53 | 53 | 7=>array('more'=>22), |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 12=>array('more'=>21) ), |
58 | 58 | 2005 => array( |
59 | 59 | 1=>array('less'=>10), |
60 | - 2=>array('between'=>array(10,21)), |
|
60 | + 2=>array('between'=>array(10, 21)), |
|
61 | 61 | 3=>array('more'=>24), |
62 | 62 | 4=>array('less'=>4, 'more'=>10), |
63 | 63 | 5=>array('less'=>11, 'more'=>26), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | 12=>array('more'=>20) ), |
70 | 70 | 2006 => array( |
71 | 71 | 1=>array('less'=>9), |
72 | - 2=>array('between'=>array(16,27)), |
|
72 | + 2=>array('between'=>array(16, 27)), |
|
73 | 73 | 3=>array('more'=>30), |
74 | 74 | 4=>array('less'=>18), |
75 | 75 | 5=>array('more'=>25), |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ), |
83 | 83 | 2007 => array( |
84 | 84 | 1=>array('less'=>8), |
85 | - 2=>array('between'=>array(8,19)), |
|
85 | + 2=>array('between'=>array(8, 19)), |
|
86 | 86 | 3=>array('more'=>29), |
87 | 87 | 4=>array('less'=>16), |
88 | 88 | 5=>array('more'=>24), |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | ), |
96 | 96 | 2008 => array( |
97 | 97 | 1=>array('less'=>7), |
98 | - 2=>array('between'=>array(7,18)), |
|
99 | - 4=>array('between'=>array(3,21)), |
|
98 | + 2=>array('between'=>array(7, 18)), |
|
99 | + 4=>array('between'=>array(3, 21)), |
|
100 | 100 | 5=>array('more'=>22), |
101 | 101 | 6=>array('less'=>2), |
102 | 102 | 7=>array('more'=>22), |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | ), |
108 | 108 | 2009 => array( |
109 | 109 | 1=>array('less'=>12), |
110 | - 2=>array('between'=>array(12,23)), |
|
111 | - 4=>array('between'=>array(2,20)), |
|
110 | + 2=>array('between'=>array(12, 23)), |
|
111 | + 4=>array('between'=>array(2, 20)), |
|
112 | 112 | 5=>array('more'=>21), |
113 | 113 | 6=>array('less'=>1), |
114 | 114 | 7=>array('more'=>21), |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ), |
120 | 120 | 2010 => array( |
121 | 121 | 1=>array('less'=>5), |
122 | - 2=>array('between'=>array(10,22)), |
|
122 | + 2=>array('between'=>array(10, 22)), |
|
123 | 123 | 3=>array('more'=>30), |
124 | 124 | 4=>array('less'=>6, 'more'=>8), |
125 | 125 | 5=>array('less'=>18, 'more'=>27), |
@@ -132,62 +132,62 @@ discard block |
||
132 | 132 | ), |
133 | 133 | 2011 => array( |
134 | 134 | 1=>array('less'=>10), |
135 | - 2=>array('between'=>array(17,28)), |
|
136 | - 4=>array('between'=>array(5,26)), |
|
135 | + 2=>array('between'=>array(17, 28)), |
|
136 | + 4=>array('between'=>array(5, 26)), |
|
137 | 137 | 5=>array('more'=>24), |
138 | 138 | 6=>array('less'=>7), |
139 | 139 | 7=>array('more'=>19), |
140 | 140 | 8=>array('all'=>1), |
141 | 141 | 9=>array('less'=>5, 'more'=>15), |
142 | 142 | 10=>array('less'=>10), |
143 | - 11=>array('between'=>array(15,21)), |
|
143 | + 11=>array('between'=>array(15, 21)), |
|
144 | 144 | 12=>array('more'=>20), |
145 | 145 | ), |
146 | 146 | 2012 => array( |
147 | 147 | 1=>array('less'=>10), |
148 | - 2=>array('between'=>array(9,20)), |
|
148 | + 2=>array('between'=>array(9, 20)), |
|
149 | 149 | 3=>array('more'=>27), |
150 | 150 | 4=>array('less'=>16), |
151 | 151 | 5=>array('more'=>24), |
152 | 152 | 6=>array('less'=>11), |
153 | 153 | 7=>array('more'=>17), |
154 | 154 | 8=>array('all'=>1), |
155 | - 9=>array('less'=>3,'more'=>18), |
|
155 | + 9=>array('less'=>3, 'more'=>18), |
|
156 | 156 | 10=>array('less'=>15), |
157 | - 11=>array('between'=>array(13,19)), |
|
157 | + 11=>array('between'=>array(13, 19)), |
|
158 | 158 | 12=>array('more'=>20) |
159 | 159 | ), |
160 | 160 | 2013 => array( |
161 | 161 | 1=>array('less'=>7), |
162 | - 2=>array('between'=>array(14,25)), |
|
162 | + 2=>array('between'=>array(14, 25)), |
|
163 | 163 | 3=>array('more'=>26), |
164 | 164 | 4=>array('less'=>15), |
165 | 165 | 5=>array('more'=>21), |
166 | 166 | 6=>array('less'=>3), |
167 | 167 | 7=>array('more'=>18), |
168 | 168 | 8=>array('all'=>1), |
169 | - 9=>array('less'=>2,'more'=>13), |
|
169 | + 9=>array('less'=>2, 'more'=>13), |
|
170 | 170 | 10=>array('less'=>8), |
171 | - 11=>array('between'=>array(12,18)), |
|
171 | + 11=>array('between'=>array(12, 18)), |
|
172 | 172 | 12=>array('more'=>19) |
173 | 173 | ), |
174 | 174 | 2014 => array( |
175 | 175 | 1=>array('less'=>6), |
176 | - 2=>array('between'=>array(13,24)), |
|
177 | - 4=>array('between'=>array(10,28)), |
|
178 | - 5=>array('between'=>array(1,6)) |
|
176 | + 2=>array('between'=>array(13, 24)), |
|
177 | + 4=>array('between'=>array(10, 28)), |
|
178 | + 5=>array('between'=>array(1, 6)) |
|
179 | 179 | ), |
180 | 180 | 2015 => array( |
181 | 181 | 7=>array('more'=>21), |
182 | 182 | 8=>array('all'=>1), |
183 | 183 | 9=>array('less'=>7, 'more'=>17), |
184 | 184 | 10=>array('less'=>12), |
185 | - 11=>array('between'=>array(10,16)), |
|
185 | + 11=>array('between'=>array(10, 16)), |
|
186 | 186 | 12=>array('more'=>17) |
187 | 187 | ), |
188 | 188 | 2016 => array( |
189 | 189 | 1=>array('less'=>5), |
190 | - 2=>array('between'=>array(11,22)) |
|
190 | + 2=>array('between'=>array(11, 22)) |
|
191 | 191 | ) |
192 | 192 | ); |
193 | 193 | # Lords differences |
@@ -199,15 +199,15 @@ discard block |
||
199 | 199 | $GLOBALS['recessdates'][101][2010][12]['more'] = 22; |
200 | 200 | $GLOBALS['recessdates'][101][2011] = array( |
201 | 201 | 1 => array('less'=>10), |
202 | - 2 => array('between'=>array(16,28)), |
|
203 | - 4 => array('between'=>array(6,26)), |
|
202 | + 2 => array('between'=>array(16, 28)), |
|
203 | + 4 => array('between'=>array(6, 26)), |
|
204 | 204 | 5 => array('more'=>25), |
205 | 205 | 6 => array('less'=>6), |
206 | 206 | 7 => array('more'=>20), |
207 | 207 | 8 => array('all'=>1), |
208 | 208 | 9 => array('less'=>5, 'more'=>15), |
209 | 209 | 10 => array('less'=>3), |
210 | - 11=>array('between'=>array(16,21)), |
|
210 | + 11=>array('between'=>array(16, 21)), |
|
211 | 211 | 12 => array('more'=>21), |
212 | 212 | ); |
213 | 213 | |
@@ -216,74 +216,74 @@ discard block |
||
216 | 216 | 1999 => array( |
217 | 217 | 7 => array('more' => 2), |
218 | 218 | 8 => array('less' => 31), |
219 | - 10 => array('between' => array(8,25)), |
|
219 | + 10 => array('between' => array(8, 25)), |
|
220 | 220 | 12 => array('more' => 17) |
221 | 221 | ), |
222 | 222 | 2000 => array( |
223 | 223 | 1 => array('less' => 10), |
224 | - 4 => array('between' => array(7,25)), |
|
224 | + 4 => array('between' => array(7, 25)), |
|
225 | 225 | 7 => array('more' => 7), |
226 | 226 | 8 => array('all' => 1), |
227 | 227 | 9 => array('less' => 4), |
228 | - 10 => array('between' => array(6,23)), |
|
228 | + 10 => array('between' => array(6, 23)), |
|
229 | 229 | 12 => array('more' => 20) |
230 | 230 | ), |
231 | 231 | 2001 => array( |
232 | 232 | 1=>array('less'=>8), |
233 | - 2=>array('between'=>array(16,26)), |
|
234 | - 4=>array('between'=>array(6,23)), |
|
233 | + 2=>array('between'=>array(16, 26)), |
|
234 | + 4=>array('between'=>array(6, 23)), |
|
235 | 235 | 6=>array('more'=>29), |
236 | 236 | 7=>array('all'=>1), |
237 | 237 | 8=>array('all'=>1), |
238 | 238 | 9=>array('less'=>3), |
239 | - 10=>array('between'=>array(5,22)), |
|
239 | + 10=>array('between'=>array(5, 22)), |
|
240 | 240 | 12=>array('more'=>21) ), |
241 | 241 | 2002 => array( |
242 | 242 | 1=>array('less'=>7), |
243 | - 2=>array('between'=>array(15,25)), |
|
243 | + 2=>array('between'=>array(15, 25)), |
|
244 | 244 | 3=>array('more'=>28), |
245 | 245 | 4=>array('less'=>15), |
246 | 246 | 7=>array('more'=>10), |
247 | 247 | 8=>array('all'=>1), |
248 | 248 | 9=>array('less'=>2), |
249 | - 10=>array('between'=>array(11,28)), |
|
249 | + 10=>array('between'=>array(11, 28)), |
|
250 | 250 | 12=>array('more'=>20) ), |
251 | 251 | 2003 => array( |
252 | 252 | 1=>array('less'=>6), |
253 | - 4=>array('between'=>array(0,31)), |
|
253 | + 4=>array('between'=>array(0, 31)), |
|
254 | 254 | 5=>array('less'=>2), |
255 | 255 | 6=>array('more'=>27), |
256 | 256 | 7=>array('all'=>1), |
257 | 257 | 8=>array('all'=>1), |
258 | - 10=>array('between'=>array(10,27)), |
|
258 | + 10=>array('between'=>array(10, 27)), |
|
259 | 259 | 12=>array('more'=>19)), |
260 | 260 | 2004 => array( |
261 | 261 | 1=>array('less'=>5), |
262 | - 2=>array('between'=>array(13,23)), |
|
263 | - 4=>array('between'=>array(2,19)), |
|
262 | + 2=>array('between'=>array(13, 23)), |
|
263 | + 4=>array('between'=>array(2, 19)), |
|
264 | 264 | 6=>array('more'=>25), |
265 | 265 | 7=>array('all'=>1), |
266 | 266 | 8=>array('less'=>30), |
267 | - 10=>array('between'=>array(10,23)), |
|
267 | + 10=>array('between'=>array(10, 23)), |
|
268 | 268 | 12=>array('more'=>26) ), |
269 | 269 | 2005 => array( |
270 | 270 | 1=>array('less'=>8), |
271 | - 2=>array('between'=>array(11,21)), |
|
271 | + 2=>array('between'=>array(11, 21)), |
|
272 | 272 | 3=>array('more'=>24), |
273 | 273 | 4=>array('less'=>11), |
274 | 274 | 7=>array('more'=>1), |
275 | 275 | 8=>array('all'=>1), |
276 | 276 | 9=>array('less'=>5), |
277 | - 10=>array('between'=>array(7,24)), |
|
277 | + 10=>array('between'=>array(7, 24)), |
|
278 | 278 | 12=>array('more'=>23) ), |
279 | 279 | 2006 => array( |
280 | 280 | 1=>array('less'=>9), |
281 | - 2=>array('between'=>array(10,20)), |
|
281 | + 2=>array('between'=>array(10, 20)), |
|
282 | 282 | 4=>array('less'=>18), |
283 | 283 | 7=>array('more'=>0), |
284 | 284 | 8=>array('all'=>1), |
285 | 285 | 9=>array('less'=>4), |
286 | - 10=>array('between'=>array(6,23)), |
|
286 | + 10=>array('between'=>array(6, 23)), |
|
287 | 287 | 12=>array('more'=>22), |
288 | 288 | ), |
289 | 289 | 2007 => array( |
@@ -293,18 +293,18 @@ discard block |
||
293 | 293 | 7=>array('all'=>1), |
294 | 294 | 8=>array('all'=>1), |
295 | 295 | 9=>array('less'=>3), |
296 | - 10=>array('between'=>array(5,22)), |
|
296 | + 10=>array('between'=>array(5, 22)), |
|
297 | 297 | 12=>array('more'=>21), |
298 | 298 | ), |
299 | 299 | 2008 => array( |
300 | 300 | 1=>array('less'=>5), |
301 | - 2=>array('between'=>array(8,18)), |
|
301 | + 2=>array('between'=>array(8, 18)), |
|
302 | 302 | 3=>array('more'=>28), |
303 | 303 | 4=>array('less'=>14), |
304 | 304 | 6=>array('more'=>27), |
305 | 305 | 7=>array('all'=>1), |
306 | 306 | 8=>array('all'=>1), |
307 | - 10=>array('between'=>array(10,27)), |
|
307 | + 10=>array('between'=>array(10, 27)), |
|
308 | 308 | ), |
309 | 309 | ); |
310 | 310 | |
@@ -370,45 +370,45 @@ discard block |
||
370 | 370 | $to = "$year-9-" . $dates[$year][9]['less']; |
371 | 371 | } |
372 | 372 | } |
373 | - if ( (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) |
|
373 | + if ((isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) |
|
374 | 374 | || (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) |
375 | 375 | || (isset($dates[$year][$month]['between']) && $day > $dates[$year][$month]['between'][0] && $day < $dates[$year][$month]['between'][1]) |
376 | - || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) ) { |
|
376 | + || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3])) { |
|
377 | 377 | switch ($month) { |
378 | 378 | case 1: case 12: $recess = 'Christmas Recess'; break; |
379 | - case 2: if ($body==1 || $body==101) { |
|
379 | + case 2: if ($body == 1 || $body == 101) { |
|
380 | 380 | $recess = 'Half Term Week'; |
381 | - } elseif ($body==4) { |
|
381 | + } elseif ($body == 4) { |
|
382 | 382 | $recess = 'February Recess'; |
383 | 383 | } |
384 | 384 | break; |
385 | - case 3: if ($body==1 || $body==101) { |
|
385 | + case 3: if ($body == 1 || $body == 101) { |
|
386 | 386 | $recess = 'Easter Recess'; |
387 | - } elseif ($body==4) { |
|
387 | + } elseif ($body == 4) { |
|
388 | 388 | $recess = 'Spring Recess'; |
389 | 389 | } |
390 | 390 | break; |
391 | 391 | case 4: if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
392 | 392 | $recess = 'Election Recess'; |
393 | - } elseif ($body==4 && $year==2003) { |
|
393 | + } elseif ($body == 4 && $year == 2003) { |
|
394 | 394 | $recess = 'Election Recess'; |
395 | - } elseif ($body==1 || $body==101) { |
|
395 | + } elseif ($body == 1 || $body == 101) { |
|
396 | 396 | $recess = 'Easter Recess'; |
397 | - } elseif ($body==4) { |
|
397 | + } elseif ($body == 4) { |
|
398 | 398 | $recess = 'Spring Recess'; |
399 | 399 | } |
400 | 400 | break; |
401 | - case 5: if ($year==2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) { |
|
401 | + case 5: if ($year == 2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) { |
|
402 | 402 | $recess = 'Election Recess'; |
403 | 403 | } else { |
404 | 404 | $recess = 'Whit Recess'; |
405 | 405 | } |
406 | 406 | break; |
407 | - case 6: if ($year==2001) { |
|
407 | + case 6: if ($year == 2001) { |
|
408 | 408 | $recess = 'Election Recess'; |
409 | - } elseif ($body==1 || $body==101) { |
|
409 | + } elseif ($body == 1 || $body == 101) { |
|
410 | 410 | $recess = 'Whit Recess'; |
411 | - } elseif ($body==4) { |
|
411 | + } elseif ($body == 4) { |
|
412 | 412 | $recess = 'Summer Recess'; |
413 | 413 | } else { |
414 | 414 | trigger_error("Argh6"); |
@@ -418,17 +418,17 @@ discard block |
||
418 | 418 | break; |
419 | 419 | case 9: if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
420 | 420 | $recess = 'Summer Recess'; |
421 | - } elseif ($body==1 || $body==101) { |
|
421 | + } elseif ($body == 1 || $body == 101) { |
|
422 | 422 | $recess = 'Conference Recess'; |
423 | 423 | } else { |
424 | 424 | trigger_error("Argh9"); |
425 | 425 | } |
426 | 426 | break; |
427 | - case 10: if ($body==1 || $body==101) { |
|
427 | + case 10: if ($body == 1 || $body == 101) { |
|
428 | 428 | $recess = 'Conference Recess'; |
429 | - } elseif ($body==4) { |
|
429 | + } elseif ($body == 4) { |
|
430 | 430 | $recess = 'Autumn Recess'; |
431 | - } elseif ($body==5) { |
|
431 | + } elseif ($body == 5) { |
|
432 | 432 | $recess = 'Halloween Recess'; |
433 | 433 | } |
434 | 434 | break; |
@@ -438,12 +438,12 @@ discard block |
||
438 | 438 | } |
439 | 439 | if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
440 | 440 | $to = "$year-$month-" . $dates[$year][$month]['less']; |
441 | - if ($month==1) { |
|
442 | - $from = ($year-1)."-12-" . $dates[$year-1][12]['more']; |
|
441 | + if ($month == 1) { |
|
442 | + $from = ($year - 1) . "-12-" . $dates[$year - 1][12]['more']; |
|
443 | 443 | } else { |
444 | - for ($newmonth = $month-1; $newmonth>=1; $newmonth--) { |
|
444 | + for ($newmonth = $month - 1; $newmonth >= 1; $newmonth--) { |
|
445 | 445 | if (isset($dates[$year][$newmonth]['more'])) { |
446 | - $from = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['more']; |
|
446 | + $from = "$year-" . ($newmonth) . "-" . $dates[$year][$newmonth]['more']; |
|
447 | 447 | break; |
448 | 448 | } |
449 | 449 | } |
@@ -451,12 +451,12 @@ discard block |
||
451 | 451 | } |
452 | 452 | if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
453 | 453 | $from = "$year-$month-" . $dates[$year][$month]['more']; |
454 | - if ($month==12) { |
|
455 | - $to = ($year+1)."-01-" . $dates[$year+1][1]['less']; |
|
454 | + if ($month == 12) { |
|
455 | + $to = ($year + 1) . "-01-" . $dates[$year + 1][1]['less']; |
|
456 | 456 | } else { |
457 | - for ($newmonth = $month+1; $newmonth<=12; $newmonth++) { |
|
457 | + for ($newmonth = $month + 1; $newmonth <= 12; $newmonth++) { |
|
458 | 458 | if (isset($dates[$year][$newmonth]['less'])) { |
459 | - $to = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['less']; |
|
459 | + $to = "$year-" . ($newmonth) . "-" . $dates[$year][$newmonth]['less']; |
|
460 | 460 | break; |
461 | 461 | } |
462 | 462 | } |
@@ -21,20 +21,20 @@ discard block |
||
21 | 21 | */ |
22 | 22 | |
23 | 23 | // This handles basic insertion and approval functions for all epobjects |
24 | -include_once INCLUDESPATH."easyparliament/searchengine.php"; |
|
24 | +include_once INCLUDESPATH . "easyparliament/searchengine.php"; |
|
25 | 25 | |
26 | 26 | class GLOSSARY { |
27 | 27 | |
28 | - public $num_terms; // how many glossary entries do we have |
|
28 | + public $num_terms; // how many glossary entries do we have |
|
29 | 29 | // (changes depending on how GLOSSARY is called |
30 | - public $hansard_count; // how many times does the phrase appear in hansard? |
|
31 | - public $query; // search term |
|
32 | - public $glossary_id; // if this is set then we only have 1 glossary term |
|
33 | - public $current_term; // will only be set if we have a valid epobject_id |
|
30 | + public $hansard_count; // how many times does the phrase appear in hansard? |
|
31 | + public $query; // search term |
|
32 | + public $glossary_id; // if this is set then we only have 1 glossary term |
|
33 | + public $current_term; // will only be set if we have a valid epobject_id |
|
34 | 34 | public $current_letter; |
35 | 35 | |
36 | 36 | // constructor... |
37 | - public function __construct($args=array()) { |
|
37 | + public function __construct($args = array()) { |
|
38 | 38 | // We can optionally start the glossary with one of several arguments |
39 | 39 | // 1. glossary_id - treat the glossary as a single term |
40 | 40 | // 2. glossary_term - search within glossary for a term |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | |
74 | 74 | // These stop stupid submissions. |
75 | 75 | // everything should be lowercase. |
76 | - $this->stopwords = array( "the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate" ); |
|
76 | + $this->stopwords = array("the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate"); |
|
77 | 77 | |
78 | 78 | } |
79 | 79 | |
80 | - public function get_glossary_item($args=array()) { |
|
80 | + public function get_glossary_item($args = array()) { |
|
81 | 81 | // Search for and fetch glossary item with title or glossary_id |
82 | 82 | // We could also search glossary text that contains the title text, for cross references |
83 | 83 | |
84 | 84 | $this->alphabet = array(); |
85 | - foreach (range ("A", "Z") as $letter) { |
|
85 | + foreach (range("A", "Z") as $letter) { |
|
86 | 86 | $this->alphabet[$letter] = array(); |
87 | 87 | } |
88 | 88 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | - public function search_glossary($args=array()) { |
|
140 | + public function search_glossary($args = array()) { |
|
141 | 141 | // Search for and fetch glossary item with a title |
142 | 142 | // Useful for the search page, and nowhere else (so far) |
143 | 143 | |
@@ -189,12 +189,12 @@ discard block |
||
189 | 189 | global $THEUSER; |
190 | 190 | |
191 | 191 | if ($data['title'] == '') { |
192 | - error ("Sorry, you can't define a term without a title"); |
|
192 | + error("Sorry, you can't define a term without a title"); |
|
193 | 193 | return false; |
194 | 194 | } |
195 | 195 | |
196 | 196 | if ($data['body'] == '') { |
197 | - error ("You haven't entered a definition!"); |
|
197 | + error("You haven't entered a definition!"); |
|
198 | 198 | return false; |
199 | 199 | } |
200 | 200 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | } |
249 | 249 | |
250 | - public function glossarise($body, $tokenize=0, $urlize=0) { |
|
250 | + public function glossarise($body, $tokenize = 0, $urlize = 0) { |
|
251 | 251 | // Turn a body of text into a link-up wonderland of glossary joy |
252 | 252 | |
253 | 253 | global $this_page; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $replacewords[] = "<strong>\\1</strong>"; |
291 | 291 | } else { |
292 | 292 | if ($this_page == "admin_glossary") { |
293 | - $link_url = "#gl".$glossary_id; |
|
293 | + $link_url = "#gl" . $glossary_id; |
|
294 | 294 | } else { |
295 | 295 | $link_url = $URL->generate('url'); |
296 | 296 | } |
@@ -29,11 +29,11 @@ |
||
29 | 29 | if ($p_id) { |
30 | 30 | $qq = $db->query('(select hansard.epobject_id from hansard, uservotes |
31 | 31 | where hansard.epobject_id=uservotes.epobject_id |
32 | - and hansard.person_id = '.$p_id.' and major=3 and minor=2 and left_house>curdate()) |
|
32 | + and hansard.person_id = '.$p_id . ' and major=3 and minor=2 and left_house>curdate()) |
|
33 | 33 | union |
34 | 34 | (select hansard.epobject_id from hansard,member,anonvotes |
35 | 35 | where hansard.epobject_id=anonvotes.epobject_id |
36 | - and hansard.person_id = '.$p_id.' and major=3 and minor=2 and left_house>curdate())'); |
|
36 | + and hansard.person_id = '.$p_id . ' and major=3 and minor=2 and left_house>curdate())'); |
|
37 | 37 | $wrans_with_votes = $qq->rows(); |
38 | 38 | } else { |
39 | 39 | $wrans_with_votes = ''; |