*/ /** * Photo printing at photoaccess.com * * @package PhotoAccess */ class PhotoAccessModule extends GalleryModule { function PhotoAccessModule() { global $gallery; $this->setId('photoaccess'); $this->setName('PhotoAccess'); $this->setDescription($gallery->i18n('PhotoAccess Photo Printing Module')); $this->setVersion('0.8.6'); $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', 'PhotoAccessCartPlugin', 'photoaccess', 'modules/photoaccess/classes/PhotoAccessCartPlugin.class', 'photoaccess', 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) { global $gallery; $urlGenerator =& $gallery->getUrlGenerator(); $links = array(); foreach ($items as $item) { if (GalleryUtilities::isA($item, 'GalleryPhotoItem')) { $params['controller'] = 'photoaccess:PrintPhoto'; $params['itemId'] = $item->getId(); $params['returnUrl'] = urlencode($urlGenerator->getCurrentUrl()); $links[$item->getId()][] = array('text' => $this->translate('print on photoaccess.com'), 'params' => $params); } } return array(GalleryStatus::success(), $links); } } ?>