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 execute($filterChain) { if (jfPortableDevice::isPortableDevice()) { self::disable(); } return parent::execute($filterChain); }
public static function setIsPortableDevice($value) { self::$isPortableDevice = $value; }