views_handler_sort_random.inc

Same filename in other branches
  1. 6.x-3.x handlers/views_handler_sort_random.inc

Definition of views_handler_sort_random.

File

handlers/views_handler_sort_random.inc

View source
<?php


/**
 * @file
 * Definition of views_handler_sort_random.
 */

/**
 * Handle a random sort.
 *
 * @ingroup views_sort_handlers
 */
class views_handler_sort_random extends views_handler_sort {
    
    /**
     * {@inheritdoc}
     */
    public function query() {
        $this->query
            ->add_orderby('rand');
    }
    
    /**
     * {@inheritdoc}
     */
    public function options_form(&$form, &$form_state) {
        parent::options_form($form, $form_state);
        $form['order']['#access'] = FALSE;
    }

}

Classes

Title Deprecated Summary
views_handler_sort_random Handle a random sort.