public function sortFiles($sortType, $sortIds = array())
    {
        switch ($sortType) {
            case 'name_desc':
                return $this->sortByName(false);

            case 'date_asc':
                return $this->sortByDate(true);

            case 'date_desc':
                return $this->sortByDate(false);

            case 'manual':
                return $this->sortByIdList($sortIds);

            case 'random':
                return $this->sortByRandom();

            default:
            case 'name_asc':
        }
        return $this->sortByName(true);
    }
public function sortFiles($sortType, $sortIds = array())
    {
        switch ($sortType) {
            case 'name_desc':
                return $this->sortByName(false);

            case 'date_asc':
                return $this->sortByDate(true);

            case 'date_desc':
                return $this->sortByDate(false);

            case 'manual':
                return $this->sortByIdList($sortIds);

            case 'random':
                return $this->sortByRandom();

            default:
            case 'name_asc':
        }
        return $this->sortByName(true);
    }
public function sortFiles ( $ sortType , $ sortIds = array ( ) ) { switch ( $ sortType ) { case 'name_desc' : return $ this -> sortByName ( false ) ; case 'date_asc' : return $ this -> sortByDate ( true ) ; case 'date_desc' : return $ this -> sortByDate ( false ) ; case 'manual' : return $ this -> sortByIdList ( $ sortIds ) ; case 'random' : return $ this -> sortByRandom ( ) ; default : case 'name_asc' : } return $ this -> sortByName ( true ) ; }
Sorts the internal file list by a given condition.

Allowed sort types are:
name_asc  - Sort by filename ascending.
name_desc - Sort by filename descending
date_asc  - Sort by modification time ascending.
date_desc - Sort by modification time descending.
manual    - Sort by passed id array, the array must contain the binary ids of the files.
random    - Shuffle all the files around.

@param string $sortType The sort condition to be applied.

@param array  $sortIds  The list of binary ids to sort by (sort type "manual" only).

@return array The sorted file list.
Sorts the internal file list by a given condition .