core-bundle/src/Resources/contao/elements/ContentVimeo.php
protected function compile()
	{
		$size = StringUtil::deserialize($this->playerSize);

		if (!\is_array($size) || empty($size[0]) || empty($size[1]))
		{
			$this->Template->size = ' width="640" height="360"';
		}
		else
		{
			$this->Template->size = ' width="' . $size[0] . '" height="' . $size[1] . '"';
		}

		$params = array();
		$options = StringUtil::deserialize($this->vimeoOptions);
		$url = 'https://player.vimeo.com/video/' . $this->vimeo;

		if (\is_array($options))
		{
			foreach ($options as $option)
			{
				switch ($option)
				{
					case 'vimeo_portrait':
					case 'vimeo_title':
					case 'vimeo_byline':
						$params[] = substr($option, 6) . '=0';
						break;

					default:
						$params[] = substr($option, 6) . '=1';
				}
			}
		}

		if ($this->playerColor)
		{
			$params[] = 'color=' . $this->playerColor;
		}

		if (!empty($params))
		{
			$url .= '?' . implode('&amp;', $params);
		}

		if ($this->playerStart > 0)
		{
			$url .= '#t=' . (int) $this->playerStart . 's';
		}

		$this->Template->src = $url;
		$this->Template->aspect = str_replace(':', '', $this->playerAspect);
		$this->Template->caption = $this->playerCaption;
	}
protected function compile()
	{
		$size = StringUtil::deserialize($this->playerSize);

		if (!\is_array($size) || empty($size[0]) || empty($size[1]))
		{
			$this->Template->size = ' width="640" height="360"';
		}
		else
		{
			$this->Template->size = ' width="' . $size[0] . '" height="' . $size[1] . '"';
		}

		$params = array();
		$options = StringUtil::deserialize($this->vimeoOptions);
		$url = 'https://player.vimeo.com/video/' . $this->vimeo;

		if (\is_array($options))
		{
			foreach ($options as $option)
			{
				switch ($option)
				{
					case 'vimeo_portrait':
					case 'vimeo_title':
					case 'vimeo_byline':
						$params[] = substr($option, 6) . '=0';
						break;

					default:
						$params[] = substr($option, 6) . '=1';
				}
			}
		}

		if ($this->playerColor)
		{
			$params[] = 'color=' . $this->playerColor;
		}

		if (!empty($params))
		{
			$url .= '?' . implode('&amp;', $params);
		}

		if ($this->playerStart > 0)
		{
			$url .= '#t=' . (int) $this->playerStart . 's';
		}

		$this->Template->src = $url;
		$this->Template->aspect = str_replace(':', '', $this->playerAspect);
		$this->Template->caption = $this->playerCaption;
	}
protected function compile ( ) { $ size = StringUtil :: deserialize ( $ this -> playerSize ) ; if ( ! \ is_array ( $ size ) || empty ( $ size [ 0 ] ) || empty ( $ size [ 1 ] ) ) { $ this -> Template -> size = ' width="640" height="360"' ; } else { $ this -> Template -> size = ' width="' . $ size [ 0 ] . '" height="' . $ size [ 1 ] . '"' ; } $ params = array ( ) ; $ options = StringUtil :: deserialize ( $ this -> vimeoOptions ) ; $ url = 'https://player.vimeo.com/video/' . $ this -> vimeo ; if ( \ is_array ( $ options ) ) { foreach ( $ options as $ option ) { switch ( $ option ) { case 'vimeo_portrait' : case 'vimeo_title' : case 'vimeo_byline' : $ params [ ] = substr ( $ option , 6 ) . '=0' ; break ; default : $ params [ ] = substr ( $ option , 6 ) . '=1' ; } } } if ( $ this -> playerColor ) { $ params [ ] = 'color=' . $ this -> playerColor ; } if ( ! empty ( $ params ) ) { $ url .= '?' . implode ( '&amp;' , $ params ) ; } if ( $ this -> playerStart > 0 ) { $ url .= '#t=' . ( int ) $ this -> playerStart . 's' ; } $ this -> Template -> src = $ url ; $ this -> Template -> aspect = str_replace ( ':' , '' , $ this -> playerAspect ) ; $ this -> Template -> caption = $ this -> playerCaption ; }
Generate the module
Generate the module