views_handler_sort_random.inc 480 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_sort_random.
  5. */
  6. /**
  7. * Handle a random sort.
  8. *
  9. * @ingroup views_sort_handlers
  10. */
  11. class views_handler_sort_random extends views_handler_sort {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function query() {
  16. $this->query->add_orderby('rand');
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function options_form(&$form, &$form_state) {
  22. parent::options_form($form, $form_state);
  23. $form['order']['#access'] = FALSE;
  24. }
  25. }