Skip to content

Commit

Permalink
Set recent_divisions $this_page to trigger menus
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Feb 15, 2024
1 parent 2152c3c commit 53429fa
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion www/docs/divisions/index.php
Original file line number Diff line number Diff line change
@@ -3,14 +3,27 @@
include_once '../../includes/easyparliament/init.php';
include_once INCLUDESPATH . 'easyparliament/member.php';

$this_page = 'divisions_recent';

$MEMBER = null;
if ($THEUSER->postcode_is_set()) {
$MEMBER = new MySociety\TheyWorkForYou\Member(array('postcode' => $THEUSER->postcode(), 'house' => HOUSE_TYPE_COMMONS));
}

$houses = get_http_var('house', '', true);

// Set to a special version of the page name to get right parliament menus
if ($houses == 'scotland') {
$this_page = 'divisions_recent_sp';
} elseif ($houses == 'senedd') {
$this_page = "divisions_recent_wales";
} elseif ($houses == 'commons') {
$this_page = 'divisions_recent_commons';
} elseif ($houses == 'lords') {
$this_page = 'divisions_recent_lords';
} else {
$this_page = 'divisions_recent';
}

$divisions = new MySociety\TheyWorkForYou\Divisions($MEMBER);
$data = $divisions->getRecentDivisions(30, $houses);

0 comments on commit 53429fa

Please sign in to comment.