@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | * |
11 | 11 | */ |
12 | 12 | |
13 | -include_once INCLUDESPATH . "easyparliament/init.php"; |
|
14 | -require_once INCLUDESPATH . "../../commonlib/phplib/random.php"; |
|
15 | -require_once INCLUDESPATH . "../../commonlib/phplib/auth.php"; |
|
13 | +include_once INCLUDESPATH."easyparliament/init.php"; |
|
14 | +require_once INCLUDESPATH."../../commonlib/phplib/random.php"; |
|
15 | +require_once INCLUDESPATH."../../commonlib/phplib/auth.php"; |
|
16 | 16 | |
17 | 17 | // increment this each time you change the question so |
18 | 18 | // the cookie magic works |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | if ($hide_question) { |
34 | 34 | $always_ask = 0; |
35 | 35 | $show_survey_qn = $current_question; |
36 | - setcookie('survey', $current_question, time()+60*60*24*365, '/'); |
|
36 | + setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/'); |
|
37 | 37 | } elseif ($has_answered_question == $current_question && !$always_ask) { |
38 | 38 | $show_survey_qn = $current_question; |
39 | - setcookie('survey', $current_question, time()+60*60*24*365, '/'); |
|
39 | + setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/'); |
|
40 | 40 | } elseif (isset($_COOKIE['survey'])) { |
41 | 41 | $show_survey_qn = $_COOKIE['survey']; |
42 | 42 | } |
@@ -49,16 +49,16 @@ discard block |
||
49 | 49 | if ($show_survey_qn < $current_question && !$has_answered_question) { |
50 | 50 | $page_url = ''; |
51 | 51 | $hide_url = ''; |
52 | - if ( in_array( $this_page, array('mp', 'peer', 'msp', 'mla', 'royal') ) ) { |
|
52 | + if (in_array($this_page, array('mp', 'peer', 'msp', 'mla', 'royal'))) { |
|
53 | 53 | global $MEMBER; |
54 | - $page_url = $MEMBER->url(true) . "?answered_survey=$current_question"; |
|
55 | - $hide_url = $MEMBER->url() . "?hide_survey=$current_question"; |
|
54 | + $page_url = $MEMBER->url(true)."?answered_survey=$current_question"; |
|
55 | + $hide_url = $MEMBER->url()."?hide_survey=$current_question"; |
|
56 | 56 | } else { |
57 | 57 | $URL = new URL($this_page); |
58 | - $URL->insert(array('answered_survey' => $current_question )); |
|
59 | - $page_url = 'https://' . DOMAIN . $URL->generate(); |
|
58 | + $URL->insert(array('answered_survey' => $current_question)); |
|
59 | + $page_url = 'https://'.DOMAIN.$URL->generate(); |
|
60 | 60 | $URL = new URL($this_page); |
61 | - $URL->insert(array('hide_survey' => $current_question )); |
|
61 | + $URL->insert(array('hide_survey' => $current_question)); |
|
62 | 62 | $hide_url = $URL->generate(); |
63 | 63 | } |
64 | 64 |
@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | list($firstyear, $firstmonth, $day) = explode('-', $min_future_date); |
34 | 34 | list($finalyear, $finalmonth, $day) = explode('-', $max_future_date); |
35 | 35 | |
36 | -$q = $db->query("SELECT DISTINCT(event_date) AS event_date FROM future |
|
36 | +$q = $db->query("SELECT DISTINCT(event_date) AS event_date FROM future |
|
37 | 37 | WHERE event_date >= :firstdate |
38 | 38 | AND event_date <= :finaldate |
39 | 39 | AND deleted = 0 |
40 | 40 | ORDER BY event_date ASC |
41 | 41 | ", array( |
42 | - ':firstdate' => $firstyear . '-' . $firstmonth . '-01', |
|
43 | - ':finaldate' => $finalyear . '-' . $finalmonth . '-31' |
|
42 | + ':firstdate' => $firstyear.'-'.$firstmonth.'-01', |
|
43 | + ':finaldate' => $finalyear.'-'.$finalmonth.'-31' |
|
44 | 44 | )); |
45 | 45 | |
46 | 46 | if ($q->rows() > 0) { |
47 | 47 | $years = array(); |
48 | - for ($row=0; $row<$q->rows(); $row++) { |
|
48 | + for ($row = 0; $row < $q->rows(); $row++) { |
|
49 | 49 | list($year, $month, $day) = explode('-', $q->field($row, 'event_date')); |
50 | 50 | $month = intval($month); |
51 | 51 | $years[$year][$month][] = intval($day); |
@@ -77,6 +77,6 @@ discard block |
||
77 | 77 | $data['years'] = $years; |
78 | 78 | } |
79 | 79 | |
80 | -include INCLUDESPATH . 'easyparliament/templates/html/hansard_calendar.php'; |
|
80 | +include INCLUDESPATH.'easyparliament/templates/html/hansard_calendar.php'; |
|
81 | 81 | |
82 | 82 | $PAGE->block_end(); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | $this->block_start(array('title'=>"Site news", 'url'=>$sitenewsurl)); |
11 | 11 | |
12 | -include BASEDIR . '/news/home_page_include.php'; |
|
12 | +include BASEDIR.'/news/home_page_include.php'; |
|
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <p><a href="<?php echo $archiveurl; ?>">Archive</a></p> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | $url = $ARCHIVEURL->generate(); |
6 | 6 | |
7 | 7 | $this->block_start(array('title'=>'News Archives', 'url'=>$url)); |
8 | -include BASEDIR . '/news/sidebar_archives.php'; |
|
8 | +include BASEDIR.'/news/sidebar_archives.php'; |
|
9 | 9 | $this->block_end(); |
10 | 10 | |
11 | 11 | $this->block_start(array('title'=>'RSS/XML')); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $rssurl = $RSSURL->generate(); |
14 | 14 | |
15 | 15 | $HELPURL = new URL('help'); |
16 | -$helpurl = $HELPURL->generate() . '#rss'; |
|
16 | +$helpurl = $HELPURL->generate().'#rss'; |
|
17 | 17 | ?> |
18 | 18 | |
19 | 19 | <p><a href="<?php echo $rssurl; ?>">RSS feed of recent posts</a> (<a href="<?php echo $helpurl; ?>">?</a>)</p> |
@@ -210,8 +210,8 @@ |
||
210 | 210 | array(':epobject_id' => $this->epobject_id)); |
211 | 211 | |
212 | 212 | if ($q->rows() > 0) { |
213 | - // If you change stuff here, you might have to change it in |
|
214 | - // $COMMENTLIST->_get_comment_data() too... |
|
213 | + // If you change stuff here, you might have to change it in |
|
214 | + // $COMMENTLIST->_get_comment_data() too... |
|
215 | 215 | |
216 | 216 | $gid = fix_gid_from_db($q->field(0, 'gid')); // In includes/utility.php |
217 | 217 |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | public $body = ''; |
32 | 32 | public $posted = ''; |
33 | 33 | public $visible = false; |
34 | - public $modflagged = NULL; // Is a datetime when set. |
|
35 | - public $firstname = ''; // Of the person who posted it. |
|
34 | + public $modflagged = NULL; // Is a datetime when set. |
|
35 | + public $firstname = ''; // Of the person who posted it. |
|
36 | 36 | public $lastname = ''; |
37 | 37 | public $url = ''; |
38 | 38 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public $exists = false; |
42 | 42 | |
43 | 43 | |
44 | - public function __construct($comment_id='') { |
|
44 | + public function __construct($comment_id = '') { |
|
45 | 45 | |
46 | 46 | $this->db = new ParlDB; |
47 | 47 | |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | if ($q->rows() > 0) { |
70 | 70 | |
71 | 71 | $this->comment_id = $comment_id; |
72 | - $this->user_id = $q->field(0, 'user_id'); |
|
72 | + $this->user_id = $q->field(0, 'user_id'); |
|
73 | 73 | $this->epobject_id = $q->field(0, 'epobject_id'); |
74 | - $this->body = $q->field(0, 'body'); |
|
75 | - $this->posted = $q->field(0, 'posted'); |
|
76 | - $this->visible = $q->field(0, 'visible'); |
|
77 | - $this->modflagged = $q->field(0, 'modflagged'); |
|
74 | + $this->body = $q->field(0, 'body'); |
|
75 | + $this->posted = $q->field(0, 'posted'); |
|
76 | + $this->visible = $q->field(0, 'visible'); |
|
77 | + $this->modflagged = $q->field(0, 'modflagged'); |
|
78 | 78 | |
79 | 79 | // Sets the URL and username for this comment. Duh. |
80 | 80 | $this->_set_url(); |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | public function comments_enabled() { return $this->comments_enabled; } |
105 | 105 | |
106 | 106 | |
107 | - public function display($format='html', $template='comments') { |
|
107 | + public function display($format = 'html', $template = 'comments') { |
|
108 | 108 | |
109 | - $data['comments'][0] = array ( |
|
109 | + $data['comments'][0] = array( |
|
110 | 110 | 'comment_id' => $this->comment_id, |
111 | 111 | 'user_id' => $this->user_id, |
112 | 112 | 'epobject_id' => $this->epobject_id, |
@@ -142,19 +142,19 @@ discard block |
||
142 | 142 | $flag = 'NULL'; |
143 | 143 | |
144 | 144 | } else { |
145 | - $PAGE->error_message ("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!"); |
|
145 | + $PAGE->error_message("Why are you trying to switch this comment's modflag to '"._htmlentities($switch)."'!"); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | $q = $this->db->query("UPDATE comments |
149 | 149 | SET modflagged = $flag |
150 | - WHERE comment_id = '" . $this->comment_id . "' |
|
150 | + WHERE comment_id = '".$this->comment_id."' |
|
151 | 151 | "); |
152 | 152 | |
153 | 153 | if ($q->success()) { |
154 | 154 | $this->modflagged = $date; |
155 | 155 | return true; |
156 | 156 | } else { |
157 | - $message = array ( |
|
157 | + $message = array( |
|
158 | 158 | 'title' => 'Sorry', |
159 | 159 | 'text' => "We couldn't update the annotation's modflag." |
160 | 160 | ); |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | global $THEUSER, $PAGE; |
172 | 172 | |
173 | 173 | if ($THEUSER->is_able_to('deletecomment')) { |
174 | - $q = $this->db->query("UPDATE comments SET visible = '0' WHERE comment_id = '" . $this->comment_id . "'"); |
|
174 | + $q = $this->db->query("UPDATE comments SET visible = '0' WHERE comment_id = '".$this->comment_id."'"); |
|
175 | 175 | |
176 | 176 | if ($q->success()) { |
177 | 177 | return true; |
178 | 178 | } else { |
179 | - $message = array ( |
|
179 | + $message = array( |
|
180 | 180 | 'title' => 'Sorry', |
181 | 181 | 'text' => "We were unable to delete the annotation." |
182 | 182 | ); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | } else { |
188 | - $message = array ( |
|
188 | + $message = array( |
|
189 | 189 | 'title' => 'Sorry', |
190 | 190 | 'text' => "You are not authorised to delete annotations." |
191 | 191 | ); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | |
221 | 221 | $URL = new URL($page); |
222 | 222 | $URL->insert(array('id'=>$gid)); |
223 | - $this->url = $URL->generate() . '#c' . $this->comment_id; |
|
223 | + $this->url = $URL->generate().'#c'.$this->comment_id; |
|
224 | 224 | } |
225 | 225 | } |
226 | 226 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public $body = ''; |
32 | 32 | public $posted = ''; |
33 | 33 | public $visible = false; |
34 | - public $modflagged = NULL; // Is a datetime when set. |
|
34 | + public $modflagged = null; // Is a datetime when set. |
|
35 | 35 | public $firstname = ''; // Of the person who posted it. |
36 | 36 | public $lastname = ''; |
37 | 37 | public $url = ''; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $flag = "'$date'"; |
139 | 139 | |
140 | 140 | } elseif ($switch == 'off') { |
141 | - $date = NULL; |
|
141 | + $date = null; |
|
142 | 142 | $flag = 'NULL'; |
143 | 143 | |
144 | 144 | } else { |
@@ -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 | |
@@ -358,50 +358,50 @@ discard block |
||
358 | 358 | if (isset($dates[$year][$month]['all'])) { |
359 | 359 | $recess = 'Summer Recess'; |
360 | 360 | if (isset($dates[$year][7]['all'])) { |
361 | - $from = "$year-6-" . $dates[$year][6]['more']; |
|
361 | + $from = "$year-6-".$dates[$year][6]['more']; |
|
362 | 362 | } else { |
363 | - $from = "$year-7-" . $dates[$year][7]['more']; |
|
363 | + $from = "$year-7-".$dates[$year][7]['more']; |
|
364 | 364 | } |
365 | 365 | if (!isset($dates[$year][9])) |
366 | 366 | $to = "$year-08-31"; |
367 | 367 | elseif (isset($dates[$year][9]['all'])) |
368 | - $to = "$year-10-" . $dates[$year][10]['less']; |
|
368 | + $to = "$year-10-".$dates[$year][10]['less']; |
|
369 | 369 | else |
370 | - $to = "$year-9-" . $dates[$year][9]['less']; |
|
370 | + $to = "$year-9-".$dates[$year][9]['less']; |
|
371 | 371 | } |
372 | - if ( (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) |
|
372 | + if ((isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) |
|
373 | 373 | || (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) |
374 | 374 | || (isset($dates[$year][$month]['between']) && $day > $dates[$year][$month]['between'][0] && $day < $dates[$year][$month]['between'][1]) |
375 | - || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) ) { |
|
375 | + || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3])) { |
|
376 | 376 | switch ($month) { |
377 | 377 | case 1: case 12: $recess = 'Christmas Recess'; break; |
378 | - case 2: if ($body==1 || $body==101) $recess = 'Half Term Week'; |
|
379 | - elseif ($body==4) $recess = 'February Recess'; |
|
378 | + case 2: if ($body == 1 || $body == 101) $recess = 'Half Term Week'; |
|
379 | + elseif ($body == 4) $recess = 'February Recess'; |
|
380 | 380 | break; |
381 | - case 3: if ($body==1 || $body==101) $recess = 'Easter Recess'; |
|
382 | - elseif ($body==4) $recess = 'Spring Recess'; |
|
381 | + case 3: if ($body == 1 || $body == 101) $recess = 'Easter Recess'; |
|
382 | + elseif ($body == 4) $recess = 'Spring Recess'; |
|
383 | 383 | break; |
384 | 384 | case 4: if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
385 | 385 | $recess = 'Election Recess'; |
386 | - } elseif ($body==4 && $year==2003) { |
|
386 | + } elseif ($body == 4 && $year == 2003) { |
|
387 | 387 | $recess = 'Election Recess'; |
388 | - } elseif ($body==1 || $body==101) { |
|
388 | + } elseif ($body == 1 || $body == 101) { |
|
389 | 389 | $recess = 'Easter Recess'; |
390 | - } elseif ($body==4) { |
|
390 | + } elseif ($body == 4) { |
|
391 | 391 | $recess = 'Spring Recess'; |
392 | 392 | } |
393 | 393 | break; |
394 | - case 5: if ($year==2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) { |
|
394 | + case 5: if ($year == 2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) { |
|
395 | 395 | $recess = 'Election Recess'; |
396 | 396 | } else { |
397 | 397 | $recess = 'Whit Recess'; |
398 | 398 | } |
399 | 399 | break; |
400 | - case 6: if ($year==2001) { |
|
400 | + case 6: if ($year == 2001) { |
|
401 | 401 | $recess = 'Election Recess'; |
402 | - } elseif ($body==1 || $body==101) { |
|
402 | + } elseif ($body == 1 || $body == 101) { |
|
403 | 403 | $recess = 'Whit Recess'; |
404 | - } elseif ($body==4) { |
|
404 | + } elseif ($body == 4) { |
|
405 | 405 | $recess = 'Summer Recess'; |
406 | 406 | } else { |
407 | 407 | trigger_error("Argh6"); |
@@ -411,53 +411,53 @@ discard block |
||
411 | 411 | break; |
412 | 412 | case 9: if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
413 | 413 | $recess = 'Summer Recess'; |
414 | - } elseif ($body==1 || $body==101) { |
|
414 | + } elseif ($body == 1 || $body == 101) { |
|
415 | 415 | $recess = 'Conference Recess'; |
416 | 416 | } else { |
417 | 417 | trigger_error("Argh9"); |
418 | 418 | } |
419 | 419 | break; |
420 | - case 10: if ($body==1 || $body==101) $recess = 'Conference Recess'; |
|
421 | - elseif ($body==4) $recess = 'Autumn Recess'; |
|
422 | - elseif ($body==5) $recess = 'Halloween Recess'; |
|
420 | + case 10: if ($body == 1 || $body == 101) $recess = 'Conference Recess'; |
|
421 | + elseif ($body == 4) $recess = 'Autumn Recess'; |
|
422 | + elseif ($body == 5) $recess = 'Halloween Recess'; |
|
423 | 423 | break; |
424 | 424 | case 11: $recess = 'Autumn Recess'; |
425 | 425 | break; |
426 | 426 | default: $recess = 1; |
427 | 427 | } |
428 | 428 | if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
429 | - $to = "$year-$month-" . $dates[$year][$month]['less']; |
|
430 | - if ($month==1) |
|
431 | - $from = ($year-1)."-12-" . $dates[$year-1][12]['more']; |
|
429 | + $to = "$year-$month-".$dates[$year][$month]['less']; |
|
430 | + if ($month == 1) |
|
431 | + $from = ($year - 1)."-12-".$dates[$year - 1][12]['more']; |
|
432 | 432 | else { |
433 | - for ($newmonth = $month-1; $newmonth>=1; $newmonth--) { |
|
433 | + for ($newmonth = $month - 1; $newmonth >= 1; $newmonth--) { |
|
434 | 434 | if (isset($dates[$year][$newmonth]['more'])) { |
435 | - $from = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['more']; |
|
435 | + $from = "$year-".($newmonth)."-".$dates[$year][$newmonth]['more']; |
|
436 | 436 | break; |
437 | 437 | } |
438 | 438 | } |
439 | 439 | } |
440 | 440 | } |
441 | 441 | if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
442 | - $from = "$year-$month-" . $dates[$year][$month]['more']; |
|
443 | - if ($month==12) |
|
444 | - $to = ($year+1)."-01-" . $dates[$year+1][1]['less']; |
|
442 | + $from = "$year-$month-".$dates[$year][$month]['more']; |
|
443 | + if ($month == 12) |
|
444 | + $to = ($year + 1)."-01-".$dates[$year + 1][1]['less']; |
|
445 | 445 | else { |
446 | - for ($newmonth = $month+1; $newmonth<=12; $newmonth++) { |
|
446 | + for ($newmonth = $month + 1; $newmonth <= 12; $newmonth++) { |
|
447 | 447 | if (isset($dates[$year][$newmonth]['less'])) { |
448 | - $to = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['less']; |
|
448 | + $to = "$year-".($newmonth)."-".$dates[$year][$newmonth]['less']; |
|
449 | 449 | break; |
450 | 450 | } |
451 | 451 | } |
452 | 452 | } |
453 | 453 | } |
454 | 454 | if (isset($dates[$year][$month]['between']) && $day > $dates[$year][$month]['between'][0] && $day < $dates[$year][$month]['between'][1]) { |
455 | - $from = "$year-$month-" . $dates[$year][$month]['between'][0]; |
|
456 | - $to = "$year-$month-" . $dates[$year][$month]['between'][1]; |
|
455 | + $from = "$year-$month-".$dates[$year][$month]['between'][0]; |
|
456 | + $to = "$year-$month-".$dates[$year][$month]['between'][1]; |
|
457 | 457 | } |
458 | 458 | if (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) { |
459 | - $from = "$year-$month-" . $dates[$year][$month]['between'][2]; |
|
460 | - $to = "$year-$month-" . $dates[$year][$month]['between'][3]; |
|
459 | + $from = "$year-$month-".$dates[$year][$month]['between'][2]; |
|
460 | + $to = "$year-$month-".$dates[$year][$month]['between'][3]; |
|
461 | 461 | } |
462 | 462 | } |
463 | 463 | return array($recess, $from, $to); |
@@ -362,12 +362,13 @@ discard block |
||
362 | 362 | } else { |
363 | 363 | $from = "$year-7-" . $dates[$year][7]['more']; |
364 | 364 | } |
365 | - if (!isset($dates[$year][9])) |
|
366 | - $to = "$year-08-31"; |
|
367 | - elseif (isset($dates[$year][9]['all'])) |
|
368 | - $to = "$year-10-" . $dates[$year][10]['less']; |
|
369 | - else |
|
370 | - $to = "$year-9-" . $dates[$year][9]['less']; |
|
365 | + if (!isset($dates[$year][9])) { |
|
366 | + $to = "$year-08-31"; |
|
367 | + } elseif (isset($dates[$year][9]['all'])) { |
|
368 | + $to = "$year-10-" . $dates[$year][10]['less']; |
|
369 | + } else { |
|
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 | 374 | || (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) |
@@ -375,11 +376,17 @@ discard block |
||
375 | 376 | || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) ) { |
376 | 377 | switch ($month) { |
377 | 378 | case 1: case 12: $recess = 'Christmas Recess'; break; |
378 | - case 2: if ($body==1 || $body==101) $recess = 'Half Term Week'; |
|
379 | - elseif ($body==4) $recess = 'February Recess'; |
|
379 | + case 2: if ($body==1 || $body==101) { |
|
380 | + $recess = 'Half Term Week'; |
|
381 | + } elseif ($body==4) { |
|
382 | + $recess = 'February Recess'; |
|
383 | + } |
|
380 | 384 | break; |
381 | - case 3: if ($body==1 || $body==101) $recess = 'Easter Recess'; |
|
382 | - elseif ($body==4) $recess = 'Spring Recess'; |
|
385 | + case 3: if ($body==1 || $body==101) { |
|
386 | + $recess = 'Easter Recess'; |
|
387 | + } elseif ($body==4) { |
|
388 | + $recess = 'Spring Recess'; |
|
389 | + } |
|
383 | 390 | break; |
384 | 391 | case 4: if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
385 | 392 | $recess = 'Election Recess'; |
@@ -417,9 +424,13 @@ discard block |
||
417 | 424 | trigger_error("Argh9"); |
418 | 425 | } |
419 | 426 | break; |
420 | - case 10: if ($body==1 || $body==101) $recess = 'Conference Recess'; |
|
421 | - elseif ($body==4) $recess = 'Autumn Recess'; |
|
422 | - elseif ($body==5) $recess = 'Halloween Recess'; |
|
427 | + case 10: if ($body==1 || $body==101) { |
|
428 | + $recess = 'Conference Recess'; |
|
429 | + } elseif ($body==4) { |
|
430 | + $recess = 'Autumn Recess'; |
|
431 | + } elseif ($body==5) { |
|
432 | + $recess = 'Halloween Recess'; |
|
433 | + } |
|
423 | 434 | break; |
424 | 435 | case 11: $recess = 'Autumn Recess'; |
425 | 436 | break; |
@@ -427,9 +438,9 @@ discard block |
||
427 | 438 | } |
428 | 439 | if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
429 | 440 | $to = "$year-$month-" . $dates[$year][$month]['less']; |
430 | - if ($month==1) |
|
431 | - $from = ($year-1)."-12-" . $dates[$year-1][12]['more']; |
|
432 | - else { |
|
441 | + if ($month==1) { |
|
442 | + $from = ($year-1)."-12-" . $dates[$year-1][12]['more']; |
|
443 | + } else { |
|
433 | 444 | for ($newmonth = $month-1; $newmonth>=1; $newmonth--) { |
434 | 445 | if (isset($dates[$year][$newmonth]['more'])) { |
435 | 446 | $from = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['more']; |
@@ -440,9 +451,9 @@ discard block |
||
440 | 451 | } |
441 | 452 | if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
442 | 453 | $from = "$year-$month-" . $dates[$year][$month]['more']; |
443 | - if ($month==12) |
|
444 | - $to = ($year+1)."-01-" . $dates[$year+1][1]['less']; |
|
445 | - else { |
|
454 | + if ($month==12) { |
|
455 | + $to = ($year+1)."-01-" . $dates[$year+1][1]['less']; |
|
456 | + } else { |
|
446 | 457 | for ($newmonth = $month+1; $newmonth<=12; $newmonth++) { |
447 | 458 | if (isset($dates[$year][$newmonth]['less'])) { |
448 | 459 | $to = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['less']; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once INCLUDESPATH . '../../commonlib/phplib/gaze.php'; |
|
4 | -include_once INCLUDESPATH . 'easyparliament/member.php'; |
|
3 | +include_once INCLUDESPATH.'../../commonlib/phplib/gaze.php'; |
|
4 | +include_once INCLUDESPATH.'easyparliament/member.php'; |
|
5 | 5 | |
6 | 6 | class PAGE { |
7 | 7 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | public $within_stripe_sidebar = false; |
20 | 20 | |
21 | 21 | public function page_start() { |
22 | - if ( !$this->page_started() ) { |
|
22 | + if (!$this->page_started()) { |
|
23 | 23 | $this->checkForAdmin(); |
24 | 24 | $this->displayHeader(); |
25 | 25 | } |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | |
33 | 33 | $data = $h->data; |
34 | 34 | $data = array_merge($u->data, $data); |
35 | - if ( isset($page_errors) ) { |
|
35 | + if (isset($page_errors)) { |
|
36 | 36 | $data['page_errors'] = $page_errors; |
37 | 37 | } |
38 | 38 | $data['banner_text'] = ''; |
39 | 39 | extract($data); |
40 | - require_once INCLUDESPATH . 'easyparliament/templates/html/header.php'; |
|
40 | + require_once INCLUDESPATH.'easyparliament/templates/html/header.php'; |
|
41 | 41 | |
42 | 42 | echo '<div class="full-page legacy-page static-page"> <div class="full-page__row"> <div class="panel">'; |
43 | 43 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | $THISPAGE = new URL($this_page); |
53 | 53 | |
54 | 54 | $LOGINURL = new URL('userlogin'); |
55 | - $LOGINURL->insert(array('ret' => $THISPAGE->generate('none') )); |
|
55 | + $LOGINURL->insert(array('ret' => $THISPAGE->generate('none'))); |
|
56 | 56 | |
57 | - $text = "<a href=\"" . $LOGINURL->generate() . "\">You'd better sign in!</a>"; |
|
57 | + $text = "<a href=\"".$LOGINURL->generate()."\">You'd better sign in!</a>"; |
|
58 | 58 | } else { |
59 | 59 | $text = "That's all folks!"; |
60 | 60 | } |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | public function page_end() { |
70 | - if ( !$this->page_started() ) { |
|
70 | + if (!$this->page_started()) { |
|
71 | 71 | $this->page_start(); |
72 | 72 | } |
73 | 73 | |
74 | 74 | echo '</div></div></div>'; |
75 | 75 | $footer = new MySociety\TheyWorkForYou\Renderer\Footer(); |
76 | 76 | $footer_links = $footer->data; |
77 | - require_once INCLUDESPATH . 'easyparliament/templates/html/footer.php'; |
|
77 | + require_once INCLUDESPATH.'easyparliament/templates/html/footer.php'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | public function page_started() { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - public function stripe_start($type='side', $id='', $extra_class = '') { |
|
104 | + public function stripe_start($type = 'side', $id = '', $extra_class = '') { |
|
105 | 105 | // $type is one of: |
106 | 106 | // 'full' - a full width div |
107 | 107 | // 'side' - a white stripe with a coloured sidebar. |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | // 'foot' - For the bottom stripe on hansard debates/wrans listings. |
115 | 115 | // $id is the value of an id for this div (if blank, not used). |
116 | 116 | ?> |
117 | - <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') echo ' ' . $extra_class; ?>"<?php |
|
117 | + <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') echo ' '.$extra_class; ?>"<?php |
|
118 | 118 | if ($id != '') { |
119 | - print ' id="' . $id . '"'; |
|
119 | + print ' id="'.$id.'"'; |
|
120 | 120 | } |
121 | 121 | ?>> |
122 | 122 | <div class="main"> |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | - public function stripe_end ($contents = array(), $extra = '') { |
|
134 | + public function stripe_end($contents = array(), $extra = '') { |
|
135 | 135 | // $contents is an array containing 0 or more hashes. |
136 | 136 | // Each hash has two values, 'type' and 'content'. |
137 | 137 | // 'Type' could be one of these: |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | |
244 | 244 | |
245 | - public function block_start($data=array()) { |
|
245 | + public function block_start($data = array()) { |
|
246 | 246 | // Starts a 'block' div, used mostly on the home page, |
247 | 247 | // on the MP page, and in the sidebars. |
248 | 248 | // $data is a hash like this: |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $this->blockbody_open = false; |
256 | 256 | |
257 | 257 | if (isset($data['id']) && $data['id'] != '') { |
258 | - $id = ' id="' . $data['id'] . '"'; |
|
258 | + $id = ' id="'.$data['id'].'"'; |
|
259 | 259 | } else { |
260 | 260 | $id = ''; |
261 | 261 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $title = isset($data['title']) ? $data['title'] : ''; |
264 | 264 | |
265 | 265 | if (isset($data['url'])) { |
266 | - $title = '<a href="' . $data['url'] . '">' . $title . '</a>'; |
|
266 | + $title = '<a href="'.$data['url'].'">'.$title.'</a>'; |
|
267 | 267 | } |
268 | 268 | ?> |
269 | 269 | <div class="block"<?php echo $id; ?>> |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | if (is_string($message)) { |
390 | 390 | // Sometimes we're just sending a single line to this function |
391 | 391 | // rather like the bigger array... |
392 | - $message = array ( |
|
392 | + $message = array( |
|
393 | 393 | 'text' => $message |
394 | 394 | ); |
395 | 395 | } |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | // if the page has started then we're most likely in an old school page |
398 | 398 | // so we should just print out the error, otherwise stick it in the error |
399 | 399 | // global which will then be displayed by the header template |
400 | - if ( $this->page_started() ) { |
|
400 | + if ($this->page_started()) { |
|
401 | 401 | $this->message($message, 'error'); |
402 | 402 | } else { |
403 | - if ( !isset($page_errors) ) { |
|
403 | + if (!isset($page_errors)) { |
|
404 | 404 | $page_errors = array(); |
405 | 405 | } |
406 | - $page_errors[] = $message; |
|
406 | + $page_errors[] = $message; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if ($fatal) { |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | |
423 | - public function message($message, $class='') { |
|
423 | + public function message($message, $class = '') { |
|
424 | 424 | // Generates a very simple but common page content. |
425 | 425 | // Used for when a user logs out, or votes, or any simple thing |
426 | 426 | // where there's a little message and probably a link elsewhere. |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | // $class is a class name that will be applied to the message's HTML elements. |
435 | 435 | |
436 | 436 | if ($class != '') { |
437 | - $class = ' class="' . $class . '"'; |
|
437 | + $class = ' class="'.$class.'"'; |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | $need_to_close_stripe = false; |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | } |
469 | 469 | |
470 | 470 | public function informational($text) { |
471 | - print '<div class="informational left">' . $text . '</div>'; |
|
471 | + print '<div class="informational left">'.$text.'</div>'; |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | public function set_hansard_headings($info) { |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | if ($page_title != '') { |
499 | 499 | $page_title .= ': '; |
500 | 500 | } |
501 | - $page_title .= format_date ($info['date'], SHORTDATEFORMAT); |
|
501 | + $page_title .= format_date($info['date'], SHORTDATEFORMAT); |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | if ($page_title != '') { |
@@ -537,15 +537,15 @@ discard block |
||
537 | 537 | $prev = $nextprev['prev']; |
538 | 538 | |
539 | 539 | if (isset($prev['url'])) { |
540 | - $prevlink = '<a href="' . $prev['url'] . '" title="' . $prev['title'] . '" class="linkbutton">« ' . $prev['body'] . '</a>'; |
|
540 | + $prevlink = '<a href="'.$prev['url'].'" title="'.$prev['title'].'" class="linkbutton">« '.$prev['body'].'</a>'; |
|
541 | 541 | |
542 | 542 | } else { |
543 | - $prevlink = '« ' . $prev['body']; |
|
543 | + $prevlink = '« '.$prev['body']; |
|
544 | 544 | } |
545 | 545 | } |
546 | 546 | |
547 | 547 | if ($prevlink != '') { |
548 | - $prevlink = '<span class="prev">' . $prevlink . '</span>'; |
|
548 | + $prevlink = '<span class="prev">'.$prevlink.'</span>'; |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | |
@@ -553,10 +553,10 @@ discard block |
||
553 | 553 | |
554 | 554 | if (isset($nextprev['up'])) { |
555 | 555 | |
556 | - $uplink = '<span class="up"><a href="' . $nextprev['up']['url'] . '" title="' . $nextprev['up']['title'] . '">' . $nextprev['up']['body'] . '</a>'; |
|
556 | + $uplink = '<span class="up"><a href="'.$nextprev['up']['url'].'" title="'.$nextprev['up']['title'].'">'.$nextprev['up']['body'].'</a>'; |
|
557 | 557 | if (get_http_var('s')) { |
558 | 558 | $URL = new URL($this_page); |
559 | - $uplink .= '<br><a href="' . $URL->generate() . '">Remove highlighting</a>'; |
|
559 | + $uplink .= '<br><a href="'.$URL->generate().'">Remove highlighting</a>'; |
|
560 | 560 | } |
561 | 561 | $uplink .= '</span>'; |
562 | 562 | } |
@@ -568,14 +568,14 @@ discard block |
||
568 | 568 | $next = $nextprev['next']; |
569 | 569 | |
570 | 570 | if (isset($next['url'])) { |
571 | - $nextlink = '<a href="' . $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' »</a>'; |
|
571 | + $nextlink = '<a href="'.$next['url'].'" title="'.$next['title'].'" class="linkbutton">'.$next['body'].' »</a>'; |
|
572 | 572 | } else { |
573 | - $nextlink = $next['body'] . ' »'; |
|
573 | + $nextlink = $next['body'].' »'; |
|
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
577 | 577 | if ($nextlink != '') { |
578 | - $nextlink = '<span class="next">' . $nextlink . '</span>'; |
|
578 | + $nextlink = '<span class="next">'.$nextlink.'</span>'; |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | } |
586 | 586 | |
587 | 587 | |
588 | - public function search_form($value='') { |
|
588 | + public function search_form($value = '') { |
|
589 | 589 | global $SEARCHENGINE; |
590 | 590 | // Search box on the search page. |
591 | 591 | // If $value is set then it will be displayed in the form. |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | } |
616 | 616 | |
617 | 617 | echo '<div class="mainsearchbox">'; |
618 | - if ($wtt<2) { |
|
618 | + if ($wtt < 2) { |
|
619 | 619 | echo '<form action="', $URL->generate(), '" method="get">'; |
620 | 620 | if (get_http_var('o')) { |
621 | 621 | echo '<input type="hidden" name="o" value="', _htmlentities(get_http_var('o')), '">'; |
@@ -624,10 +624,10 @@ discard block |
||
624 | 624 | echo '<input type="hidden" name="house" value="', _htmlentities(get_http_var('house')), '">'; |
625 | 625 | } |
626 | 626 | echo '<input type="text" name="q" value="', _htmlentities($value), '" size="50"> '; |
627 | - echo '<input type="submit" value=" ', ($wtt?'Modify search':'Search'), ' ">'; |
|
627 | + echo '<input type="submit" value=" ', ($wtt ? 'Modify search' : 'Search'), ' ">'; |
|
628 | 628 | $URL = new URL('search'); |
629 | 629 | $URL->insert(array('adv' => 1)); |
630 | - echo ' <a href="' . $URL->generate() . '">More options</a>'; |
|
630 | + echo ' <a href="'.$URL->generate().'">More options</a>'; |
|
631 | 631 | echo '<br>'; |
632 | 632 | if ($wtt) print '<input type="hidden" name="wtt" value="1">'; |
633 | 633 | } else { ?> |
@@ -646,24 +646,24 @@ discard block |
||
646 | 646 | $ordering = 'd'; |
647 | 647 | } |
648 | 648 | |
649 | - if ($ordering=='r') { |
|
649 | + if ($ordering == 'r') { |
|
650 | 650 | print '<strong>Sorted by relevance</strong>'; |
651 | 651 | } else { |
652 | 652 | printf("<a href='%s'>Sort by relevance</a>", $orderUrl->generate('html', array('o'=>'r'))); |
653 | 653 | } |
654 | 654 | |
655 | 655 | print " | "; |
656 | - if ($ordering=='d') { |
|
657 | - print '<strong>Sorted by date: newest</strong> / <a href="' . $orderUrl->generate('html', array('o'=>'o')) . '">oldest</a>'; |
|
658 | - } elseif ($ordering=='o') { |
|
659 | - print '<strong>Sorted by date:</strong> <a href="' . $orderUrl->generate('html', array('o'=>'d')) . '">newest</a> / <strong>oldest</strong>'; |
|
656 | + if ($ordering == 'd') { |
|
657 | + print '<strong>Sorted by date: newest</strong> / <a href="'.$orderUrl->generate('html', array('o'=>'o')).'">oldest</a>'; |
|
658 | + } elseif ($ordering == 'o') { |
|
659 | + print '<strong>Sorted by date:</strong> <a href="'.$orderUrl->generate('html', array('o'=>'d')).'">newest</a> / <strong>oldest</strong>'; |
|
660 | 660 | } else { |
661 | 661 | printf("Sort by date: <a href='%s'>newest</a> / <a href='%s'>oldest</a>", |
662 | 662 | $orderUrl->generate('html', array('o'=>'d')), $orderUrl->generate('html', array('o'=>'o'))); |
663 | 663 | } |
664 | 664 | |
665 | 665 | print " | "; |
666 | - if ($ordering=='p') { |
|
666 | + if ($ordering == 'p') { |
|
667 | 667 | print '<strong>Use by person</strong>'; |
668 | 668 | } else { |
669 | 669 | printf('<a href="%s">Show use by person</a>', $orderUrl->generate('html', array('o'=>'p'))); |
@@ -684,10 +684,10 @@ discard block |
||
684 | 684 | } |
685 | 685 | |
686 | 686 | public function advanced_search_form() { |
687 | - include_once INCLUDESPATH . 'easyparliament/templates/html/search_advanced.php'; |
|
687 | + include_once INCLUDESPATH.'easyparliament/templates/html/search_advanced.php'; |
|
688 | 688 | } |
689 | 689 | |
690 | - public function login_form ($errors = array()) { |
|
690 | + public function login_form($errors = array()) { |
|
691 | 691 | // Used for /user/login/ and /user/prompt/ |
692 | 692 | // $errors is a hash of potential errors from a previous log in attempt. |
693 | 693 | ?> |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | public function glossary_atoz(&$GLOSSARY) { |
787 | 787 | // Print out a nice list of lettered links to glossary pages |
788 | 788 | |
789 | - $letters = array (); |
|
789 | + $letters = array(); |
|
790 | 790 | |
791 | 791 | foreach ($GLOSSARY->alphabet as $letter => $eps) { |
792 | 792 | // if we're writing out the current letter (list or item) |
@@ -797,11 +797,11 @@ discard block |
||
797 | 797 | $URL->insert(array('az' => $letter)); |
798 | 798 | $letter_link = $URL->generate('url'); |
799 | 799 | |
800 | - $letters[] = "<li class=\"on\"><a href=\"" . $letter_link . "\">" . $letter . "</a></li>"; |
|
800 | + $letters[] = "<li class=\"on\"><a href=\"".$letter_link."\">".$letter."</a></li>"; |
|
801 | 801 | } |
802 | 802 | // otherwise in list view show no link |
803 | 803 | else { |
804 | - $letters[] = "<li class=\"on\">" . $letter . "</li>"; |
|
804 | + $letters[] = "<li class=\"on\">".$letter."</li>"; |
|
805 | 805 | } |
806 | 806 | } |
807 | 807 | elseif (!empty($GLOSSARY->alphabet[$letter])) { |
@@ -809,24 +809,24 @@ discard block |
||
809 | 809 | $URL->insert(array('az' => $letter)); |
810 | 810 | $letter_link = $URL->generate('url'); |
811 | 811 | |
812 | - $letters[] = "<li><a href=\"" . $letter_link . "\">" . $letter . "</a></li>"; |
|
812 | + $letters[] = "<li><a href=\"".$letter_link."\">".$letter."</a></li>"; |
|
813 | 813 | } |
814 | 814 | else { |
815 | - $letters[] = '<li>' . $letter . '</li>'; |
|
815 | + $letters[] = '<li>'.$letter.'</li>'; |
|
816 | 816 | } |
817 | 817 | } |
818 | 818 | ?> |
819 | 819 | <div class="letters"> |
820 | 820 | <ul> |
821 | 821 | <?php |
822 | - for ($n=0; $n<13; $n++) { |
|
822 | + for ($n = 0; $n < 13; $n++) { |
|
823 | 823 | print $letters[$n]; |
824 | 824 | } |
825 | 825 | ?> |
826 | 826 | </ul> |
827 | 827 | <ul> |
828 | 828 | <?php |
829 | - for ($n=13; $n<26; $n++) { |
|
829 | + for ($n = 13; $n < 26; $n++) { |
|
830 | 830 | print $letters[$n]; |
831 | 831 | } |
832 | 832 | ?> |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | // add some extra controls for the administrators |
847 | 847 | if ($this_page == "admin_glossary") { |
848 | 848 | print "<a id=\"gl".$term['glossary_id']."\"></a>"; |
849 | - print "<h3>" . $term['title'] . "</h3>"; |
|
849 | + print "<h3>".$term['title']."</h3>"; |
|
850 | 850 | $URL = new URL('admin_glossary'); |
851 | 851 | $URL->insert(array("delete_confirm" => $term['glossary_id'])); |
852 | 852 | $delete_url = $URL->generate(); |
@@ -861,13 +861,13 @@ discard block |
||
861 | 861 | $URL->insert(array('u' => $term['user_id'])); |
862 | 862 | $user_link = $URL->generate('url'); |
863 | 863 | |
864 | - $user_details = "\t\t\t\t<p><small>contributed by user <a href=\"" . $user_link . "\">" . $term['firstname'] . " " . $term['lastname'] . "</a></small>" . $admin_links . "</p>\n"; |
|
864 | + $user_details = "\t\t\t\t<p><small>contributed by user <a href=\"".$user_link."\">".$term['firstname']." ".$term['lastname']."</a></small>".$admin_links."</p>\n"; |
|
865 | 865 | } |
866 | 866 | else { |
867 | 867 | $user_details = ""; |
868 | 868 | } |
869 | 869 | |
870 | - print "\t\t\t\t<p class=\"glossary-body\">" . $term['body'] . "</p>\n" . $user_details; |
|
870 | + print "\t\t\t\t<p class=\"glossary-body\">".$term['body']."</p>\n".$user_details; |
|
871 | 871 | |
872 | 872 | if ($this_page == "glossary_item") { |
873 | 873 | // Add a direct search link for current glossary item |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | // remember to quote the term for phrase matching in search |
876 | 876 | $URL->insert(array('s' => '"'.$term['title'].'"')); |
877 | 877 | $search_url = $URL->generate(); |
878 | - printf ("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']); |
|
878 | + printf("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']); |
|
879 | 879 | } |
880 | 880 | } |
881 | 881 | |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | $URL = new URL('glossary'); |
908 | 908 | $URL->remove(array("g")); |
909 | 909 | $glossary_link = $URL->generate('url'); |
910 | - print "<small><a href=\"" . $glossary_link . "\">Browse the glossary</a></small>"; |
|
910 | + print "<small><a href=\"".$glossary_link."\">Browse the glossary</a></small>"; |
|
911 | 911 | } |
912 | 912 | |
913 | 913 | public function glossary_links() { |
@@ -950,13 +950,13 @@ discard block |
||
950 | 950 | |
951 | 951 | // Generate all the page links. |
952 | 952 | $URL = new URL($this_page); |
953 | - $URL->insert( array('wtt' => get_http_var('wtt')) ); |
|
953 | + $URL->insert(array('wtt' => get_http_var('wtt'))); |
|
954 | 954 | if (isset($pagedata['s'])) { |
955 | 955 | # XXX: Should be taken out in *one* place, not here + search_form etc. |
956 | 956 | $value = $pagedata['s']; |
957 | 957 | if (preg_match_all('#speaker:(\d+)#', $value, $m) == 1) { |
958 | 958 | $person_id = $m[1][0]; |
959 | - $value = str_replace('speaker:' . $person_id, '', $value); |
|
959 | + $value = str_replace('speaker:'.$person_id, '', $value); |
|
960 | 960 | $URL->insert(array('pid' => $person_id)); |
961 | 961 | } |
962 | 962 | $URL->insert(array('s' => $value)); |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | } |
976 | 976 | |
977 | 977 | if ($n != $page) { |
978 | - $pagelinks[] = '<a href="' . $URL->generate() . '">' . $n . '</a>'; |
|
978 | + $pagelinks[] = '<a href="'.$URL->generate().'">'.$n.'</a>'; |
|
979 | 979 | } else { |
980 | 980 | $pagelinks[] = "<strong>$n</strong>"; |
981 | 981 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | <?php |
997 | 997 | } |
998 | 998 | |
999 | - echo "\t\t\t\t" . implode(' ', $pagelinks); |
|
999 | + echo "\t\t\t\t".implode(' ', $pagelinks); |
|
1000 | 1000 | |
1001 | 1001 | if ($page != $numpages) { |
1002 | 1002 | $nextpage = $page + 1; |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | if ($data['user_id'] > 0) { |
1023 | 1023 | $USERURL = new URL('userview'); |
1024 | 1024 | $USERURL->insert(array('id'=>$data['user_id'])); |
1025 | - $username = '<a href="' . $USERURL->generate() . '">' . _htmlentities($data['user_name']) . '</a>'; |
|
1025 | + $username = '<a href="'.$USERURL->generate().'">'._htmlentities($data['user_name']).'</a>'; |
|
1026 | 1026 | } else { |
1027 | 1027 | $username = _htmlentities($data['user_name']); |
1028 | 1028 | } |
@@ -1081,15 +1081,15 @@ discard block |
||
1081 | 1081 | 'rid' => $report['report_id'], |
1082 | 1082 | 'cid' => $report['comment_id'], |
1083 | 1083 | )); |
1084 | - $editlink = '<a href="' . $EDITURL->generate() . '">View</a>'; |
|
1084 | + $editlink = '<a href="'.$EDITURL->generate().'">View</a>'; |
|
1085 | 1085 | } else { |
1086 | 1086 | $editlink = 'Locked'; |
1087 | 1087 | } |
1088 | 1088 | |
1089 | 1089 | $body = trim_characters($report['body'], 0, 40); |
1090 | 1090 | |
1091 | - $tabledata['rows'][] = array ( |
|
1092 | - _htmlentities($report['firstname'] . ' ' . $report['lastname']), |
|
1091 | + $tabledata['rows'][] = array( |
|
1092 | + _htmlentities($report['firstname'].' '.$report['lastname']), |
|
1093 | 1093 | _htmlentities($body), |
1094 | 1094 | $report['reported'], |
1095 | 1095 | $editlink |
@@ -1119,13 +1119,13 @@ discard block |
||
1119 | 1119 | // $page is the name of the page the dates should link to. |
1120 | 1120 | |
1121 | 1121 | // Create array containing abbreviations of days of week. |
1122 | - $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
|
1122 | + $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'); |
|
1123 | 1123 | |
1124 | 1124 | // What is the first day of the month in question? |
1125 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
1125 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
1126 | 1126 | |
1127 | 1127 | // How many days does this month contain? |
1128 | - $numberDays = date('t',$firstDayOfMonth); |
|
1128 | + $numberDays = date('t', $firstDayOfMonth); |
|
1129 | 1129 | |
1130 | 1130 | // Retrieve some information about the first day of the |
1131 | 1131 | // month in question. |
@@ -1206,13 +1206,13 @@ discard block |
||
1206 | 1206 | |
1207 | 1207 | // Is the $currentDay a member of $dateArray? If so, |
1208 | 1208 | // the day should be linked. |
1209 | - if (in_array($currentDay,$dateArray)) { |
|
1209 | + if (in_array($currentDay, $dateArray)) { |
|
1210 | 1210 | |
1211 | 1211 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
1212 | 1212 | |
1213 | 1213 | $DAYURL->insert(array('d'=>$date)); |
1214 | 1214 | |
1215 | - $calendar .= "<a href=\"" . $DAYURL->generate() . "\">$currentDay</a></td>"; |
|
1215 | + $calendar .= "<a href=\"".$DAYURL->generate()."\">$currentDay</a></td>"; |
|
1216 | 1216 | |
1217 | 1217 | // $currentDay is not a member of $dateArray. |
1218 | 1218 | |
@@ -1307,8 +1307,8 @@ discard block |
||
1307 | 1307 | // Returns HTML suitable for putting in the sidebar on Admin pages. |
1308 | 1308 | global $this_page, $DATA; |
1309 | 1309 | |
1310 | - $pages = array ('admin_home', |
|
1311 | - 'admin_comments','admin_trackbacks', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches', |
|
1310 | + $pages = array('admin_home', |
|
1311 | + 'admin_comments', 'admin_trackbacks', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches', |
|
1312 | 1312 | 'alert_stats', 'admin_statistics', 'admin_reportstats', |
1313 | 1313 | 'admin_commentreports', 'admin_glossary', 'admin_glossary_pending', 'admin_badusers', |
1314 | 1314 | 'admin_photos', 'admin_mpurls', 'admin_policies', 'admin_banner', 'admin_featured', 'admin_topics' |
@@ -1321,9 +1321,9 @@ discard block |
||
1321 | 1321 | |
1322 | 1322 | if ($page != $this_page) { |
1323 | 1323 | $URL = new URL($page); |
1324 | - $title = '<a href="' . $URL->generate() . '">' . $title . '</a>'; |
|
1324 | + $title = '<a href="'.$URL->generate().'">'.$title.'</a>'; |
|
1325 | 1325 | } else { |
1326 | - $title = '<strong>' . $title . '</strong>'; |
|
1326 | + $title = '<strong>'.$title.'</strong>'; |
|
1327 | 1327 | } |
1328 | 1328 | |
1329 | 1329 | $links[] = $title; |
@@ -1331,7 +1331,7 @@ discard block |
||
1331 | 1331 | |
1332 | 1332 | $html = "<ul>\n"; |
1333 | 1333 | |
1334 | - $html .= "<li>" . implode("</li>\n<li>", $links) . "</li>\n"; |
|
1334 | + $html .= "<li>".implode("</li>\n<li>", $links)."</li>\n"; |
|
1335 | 1335 | |
1336 | 1336 | $html .= "</ul>\n"; |
1337 | 1337 |
@@ -114,7 +114,10 @@ discard block |
||
114 | 114 | // 'foot' - For the bottom stripe on hansard debates/wrans listings. |
115 | 115 | // $id is the value of an id for this div (if blank, not used). |
116 | 116 | ?> |
117 | - <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') echo ' ' . $extra_class; ?>"<?php |
|
117 | + <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') { |
|
118 | + echo ' ' . $extra_class; |
|
119 | +} |
|
120 | +?>"<?php |
|
118 | 121 | if ($id != '') { |
119 | 122 | print ' id="' . $id . '"'; |
120 | 123 | } |
@@ -479,7 +482,9 @@ discard block |
||
479 | 482 | |
480 | 483 | global $DATA, $this_page; |
481 | 484 | |
482 | - if ($this->page_started()) return; |
|
485 | + if ($this->page_started()) { |
|
486 | + return; |
|
487 | + } |
|
483 | 488 | // The page's HTML hasn't been started yet, so we'd better do it. |
484 | 489 | |
485 | 490 | // Set the page title (in the <title></title>). |
@@ -629,7 +634,9 @@ discard block |
||
629 | 634 | $URL->insert(array('adv' => 1)); |
630 | 635 | echo ' <a href="' . $URL->generate() . '">More options</a>'; |
631 | 636 | echo '<br>'; |
632 | - if ($wtt) print '<input type="hidden" name="wtt" value="1">'; |
|
637 | + if ($wtt) { |
|
638 | + print '<input type="hidden" name="wtt" value="1">'; |
|
639 | + } |
|
633 | 640 | } else { ?> |
634 | 641 | <form action="http://www.writetothem.com/lords" method="get"> |
635 | 642 | <input type="hidden" name="pid" value="<?=_htmlentities(get_http_var('pid')) ?>"> |
@@ -753,8 +760,7 @@ discard block |
||
753 | 760 | // The return url for after the user has logged in. |
754 | 761 | if (get_http_var("ret") != "") { |
755 | 762 | $returl = get_http_var("ret"); |
756 | - } |
|
757 | - else { |
|
763 | + } else { |
|
758 | 764 | $returl = $glossary_returl; |
759 | 765 | } |
760 | 766 | ?> |
@@ -803,15 +809,13 @@ discard block |
||
803 | 809 | else { |
804 | 810 | $letters[] = "<li class=\"on\">" . $letter . "</li>"; |
805 | 811 | } |
806 | - } |
|
807 | - elseif (!empty($GLOSSARY->alphabet[$letter])) { |
|
812 | + } elseif (!empty($GLOSSARY->alphabet[$letter])) { |
|
808 | 813 | $URL = new URL('glossary'); |
809 | 814 | $URL->insert(array('az' => $letter)); |
810 | 815 | $letter_link = $URL->generate('url'); |
811 | 816 | |
812 | 817 | $letters[] = "<li><a href=\"" . $letter_link . "\">" . $letter . "</a></li>"; |
813 | - } |
|
814 | - else { |
|
818 | + } else { |
|
815 | 819 | $letters[] = '<li>' . $letter . '</li>'; |
816 | 820 | } |
817 | 821 | } |
@@ -851,8 +855,7 @@ discard block |
||
851 | 855 | $URL->insert(array("delete_confirm" => $term['glossary_id'])); |
852 | 856 | $delete_url = $URL->generate(); |
853 | 857 | $admin_links = "<br><small><a href=\"".$delete_url."\">delete</a></small>"; |
854 | - } |
|
855 | - else { |
|
858 | + } else { |
|
856 | 859 | $admin_links = ""; |
857 | 860 | } |
858 | 861 | |
@@ -862,8 +865,7 @@ discard block |
||
862 | 865 | $user_link = $URL->generate('url'); |
863 | 866 | |
864 | 867 | $user_details = "\t\t\t\t<p><small>contributed by user <a href=\"" . $user_link . "\">" . $term['firstname'] . " " . $term['lastname'] . "</a></small>" . $admin_links . "</p>\n"; |
865 | - } |
|
866 | - else { |
|
868 | + } else { |
|
867 | 869 | $user_details = ""; |
868 | 870 | } |
869 | 871 |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ); |
125 | 125 | $hansardmajors[104] = $hansardmajors[4]; |
126 | 126 | |
127 | -$parties = array ( |
|
127 | +$parties = array( |
|
128 | 128 | 'Bp' => 'Bishop', |
129 | 129 | 'Con' => 'Conservative', |
130 | 130 | 'CWM' => 'Deputy Speaker', |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | */ |
167 | 167 | |
168 | 168 | // Constants for various house types |
169 | -define ('HOUSE_TYPE_ROYAL', 0); |
|
170 | -define ('HOUSE_TYPE_COMMONS', 1); |
|
171 | -define ('HOUSE_TYPE_LORDS', 2); |
|
172 | -define ('HOUSE_TYPE_NI', 3); |
|
173 | -define ('HOUSE_TYPE_SCOTLAND', 4); |
|
174 | -define ('HOUSE_TYPE_WALES', 5); |
|
169 | +define('HOUSE_TYPE_ROYAL', 0); |
|
170 | +define('HOUSE_TYPE_COMMONS', 1); |
|
171 | +define('HOUSE_TYPE_LORDS', 2); |
|
172 | +define('HOUSE_TYPE_NI', 3); |
|
173 | +define('HOUSE_TYPE_SCOTLAND', 4); |
|
174 | +define('HOUSE_TYPE_WALES', 5); |
@@ -3,15 +3,15 @@ |
||
3 | 3 | # Index page for written answers/statements. |
4 | 4 | |
5 | 5 | include_once '../../includes/easyparliament/init.php'; |
6 | -include_once INCLUDESPATH . "easyparliament/glossary.php"; |
|
7 | -include_once INCLUDESPATH . "easyparliament/member.php"; |
|
8 | -include_once INCLUDESPATH . "easyparliament/recess.php"; |
|
6 | +include_once INCLUDESPATH."easyparliament/glossary.php"; |
|
7 | +include_once INCLUDESPATH."easyparliament/member.php"; |
|
8 | +include_once INCLUDESPATH."easyparliament/recess.php"; |
|
9 | 9 | |
10 | 10 | $this_page = 'wranswmsfront'; |
11 | 11 | $view = new MySociety\TheyWorkForYou\SectionView\WransView(); |
12 | 12 | $data = $view->display(); |
13 | 13 | if ($data) { |
14 | - if ( $data['template'] ) { |
|
14 | + if ($data['template']) { |
|
15 | 15 | $template = $data['template']; |
16 | 16 | } else { |
17 | 17 | $template = 'section/section'; |