/**
 * Outputs the list of email lists to which the specified address is
 * subscribed.
 *
 * @param  Zend_Gdata_Gapps $gapps     The service object to use for communicating with the Google
 *                                     Apps server.
 * @param  boolean          $html      True if output should be formatted for display in a web browser.
 * @param  string           $recipient The email address of the recipient whose subscriptions should
 *                                     be retrieved. Only a username is required if the recipient is a
 *                                     member of the current domain.
 * @return void
 */
function retrieveEmailLists($gapps, $html, $recipient)
{
    if ($html) {
        echo "<h2>Email List Subscriptions For {$recipient}</h2>\n";
    }
    $feed = $gapps->retrieveEmailLists($recipient);
    if ($html) {
        echo "<ul>\n";
    }
    foreach ($feed as $list) {
        if ($html) {
            echo "  <li>";
        } else {
            echo "  * ";
        }
        echo $list->emailList->name;
        if ($html) {
            echo '</li>';
        }
        echo "\n";
    }
    if ($html) {
        echo "</ul>\n";
    }
}