Example #1
0
    public function onGadgetExport(ExportPackageEvent $event)
    {
        $appId = $this->container->get('keosu_core.curapp')->getCurApp();
        $em = $this->container->get('doctrine')->getManager();
        $app = $em->getRepository('KeosuCoreBundle:App')->find($appId);
        if (isset($app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['enablePush']) && $app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['enablePush'] === true) {
            $googleGcmProjectNumber = $app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['googleGcmProjectNumber'];
            $event->addToJsInit('
var pushNotificationData = { senderID : \'' . $googleGcmProjectNumber . '\'};
');
        }
    }
Example #2
0
    function onGadgetExport(ExportPackageEvent $event)
    {
        $em = $this->container->get('doctrine')->getManager();
        $appId = $this->container->get('keosu_core.curapp')->getcurapp();
        $app = $em->getRepository('KeosuCoreBundle:App')->find($appId);
        $configPackages = $app->getConfigPackages();
        $fbAppId = $configPackages[KeosuGadgetFaceBookBundle::PLUGIN_NAME]['fbAppId'];
        if ($fbAppId != null) {
            $event->addToJsInit('
				document.addEventListener(\'deviceready\',function(){
					FB.init({
						appId:' . $fbAppId . ',
						nativeInterface:CDV.FB,
						useCacheDialogs:false
					});
				});');
        }
    }
Example #3
0
    public function onGadgetExport(ExportPackageEvent $event)
    {
        $appid = $this->container->get('keosu_core.curapp')->getCurApp();
        $em = $this->container->get('doctrine')->getManager();
        $pages = $em->getRepository('KeosuCoreBundle:Page')->findByAppId($appid);
        $idMain = 0;
        foreach ($pages as $page) {
            if ($page->getIsMain()) {
                $idMain = $page->getId();
            }
        }
        $event->addToJsCore('
app.config(function($routeProvider,$locationProvider){
	$routeProvider.when("/Page/:pageName",{
		templateUrl: function(params) {
			return params.pageName+".html";
		}
	})
	.otherwise({redirectTo:"/Page/' . $idMain . '"});
});');
    }