public function transform( MShop_Media_Item_Interface $item, $baseurl = null,
		array $boxAttributes = array(), array $itemAttributes = array() )
	{
		$url = $item->getUrl();
		$enc = $this->encoder();
		$previewUrl = $item->getPreview();

		$tag = $this->_createMediaTag( $item, $boxAttributes, $itemAttributes, $baseurl );

		if( strncmp( $url, 'http', 4 ) !== 0 && strncmp( $url, 'data', 4 ) !== 0 && $baseurl !== null ) {
			$url = $baseurl . '/' . $url;
		}

		if( strncmp( $previewUrl, 'http', 4 ) !== 0 && strncmp( $previewUrl, 'data', 4 ) !== 0 && $baseurl !== null ) {
			$previewUrl = $baseurl . '/' . $previewUrl;
		}

		$mimetype = $enc->attr( $item->getMimetype() );
		$name = $enc->html( $item->getName() );

		return sprintf( $tag, $enc->attr( $url ), $enc->attr( $previewUrl ), $name, $mimetype );
	}
public function transform( MShop_Media_Item_Interface $item, $baseurl = null,
		array $boxAttributes = array(), array $itemAttributes = array() )
	{
		$url = $item->getUrl();
		$enc = $this->encoder();
		$previewUrl = $item->getPreview();

		$tag = $this->_createMediaTag( $item, $boxAttributes, $itemAttributes, $baseurl );

		if( strncmp( $url, 'http', 4 ) !== 0 && strncmp( $url, 'data', 4 ) !== 0 && $baseurl !== null ) {
			$url = $baseurl . '/' . $url;
		}

		if( strncmp( $previewUrl, 'http', 4 ) !== 0 && strncmp( $previewUrl, 'data', 4 ) !== 0 && $baseurl !== null ) {
			$previewUrl = $baseurl . '/' . $previewUrl;
		}

		$mimetype = $enc->attr( $item->getMimetype() );
		$name = $enc->html( $item->getName() );

		return sprintf( $tag, $enc->attr( $url ), $enc->attr( $previewUrl ), $name, $mimetype );
	}
public function transform ( MShop_Media_Item_Interface $ item , $ baseurl = null , array $ boxAttributes = array ( ) , array $ itemAttributes = array ( ) ) { $ url = $ item -> getUrl ( ) ; $ enc = $ this -> encoder ( ) ; $ previewUrl = $ item -> getPreview ( ) ; $ tag = $ this -> _createMediaTag ( $ item , $ boxAttributes , $ itemAttributes , $ baseurl ) ; if ( strncmp ( $ url , 'http' , 4 ) !== 0 && strncmp ( $ url , 'data' , 4 ) !== 0 && $ baseurl !== null ) { $ url = $ baseurl . '/' . $ url ; } if ( strncmp ( $ previewUrl , 'http' , 4 ) !== 0 && strncmp ( $ previewUrl , 'data' , 4 ) !== 0 && $ baseurl !== null ) { $ previewUrl = $ baseurl . '/' . $ previewUrl ; } $ mimetype = $ enc -> attr ( $ item -> getMimetype ( ) ) ; $ name = $ enc -> html ( $ item -> getName ( ) ) ; return sprintf ( $ tag , $ enc -> attr ( $ url ) , $ enc -> attr ( $ previewUrl ) , $ name , $ mimetype ) ; }
Returns the media HTML tag.

@param MShop_Media_Item_Interface $item Media item, optional with other items media or text items attached
@param string|null $baseurl Base URL that must be prepended to the relative URL
@param array $boxAttributes Associative list of key/value pairs with container attributes
@param array $itemAttributes Associative list of key/value pairs with item attributes.
Item attributes can contain placeholders for the URL (%1$s) and the preview URL (%2$s).
Title and src are automatically added.
@return string HTML media tag (image, audio, video or link)
Returns the media HTML tag .