roundcubemail/program/lib/Roundcube/rcube_imap.php
protected function sort_folder_specials($folder, &$list, &$specials, &$out)
    {
        foreach ($list as $key => $name) {
            if ($folder === null || strpos($name, $folder.$this->delimiter) === 0) {
                $out[] = $name;
                unset($list[$key]);

                if (!empty($specials) && ($found = array_search($name, $specials)) !== false) {
                    unset($specials[$found]);
                    $this->sort_folder_specials($name, $list, $specials, $out);
                }
            }
        }

        reset($list);
    }
protected function sort_folder_specials($folder, &$list, &$specials, &$out)
    {
        foreach ($list as $key => $name) {
            if ($folder === null || strpos($name, $folder.$this->delimiter) === 0) {
                $out[] = $name;
                unset($list[$key]);

                if (!empty($specials) && ($found = array_search($name, $specials)) !== false) {
                    unset($specials[$found]);
                    $this->sort_folder_specials($name, $list, $specials, $out);
                }
            }
        }

        reset($list);
    }
protected function sort_folder_specials ( $ folder , & $ list , & $ specials , & $ out ) { foreach ( $ list as $ key => $ name ) { if ( $ folder === null || strpos ( $ name , $ folder . $ this -> delimiter ) === 0 ) { $ out [ ] = $ name ; unset ( $ list [ $ key ] ) ; if ( ! empty ( $ specials ) && ( $ found = array_search ( $ name , $ specials ) ) !== false ) { unset ( $ specials [ $ found ] ) ; $ this -> sort_folder_specials ( $ name , $ list , $ specials , $ out ) ; } } } reset ( $ list ) ; }
Recursive function to put subfolders of special folders in place
Recursive function to put subfolders of special folders in place