function userGroups_PrintPagesWithGroups($level = 0, $parentID = 0, $alt = true)
{
    global $wpdb;
    $groups = new userGroups();
    $query = "SELECT * FROM " . $wpdb->posts;
    //added «OR post_type='page'» for wordpress 2.1 compatibility
    $query .= " WHERE (post_status='static' OR post_type='page') AND post_parent='{$parentID}';";
    $results = $wpdb->get_results($query);
    if (isset($results)) {
        foreach ($results as $result) {
            if ($alt) {
                $style = 'class=\'alternate\'';
            } else {
                $style = '';
            }
            $spacer = "";
            for ($cont = 0; $cont < $level; $cont++) {
                $spacer .= "-";
            }
            echo "<tr " . $style . "><td>{$spacer} " . $result->post_title . "</td><td>";
            $pageGroups = $groups->getAllGroupsWithPage($result->ID);
            if (isset($pageGroups) && count($pageGroups) > 0) {
                $hasGroups = false;
                foreach ($pageGroups as $grp) {
                    if ($grp->exc_read || $grp->exc_write) {
                        $perms = " (";
                        if ($grp->exc_read) {
                            $perms .= "R";
                        }
                        if ($grp->exc_write) {
                            $perms .= "W";
                        }
                        $perms .= ")";
                        echo "- " . $grp->name . "{$perms}<br />";
                        $hasGroups = true;
                    }
                }
                if (!$hasGroups) {
                    echo "(no groups)";
                }
            } else {
                echo "(no groups)";
            }
            echo "</td><td " . $style . "><a class=\"edit\"  href='" . $_SERVER['PHP_SELF'] . "?page=wp-group-restriction/manage_groups&amp;mode=edit&amp;id=" . $result->ID . "'>Edit</a></td></tr>";
            ?>
	
	
	<?php 
            $alt = !$alt;
            $alt = userGroups_PrintPagesWithGroups($level + 1, $result->ID, $alt);
        }
    }
    return $alt;
}