/** * Load javascript library required by google maps * * @param Gpf_Contexts_Module $context */ public function initJsResources(Gpf_Contexts_Module $context) { if (($key = $this->getKey()) !== false) { $context->addJsResource( 'https://maps.google.com/maps?gwt=1&file=api&v=2.x&key=' . $key); $context->addJsResource( 'https://www.google.com/jsapi?key=' . $key); } }
/** * Load javascript library required for google gears * * @param Gpf_Contexts_Module $context */ public function initJsResources(Gpf_Contexts_Module $context) { //install mode will not connect google gears if (Gpf_Paths::getInstance()->isInstallModeActive()) { return; } try { $file = new Gpf_Io_File(Gpf_Paths::getInstance()->getAccountConfigDirectoryPath() . GoogleGears_Definition::getManifestFileName()); if (!$file->isExists()) { $def = new GoogleGears_Definition(); $def->generateManifest(); } $context->addJsResource(Gpf_Paths::getInstance()->getFrameworkPluginsDirectoryUrl() . 'GoogleGears/gears_init.js'); $manifestUrl = Gpf_Paths::getInstance()->getBaseServerUrl() . Gpf_Paths::getInstance()->getAccountDirectoryRelativePath() . Gpf_Paths::CONFIG_DIR . GoogleGears_Definition::getManifestFileName(); $context->addJsScript("try { var localServer = google.gears.factory.create('beta.localserver'); var store = localServer.createManagedStore('GwtPHP'); store.manifestUrl = '$manifestUrl'; store.checkForUpdate(); store.enabled = true; } catch (e) {} "); } catch (Gpf_Exception $e) { } }
public function initJsResource(Gpf_Contexts_Module $module) { $module->addJsResource('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js'); }