* @version $Revision: 15705 $ */ class ShutterflyCartPlugin extends CartPluginInterface_1_0 { /** * @see CartPluginInterface_1_0::getSupportedItemTypes */ function getSupportedItemTypes() { return array('GalleryPhotoItem'); } /** * @see CartPluginInterface_1_0::getActionDisplayName */ function getActionDisplayName() { list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'shutterfly'); if ($ret) { return array($ret, null); } return array(null, $module->translate('Print with Shutterfly')); } /** * @see CartPluginInterface_1_0::fulfillCart */ function fulfillCart($cartItemIds) { global $gallery; $session =& $gallery->getSession(); $session->put('shutterfly.cart', $cartItemIds); $urlGenerator =& $gallery->getUrlGenerator(); $returnUrl = $urlGenerator->generateUrl( array('view' => 'cart.ViewCart'), array('forceFullUrl' => true)); return array(null, array('view' => 'shutterfly.PrintPhotos', 'returnUrl' => $returnUrl, 'authToken' => $session->getAuthToken())); } } ?>