Esempio n. 1
0
    }
    if (isset($_GET['startIndex'])) {
        $startIndex = $_GET['startIndex'];
        $query->setStartIndex($startIndex);
    }
    if (isset($_GET['maxResults'])) {
        $maxResults = $_GET['maxResults'];
        $query->setMaxResults($maxResults);
    }
    if (isset($_GET['minViewability'])) {
        $minViewability = $_GET['minViewability'];
        $query->setMinViewability($minViewability);
    }
    /* check for one of the restricted feeds, or list from 'all' videos */
    switch ($queryType) {
        case 'full_view':
        case 'partial_view':
            $query->setMinViewability($queryType);
            echo 'Requesting feed: ' . $query->getQueryUrl() . '<br><br>';
            $feed = $books->getVolumeFeed($query);
            break;
        case 'all':
            echo 'Requesting feed: ' . $query->getQueryUrl() . '<br><br>';
            $feed = $books->getVolumeFeed($query);
            break;
        default:
            echo 'ERROR - unknown queryType - "' . $queryType . '"';
            break;
    }
    echoBookList($feed);
}
Esempio n. 2
0
  </td></tr></table><br></body></html>
HTML;
}
/*
 * The main controller logic of the Books volume browser demonstration app.
 */
$queryType = isset($_GET['queryType']) ? $_GET['queryType'] : null;
if ($queryType != null) {
    $volumes = $service->volumes;
    $optParams = array();
    /* display a list of volumes */
    if (isset($_GET['searchTerm'])) {
        $searchTerm = $_GET['searchTerm'];
    }
    if (isset($_GET['startIndex'])) {
        $optParams['startIndex'] = $_GET['startIndex'];
    }
    if (isset($_GET['maxResults'])) {
        $optParams['maxResults'] = $_GET['maxResults'];
    }
    /* check for one of the restricted feeds, or list from 'all' videos */
    if ($queryType == 'full_view') {
        $optParams['filter'] = 'full';
    } else {
        if ($queryType == 'partial_view') {
            $optParams['filter'] = 'partial';
        }
    }
    $results = $volumes->listVolumes($searchTerm, $optParams);
    echoBookList($results);
}