public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['imgCssClass'] = $this->_getSetting('imgCssClass'); $ret['style'] = ''; $ret['containerClass'] = $this->_getBemClass("container"); $ret['image'] = $this->getData(); $imageComponent = $this->_getImageComponent(); if ($imageComponent) { $ret['altText'] = $imageComponent->getAltText(); $imageData = $this->getImageData(); $ret = array_merge($ret, Kwf_Media_Output_Component::getResponsiveImageVars($this->getImageDimensions(), $imageData['file'])); $ret['style'] .= 'max-width:' . $ret['width'] . 'px;'; if ($this->_getSetting('defineWidth')) { $ret['style'] .= 'width:' . $ret['width'] . 'px;'; } if ($ret['width'] > 100) { $ret['containerClass'] .= ' kwfUp-webResponsiveImgLoading'; } } $ret['baseUrl'] = $this->_getBaseImageUrl(); $ret['defineWidth'] = $this->_getSetting('defineWidth'); $ret['lazyLoadOutOfViewport'] = $this->_getSetting('lazyLoadOutOfViewport'); $ret['outputImgTag'] = $this->_getSetting('outputImgTag'); if (!$this->_getSetting('lazyLoadOutOfViewport')) { $ret['containerClass'] .= ' kwfUp-loadImmediately'; } if (!$renderer instanceof Kwf_Component_Renderer_Mail) { //TODO this check is a hack $ret['template'] = Kwf_Component_Renderer_Twig_TemplateLocator::getComponentTemplate('Kwc_Abstract_Image_Component'); } return $ret; }
public function getComponentMasterTemplate($componentClass) { return Kwf_Component_Renderer_Twig_TemplateLocator::getComponentTemplate($componentClass, 'Master'); }