@@ -11,34 +11,34 @@ discard block |
||
11 | 11 | |
12 | 12 | $slug = get_http_var('id'); |
13 | 13 | if ($slug) { |
14 | - $topic = $topics->getTopic($slug); |
|
14 | + $topic = $topics->getTopic($slug); |
|
15 | 15 | } else { |
16 | - $topic = new \MySociety\TheyWorkForYou\Topic(); |
|
16 | + $topic = new \MySociety\TheyWorkForYou\Topic(); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | $action = get_http_var('action'); |
20 | 20 | switch ($action) { |
21 | 21 | case 'add': |
22 | 22 | $success = add_topic($topic); |
23 | - break; |
|
23 | + break; |
|
24 | 24 | case 'update': |
25 | 25 | $success = update_topic($topic); |
26 | - break; |
|
26 | + break; |
|
27 | 27 | case 'setimage': |
28 | 28 | $success = add_image($topic); |
29 | - break; |
|
29 | + break; |
|
30 | 30 | case 'addcontent': |
31 | 31 | $success = add_content($topic); |
32 | - break; |
|
32 | + break; |
|
33 | 33 | case 'deletecontent': |
34 | 34 | $success = delete_content($topic); |
35 | - break; |
|
35 | + break; |
|
36 | 36 | case 'addpolicysets': |
37 | 37 | $success = add_policy_sets($topic); |
38 | - break; |
|
38 | + break; |
|
39 | 39 | case 'addpolicies': |
40 | 40 | $success = add_policies($topic); |
41 | - break; |
|
41 | + break; |
|
42 | 42 | default: |
43 | 43 | $success = null; |
44 | 44 | } |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | <select name="sets[]" multiple> |
126 | 126 | <option value="">None</option> |
127 | 127 | <?php |
128 | - $policies = new \MySociety\TheyWorkForYou\Policies; |
|
129 | - $set_descriptions = $policies->getSetDescriptions(); |
|
130 | - $related_sets = $topic->getPolicySets(); |
|
131 | - foreach ($set_descriptions as $set => $description) { ?> |
|
128 | + $policies = new \MySociety\TheyWorkForYou\Policies; |
|
129 | + $set_descriptions = $policies->getSetDescriptions(); |
|
130 | + $related_sets = $topic->getPolicySets(); |
|
131 | + foreach ($set_descriptions as $set => $description) { ?> |
|
132 | 132 | <option value="<?= $set ?>" <?= in_array($set, $related_sets) ? 'selected' : '' ?>><?= $description ?></option> |
133 | 133 | <?php } ?> |
134 | 134 | <input type="submit" value="Update"> |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | <select name="policies[]" multiple> |
144 | 144 | <option value="">None</option> |
145 | 145 | <?php |
146 | - $policies = new \MySociety\TheyWorkForYou\Policies; |
|
147 | - $all_policies = $policies->getPolicies(); |
|
148 | - $related_policies = $topic->getPolicies(); |
|
149 | - foreach ($all_policies as $number => $description) { ?> |
|
146 | + $policies = new \MySociety\TheyWorkForYou\Policies; |
|
147 | + $all_policies = $policies->getPolicies(); |
|
148 | + $related_policies = $topic->getPolicies(); |
|
149 | + foreach ($all_policies as $number => $description) { ?> |
|
150 | 150 | <option value="<?= $number ?>" <?= in_array($number, $related_policies) ? 'selected' : '' ?>><?= $description ?></option> |
151 | 151 | <?php } ?> |
152 | 152 | |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | $file_info['tmp_name'], |
215 | 215 | $topic->image_path() |
216 | 216 | ); |
217 | - } catch (ErrorException $e) { |
|
217 | + } catch (ErrorException $e) { |
|
218 | 218 | return false; |
219 | - } |
|
219 | + } |
|
220 | 220 | |
221 | 221 | if ($image_saved) { |
222 | 222 | return $topic->save(); |
@@ -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 | ) |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | if ( isset($divisions) && $divisions ) { |
34 | 34 | if ($has_voting_record) { |
35 | 35 | foreach ($divisions as $division) { |
36 | - $displayed_votes = true; |
|
36 | + $displayed_votes = true; |
|
37 | 37 | |
38 | - if ($current_date != $division['date']) { |
|
38 | + if ($current_date != $division['date']) { |
|
39 | 39 | if ($current_date != '' ) { |
40 | - print('</ul></div>'); |
|
40 | + print('</ul></div>'); |
|
41 | 41 | } |
42 | 42 | $current_date = $division['date']; |
43 | 43 | $sidebar_links[] = $division['date']; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | <h2><?= strftime('%e %b %Y', strtotime($division['date'])) ?></h2> |
47 | 47 | <ul class="vote-descriptions policy-votes"> |
48 | 48 | <?php } |
49 | - include('_division_description.php'); |
|
49 | + include('_division_description.php'); |
|
50 | 50 | } |
51 | 51 | echo('</div>'); |
52 | 52 | } |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | $current_date = ''; |
31 | 31 | $sidebar_links = array(); |
32 | 32 | |
33 | - if ( isset($divisions) && $divisions ) { |
|
33 | + if (isset($divisions) && $divisions) { |
|
34 | 34 | if ($has_voting_record) { |
35 | 35 | foreach ($divisions as $division) { |
36 | 36 | $displayed_votes = true; |
37 | 37 | |
38 | 38 | if ($current_date != $division['date']) { |
39 | - if ($current_date != '' ) { |
|
39 | + if ($current_date != '') { |
|
40 | 40 | print('</ul></div>'); |
41 | 41 | } |
42 | 42 | $current_date = $division['date']; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | <div class="sidebar__unit in-page-nav"> |
64 | 64 | <ul> |
65 | - <?php foreach($sidebar_links as $date) { ?> |
|
65 | + <?php foreach ($sidebar_links as $date) { ?> |
|
66 | 66 | <li> |
67 | 67 | <a href="#<?= strftime('%Y-%m-%d', strtotime($date)) ?>"> |
68 | 68 | <?= strftime('%e %b %Y', strtotime($date)) ?> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | </div> |
16 | 16 | <div class="person-panels"> |
17 | 17 | <div class="sidebar__unit in-page-nav"> |
18 | - <?php if ( isset($policydivisions) && $policydivisions && count($policydivisions) == 1 ) { ?> |
|
18 | + <?php if (isset($policydivisions) && $policydivisions && count($policydivisions) == 1) { ?> |
|
19 | 19 | <p class="policy-votes-intro"> |
20 | 20 | How <?= $full_name ?> voted on <?= $policydivisions[array_keys($policydivisions)[0]]['desc'] ?>. |
21 | 21 | </p> |
@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | <?php endif; ?> |
35 | 35 | |
36 | 36 | <?php $displayed_votes = false; ?> |
37 | - <?php if ( isset($policydivisions) && $policydivisions ) { ?> |
|
37 | + <?php if (isset($policydivisions) && $policydivisions) { ?> |
|
38 | 38 | |
39 | 39 | <?php if ($has_voting_record) { ?> |
40 | 40 | |
41 | 41 | <?php foreach ($policydivisions as $policy) { ?> |
42 | 42 | <?php |
43 | 43 | $show_all = false; |
44 | - if ( $policy['weak_count'] == 0 || $policy['weak_count'] == count($policy['divisions']) ) { |
|
44 | + if ($policy['weak_count'] == 0 || $policy['weak_count'] == count($policy['divisions'])) { |
|
45 | 45 | $show_all = true; |
46 | 46 | } |
47 | 47 | ?> |
48 | 48 | |
49 | - <?php if ( isset($policy['header']) ) { ?> |
|
49 | + <?php if (isset($policy['header'])) { ?> |
|
50 | 50 | <div class="panel policy-votes-hero" style="background-image: url('<?php echo $policy['header']['image']; ?>');"> |
51 | 51 | <h2><?php echo $policy['header']['title']; ?></h2> |
52 | 52 | <p><?php echo $policy['header']['description']; ?>.</p> |
53 | - <?php if ( $policy['header']['image_source'] ) { ?> |
|
53 | + <?php if ($policy['header']['image_source']) { ?> |
|
54 | 54 | <span class="policy-votes-hero__image-attribution"> |
55 | 55 | Photo: |
56 | 56 | <a href="<?php echo $policy['header']['image_source']; ?>"> |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | <?php } ?> |
66 | 66 | |
67 | 67 | |
68 | - <?php if ( isset($policy['position']) ) { ?> |
|
68 | + <?php if (isset($policy['position'])) { ?> |
|
69 | 69 | <div class="panel"> |
70 | - <?php if ( $policy['position']['has_strong'] ) { ?> |
|
70 | + <?php if ($policy['position']['has_strong']) { ?> |
|
71 | 71 | <h3 class="policy-vote-overall-stance"> |
72 | 72 | <?= $full_name . ' ' . $policy['position']['desc'] ?> |
73 | 73 | </h3> |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | </ul> |
101 | 101 | |
102 | 102 | <div class="policy-votes-list-footer"> |
103 | - <?php if ( !$show_all && $policy['weak_count'] > 0 ) { ?> |
|
103 | + <?php if (!$show_all && $policy['weak_count'] > 0) { ?> |
|
104 | 104 | <p><button class="button secondary-button small js-show-all-votes">Show all votes, including <?= $policy['weak_count'] ?> less important <?= $policy['weak_count'] == 1 ? 'vote' : 'votes' ?></button></p> |
105 | 105 | <?php } ?> |
106 | 106 | <p class="voting-information-provenance"> |
@@ -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,12 +1,12 @@ discard block |
||
1 | 1 | <div class="calendar"> |
2 | - <?php if(isset($month)) { |
|
3 | - $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
|
2 | + <?php if (isset($month)) { |
|
3 | + $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'); |
|
4 | 4 | |
5 | 5 | // What is the first day of the month in question? |
6 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
6 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
7 | 7 | |
8 | 8 | // How many days does this month contain? |
9 | - $numberDays = date('t',$firstDayOfMonth); |
|
9 | + $numberDays = date('t', $firstDayOfMonth); |
|
10 | 10 | |
11 | 11 | // Retrieve some information about the first day of the |
12 | 12 | // month in question. |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | if (isset($info['onday'])) { |
19 | 19 | // 'onday' is like 'yyyy-mm-dd'. |
20 | 20 | $datebits = explode('-', $info['onday']); |
21 | - if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
21 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
22 | 22 | $toDay = $datebits[2]; |
23 | 23 | } else { |
24 | 24 | $toDay = ''; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <?php } |
46 | 46 | if (!isset($years)) { ?> |
47 | 47 | <div class="calendar__controls"> |
48 | - <?php if ( isset($prev) ) { ?> |
|
48 | + <?php if (isset($prev)) { ?> |
|
49 | 49 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">←</a> |
50 | 50 | <?php } else { ?> |
51 | 51 | <span class="calendar__controls__previous"> </span> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <span class="calendar__controls__current"> |
54 | 54 | <?= $monthName ?> <?= $year ?> |
55 | 55 | </span> |
56 | - <?php if ( isset($next) ) { ?> |
|
56 | + <?php if (isset($next)) { ?> |
|
57 | 57 | <a href="<?= $next['url'] ?>" class="calendar__controls__next">→</a> |
58 | 58 | <?php } else { ?> |
59 | 59 | <span class="calendar__controls__next"> </span> |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | // sittings - e.g. WH is only Tuesday-Thursday |
107 | 107 | if ($currentDay == $toDay) { |
108 | 108 | print '<td class="on"'; |
109 | - if ($recess[0] && $recess[0]!=1) { |
|
110 | - print ' title="'.$recess[0].'"'; |
|
109 | + if ($recess[0] && $recess[0] != 1) { |
|
110 | + print ' title="' . $recess[0] . '"'; |
|
111 | 111 | } |
112 | 112 | print '>'; |
113 | 113 | } elseif ($recess[0]) { |
114 | 114 | print '<td class="no"'; |
115 | - if ($recess[0]!=1) { |
|
116 | - print ' title="'.$recess[0].'"'; |
|
115 | + if ($recess[0] != 1) { |
|
116 | + print ' title="' . $recess[0] . '"'; |
|
117 | 117 | } |
118 | 118 | print '>'; |
119 | 119 | } else { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | // Is the $currentDay a member of $dates? If so, |
124 | 124 | // the day should be linked. |
125 | - if (in_array($currentDay,$dates)) { |
|
125 | + if (in_array($currentDay, $dates)) { |
|
126 | 126 | |
127 | 127 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
128 | 128 | |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | </tr> |
161 | 161 | </tbody> |
162 | 162 | </table> |
163 | - <?php if(!isset($years)){ ?> |
|
163 | + <?php if (!isset($years)) { ?> |
|
164 | 164 | <div class="calendar__footer"> |
165 | 165 | <?php |
166 | 166 | $y = $urls['day']; |
167 | 167 | $y->reset(); |
168 | - $y->insert(array( 'y' => $year )); |
|
168 | + $y->insert(array('y' => $year)); |
|
169 | 169 | $url = $y->generate(); |
170 | 170 | ?> |
171 | 171 | <a href="<?= $url ?>">See all of <?= $year ?></a> |