protected function display_front() { global $DATA, $this_page; if (get_http_var('type') == 'wrans') { return parent::display_front(); } $data = array(); $args = array('months' => 1); $WRANSLIST = new \WRANSLIST(); $wrans = array(); $wrans['data'] = $WRANSLIST->display('recent_wrans', array('days' => 7, 'num' => 5), 'none'); $wrans['calendar'] = $WRANSLIST->display('calendar', $args, 'none'); $WMSLIST = new \WMSLIST(); $wms = array(); $wms['data'] = $WMSLIST->display('recent_wms', array('days' => 7, 'num' => 20), 'none'); $wms['calendar'] = $WMSLIST->display('calendar', $args, 'none'); $wms['rssurl'] = $DATA->page_metadata('wmsfront', 'rss'); $data['wrans'] = $wrans; $data['wms'] = $wms; $data['template'] = 'section/wrans_index'; return $data; }
<?php # # Index page for written answers/statements. include_once "../../includes/easyparliament/init.php"; include_once INCLUDESPATH . "easyparliament/glossary.php"; include_once INCLUDESPATH . "easyparliament/member.php"; $this_page = 'wranswmsfront'; $PAGE->page_start(); # XXX Search box currently in the stripe below should, when wrans and wms are # two columns, be moved up here spanning across the two columns. echo '<div id="written-answers">'; $PAGE->stripe_start(); echo '<h2>Some recent written answers</h2>'; $WRANSLIST = new WRANSLIST(); $WRANSLIST->display('recent_wrans', array('days' => 7, 'num' => 5)); $PAGE->stripe_end(array(array('type' => 'html', 'content' => ' <div class="block"> <h4>Search written answers and statements</h4> <div class="blockbody"> <form action="/search/" method="get"> <p><input type="text" name="s" value="" size="40"> <input type="submit" value="Go"> <br><input type="checkbox" name="section[]" value="wrans" checked id="section_wrans"> <label for="section_wrans">Written answers</label> <input type="checkbox" name="section[]" value="wms" checked id="section_wms"> <label for="section_wms">Written ministerial statements</label> </p> </form> </div> </div> '), array('type' => 'nextprev'), array('type' => 'include', 'content' => 'calendar_wrans'), array('type' => 'include', 'content' => "wrans")));
<?php global $PAGE; // The calendar that appears in sidebars linking to debates. // There is a separate one for wrans (so we can have both on the same page). // Contents varies depending on the page we're on... if ($this_page == 'wransday') { $date = get_http_var('d'); if (preg_match('#^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$#', $date, $m)) { $year = $m[1]; $month = $m[2]; $day = $m[3]; $args = array('year' => $year, 'month' => $month, 'onday' => $date); $title = 'Answers this month'; } else { $args = array('months' => 1); $title = 'Recent written answers'; } } else { $args = array('months' => 1); $title = 'Recent written answers'; } $PAGE->block_start(array('title' => $title)); $LIST = new WRANSLIST(); $LIST->display('calendar', $args); $PAGE->block_end();