*/ /** * Photo printing at shutterfly.com * * @package Shutterfly */ class ShutterflyModule extends GalleryModule { function ShutterflyModule() { global $gallery; $this->setId('shutterfly'); $this->setName('Shutterfly'); $this->setDescription($gallery->i18n('Shutterfly Photo Printing Module')); $this->setVersion('0.6.1'); $this->setGroup('commerce', $this->translate('Commerce')); $this->setCallbacks('getItemLinks'); $this->setRequiredCoreApi(array(4, 0)); $this->setRequiredModuleApi(array(0, 9)); } /** * @see GalleryModule::performFactoryRegistrations() */ function performFactoryRegistrations() { $ret = GalleryCoreApi::registerFactoryImplementation( 'CartPluginInterface_1_0', 'ShutterflyCartPlugin', 'shutterfly', 'modules/shutterfly/classes/ShutterflyCartPlugin.class', 'shutterfly', null); if ($ret->isError()) { return $ret->wrap(__FILE__, __LINE__); } return GalleryStatus::success(); } /** * @see GalleryModule::isRecommendedDuringInstall */ function isRecommendedDuringInstall() { return true; } /** * @see GalleryModule::autoConfigure */ function autoConfigure() { /* We don't require any special configuration */ return array(GalleryStatus::success(), true); } /** * @see GalleryModule::getItemLinks() */ function getItemLinks($items) { $links = array(); foreach ($items as $item) { if (GalleryUtilities::isA($item, 'GalleryPhotoItem')) { $params['view'] = 'shutterfly:PrintPhotos'; $params['itemId'] = $item->getId(); $params['return'] = 1; $links[$item->getId()][] = array('text' => $this->translate('print on shutterfly.com'), 'params' => $params); } } return array(GalleryStatus::success(), $links); } } ?>