コード例 #1
0
/**
 * Outputs the list of all email lists on the current domain.
 *
 * @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.
 * @return void
 */
function retrieveAllEmailLists($gapps, $html)
{
    if ($html) {
        echo "<h2>Registered Email Lists</h2>\n";
    }
    $feed = $gapps->retrieveAllEmailLists();
    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";
    }
}