Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. public function PersonFilter() {
  2. $filterText = isset( $_REQUEST['keywords'] ) ? $_REQUEST['keywords'] : '';
  3.  
  4. $divisions = array();
  5. $cats = DB::Query( 'SELECT DISTINCT `Name` AS `Name`, `ID` FROM `Category`' );
  6. foreach ( $cats as $cat ) $divisions[ $cat['ID'] ] = $cat['Name'];
  7. $fields = new FieldSet(
  8. new LiteralField(
  9. $name = 'startBox',
  10. $content = '<div class="sidebarBox">'
  11. ),
  12. new CheckboxSetField(
  13. $name = 'divisions',
  14. $title = '',
  15. $divisions,
  16. $value = '1'
  17. ),
  18. new LiteralField(
  19. $name = 'endBox',
  20. $content = '</div>'
  21. ),
  22. new TextField( 'keywords', '', $filterText )
  23. );
  24. $actions = new FieldSet(
  25. new LiteralField(
  26. $name = 'startSubmit',
  27. $content = '<div class="submit">'
  28. ),
  29. new ImageFormAction( 'PersonFilterResults', 'Apply', '/hawkins/images/filter_button.png' ),
  30. new LiteralField(
  31. $name = 'endSubmit',
  32. $content = '</div>'
  33. )
  34. );
  35. return new SearchForm( $this, 'PersonFilter', $fields, $actions );
  36. }
Add Comment
Please, Sign In to add comment