public function execute($filterChain)
 {
     $context = $this->getContext();
     $request = $context->getRequest();
     if (jfPortableDevice::isPortableDevice()) {
         $layout = isset(self::$_layout) ? self::$_layout : $this->getParameter('layout');
         $context->getActionStack()->getFirstEntry()->getActionInstance()->setLayout($layout);
         if (class_exists('sfWidgetFormSchema')) {
             // compatibility with symfony 1.0
             sfWidgetFormSchema::setDefaultFormFormatterName($this->getParameter('defaultFormFormatterName', 'jfPD'));
         }
         jfPortableDevice::setPageAttribute('data-url', $request->getUri());
     }
     $filterChain->execute();
     if (jfPortableDevice::isPortableDevice()) {
         if (jfPortableDevice::getConfig('lazyLoadImages')) {
             $response = $context->getResponse();
             $content = $response->getContent();
             $content = preg_replace('/(<img.*)(src=)([\'|\\"].*>)/', '$1data-jfPD-src=$3', $content);
             $response->setContent($content);
         }
         if (jfPortableDevice::isNativeApp()) {
             sfConfig::set('sf_web_debug', false);
         }
     }
 }
 public function executeIndex()
 {
     $request = $this->getContext()->getRequest();
     //symfony 1.0 compatibility
     jfPortableDevice::setPageAttribute('data-jfPDExtImageGallery', 'true');
     $this->jsOptions = sfConfig::get('mod_jfportabledeviceextimagegallery_jsOptions', array());
     //jfPortableDevice::setConfig('fixedToolbars', false);
 }
 public function executeInitialize()
 {
     $request = sfContext::getInstance()->getRequest();
     //symfony 1.0 compatibility
     $this->config = json_encode($this->getJsConfig($request));
     if (jfPortableDevice::isNativeApp()) {
         jfPortableDevice::setPageAttribute('data-dom-cache', 'true');
     }
 }