Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function PersonFilter() {
- $filterText = isset( $_REQUEST['keywords'] ) ? $_REQUEST['keywords'] : '';
- $divisions = array();
- $cats = DB::Query( 'SELECT DISTINCT `Name` AS `Name`, `ID` FROM `Category`' );
- foreach ( $cats as $cat ) $divisions[ $cat['ID'] ] = $cat['Name'];
- $fields = new FieldSet(
- new LiteralField(
- $name = 'startBox',
- $content = '<div class="sidebarBox">'
- ),
- new CheckboxSetField(
- $name = 'divisions',
- $title = '',
- $divisions,
- $value = '1'
- ),
- new LiteralField(
- $name = 'endBox',
- $content = '</div>'
- ),
- new TextField( 'keywords', '', $filterText )
- );
- $actions = new FieldSet(
- new LiteralField(
- $name = 'startSubmit',
- $content = '<div class="submit">'
- ),
- new ImageFormAction( 'PersonFilterResults', 'Apply', '/hawkins/images/filter_button.png' ),
- new LiteralField(
- $name = 'endSubmit',
- $content = '</div>'
- )
- );
- return new SearchForm( $this, 'PersonFilter', $fields, $actions );
- }
Add Comment
Please, Sign In to add comment