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; }
$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"))); echo '</div>'; echo '<div id="written-statements">'; $PAGE->stripe_start(); echo '<h2>Some recent written ministerial statements</h2>'; $WMSLIST = new WMSLIST(); $WMSLIST->display('recent_wms', array('days' => 7, 'num' => 20)); $rssurl = $DATA->page_metadata($this_page, 'rss'); $PAGE->stripe_end(array(array('type' => 'nextprev'), array('type' => 'include', 'content' => 'calendar_wms'), array('type' => 'include', 'content' => "wms"), array('type' => 'html', 'content' => '<div class="block"> <h4>RSS feed</h4> <p><a href="' . WEBPATH . $rssurl . '"><img border="0" alt="RSS feed" align="middle" src="http://www.theyworkforyou.com/images/rss.gif"></a> <a href="' . WEBPATH . $rssurl . '">RSS feed of recent statements</a></p> </div>'))); echo '</div>'; $PAGE->page_end();
<?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 == 'wmsday') { $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 = 'Written Ministerial Statements this month'; } else { $args = array('months' => 1); $title = 'Recent Written Ministerial Statements'; } } else { $args = array('months' => 1); $title = 'Recent Written Ministerial Statements'; } $PAGE->block_start(array('title' => $title)); $LIST = new WMSLIST(); $LIST->display('calendar', $args); $PAGE->block_end();