views_handler_filter_profile_selection.inc

  1. 3.x modules/profile/views_handler_filter_profile_selection.inc
  2. 2.x modules/profile/views_handler_filter_profile_selection.inc

Definition of views_handler_filter_profile_selection.

File

modules/profile/views_handler_filter_profile_selection.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_filter_profile_selection.
  5. */
  6. /**
  7. * Filter by a selection widget in the profile.
  8. *
  9. * @ingroup views_filter_handlers
  10. */
  11. class views_handler_filter_profile_selection extends views_handler_filter_in_operator {
  12. function get_value_options() {
  13. if (isset($this->value_options)) {
  14. return;
  15. }
  16. $this->value_options = array();
  17. $all_options = profile_views_get_fields();
  18. $field = $all_options[$this->definition['fid']];
  19. $lines = preg_split("/[,\n\r]/", $field->options);
  20. foreach ($lines as $line) {
  21. if ($line = trim($line)) {
  22. $this->value_options[$line] = $line;
  23. }
  24. }
  25. }
  26. }