Contao\ModuleFlash::compile PHP Method

compile() protected method

Generate the module
protected compile ( )
    protected function compile()
    {
        $this->Template->src = $this->singleSRC;
        $this->Template->href = $this->source == 'external' ? $this->url : $this->singleSRC;
        $this->Template->alt = $this->altContent;
        $this->Template->var = 'swf' . $this->id;
        $this->Template->transparent = $this->transparent ? true : false;
        $this->Template->interactive = $this->interactive ? true : false;
        $this->Template->flashId = $this->flashID ?: 'swf_' . $this->id;
        $this->Template->fsCommand = '  ' . preg_replace('/[\\n\\r]/', "\n  ", \StringUtil::decodeEntities($this->flashJS));
        $this->Template->flashvars = 'URL=' . \Environment::get('base');
        $this->Template->version = $this->version ?: '6.0.0';
        $size = \StringUtil::deserialize($this->size);
        $this->Template->width = $size[0];
        $this->Template->height = $size[1];
        $intMaxWidth = TL_MODE == 'BE' ? 320 : \Config::get('maxImageWidth');
        // Adjust movie size
        if ($intMaxWidth > 0 && $size[0] > $intMaxWidth) {
            $this->Template->width = $intMaxWidth;
            $this->Template->height = floor($intMaxWidth * $size[1] / $size[0]);
        }
        if (strlen($this->flashvars)) {
            $this->Template->flashvars .= '&' . \StringUtil::decodeEntities($this->flashvars);
        }
    }