roundcubemail/program/lib/Roundcube/rcube_result_thread.php
protected function build_thread($items, $level = 1, &$pos = 0)
    {
        $result = array();

        for ($len=count($items); $pos < $len; $pos++) {
            list($lv, $id) = explode(self::SEPARATOR_LEVEL, $items[$pos]);
            if ($level == $lv) {
                $pos++;
                $result[$id] = $this->build_thread($items, $level+1, $pos);
            }
            else {
                $pos--;
                break;
            }
        }

        return $result;
    }
protected function build_thread($items, $level = 1, &$pos = 0)
    {
        $result = array();

        for ($len=count($items); $pos < $len; $pos++) {
            list($lv, $id) = explode(self::SEPARATOR_LEVEL, $items[$pos]);
            if ($level == $lv) {
                $pos++;
                $result[$id] = $this->build_thread($items, $level+1, $pos);
            }
            else {
                $pos--;
                break;
            }
        }

        return $result;
    }
protected function build_thread ( $ items , $ level = 1 , & $ pos = 0 ) { $ result = array ( ) ; for ( $ len = count ( $ items ) ; $ pos < $ len ; $ pos ++ ) { list ( $ lv , $ id ) = explode ( self :: SEPARATOR_LEVEL , $ items [ $ pos ] ) ; if ( $ level == $ lv ) { $ pos ++ ; $ result [ $ id ] = $ this -> build_thread ( $ items , $ level + 1 , $ pos ) ; } else { $ pos -- ; break ; } } return $ result ; }
Converts part of the raw thread into an array
Converts part of the raw thread into an array