protected static function filterRootlineBySiteroot(array $rootline)
    {
        $ret = array();

        // Make sure sorting is right (first root, last page)
        ksort($rootline, SORT_NUMERIC);

        //reverse rootline
        $rootline = array_reverse($rootline);

        foreach ($rootline as $page) {
            $ret[] = $page;
            if (!empty($page['is_siteroot'])) {
                break;
            }
        }
        $ret = array_reverse($ret);

        return $ret;
    }