id, $this->class, $this->backgroundVariation, ); if ($this->colorVariation) { $cssClasses[] = $this->colorVariation; } if ($this->height) { $cssClasses[] = $this->height; } if ($this->valign) { $cssClasses[] = $this->valign; } if ($this->width) { $cssClasses[] = '-width-expand'; } /*if ($this->valignCenter) { $cssClasses[] = '-valign-center'; }*/ if ($this->shadow) { $cssClasses[] = '-shadow'; } if ($this->textShadow) { $cssClasses[] = '-text-shadow'; } if ($this->invert) { $cssClasses[] = '-invert'; } if ($this->widthRestrict) { $cssClasses[] = '-bg-restraint'; } $imageFiles = array(); $videoFiles = array(); if (is_array($this->backgroundImage)) { foreach (\FilesModel::findMultipleByUuids($this->backgroundImage) as $file) { if (in_array( $file->extension, array_map('trim', explode(',', \Config::get('validImageTypes'))) )) { $imageFiles[] = $file; } else { $videoFiles[] = $file; } } } $backgroundStyle = ''; if (count($imageFiles) && $image = $this->getImageObject($imageFiles[0]->uuid, $this->backgroundImageSize)) { $backgroundStyle .= 'background-image: url("' . $image->src . '");'; if ($this->height == '-bgimage') { $minHeight = round(100/$image->arrSize[0]*$image->arrSize[1]).'%'; } } if ((count($imageFiles) || count($videoFiles)) && $this->backgroundSize) { $backgroundStyle .= 'background-size: ' . $this->backgroundSize . ';'; } if ((count($imageFiles) || count($videoFiles)) && $this->backgroundPosition) { $backgroundStyle .= 'background-position: ' . $this->backgroundPosition . ';'; } if ((count($imageFiles) || count($videoFiles)) && $this->backgroundOpacity) { $backgroundStyle .= 'opacity:' . $this->backgroundOpacity/100 . ';'; } $style = ''; if (!count($videoFiles) && !count($imageFiles)) { $style .= $backgroundStyle; } ?>