irm-1.6-b3/lib/Savant2/Savant2_Plugin_image.php
/**
	* 
	* Outputs an <img ... /> tag.
	* 
	* Microsoft IE alpha PNG support added by Edward Ritter.
	* 
	* @access public
	* 
	* @param string $file The path to the image on the local file system
	* relative to $this->imageDir.
	* 
	* @param string $alt Alternative descriptive text for the image;
	* defaults to the filename of the image.
	* 
	* @param int $border The border width for the image; defaults to zero.
	* 
	* @param int $width The displayed image width in pixels; defaults to
	* the width of the image.
	* 
	* @param int $height The displayed image height in pixels; defaults to
	* the height of the image.
	* 
	*/
Outputs an <img ...

Microsoft IE alpha PNG support added by Edward Ritter.

@access public

@param string $file The path to the image on the local file system
relative to $this->imageDir.

@param string $alt Alternative descriptive text for the image;
defaults to the filename of the image.

@param int $border The border width for the image; defaults to zero.

@param int $width The displayed image width in pixels; defaults to
the width of the image.

@param int $height The displayed image height in pixels; defaults to
the height of the image.
Outputs an <img ... Microsoft IE alpha PNG support added by Edward Ritter . @access public @param string $file The path to the image on the local file system relative to $this - > imageDir . @param string $alt Alternative descriptive text for the image ; defaults to the filename of the image . @param int $border The border width for the image ; defaults to zero . @param int $width The displayed image width in pixels ; defaults to the width of the image . @param int $height The displayed image height in pixels ; defaults to the height of the image .
function plugin($file, $alt = null, $height = null, $width = null,
		$attr = null)
	{
				if (is_null($this->documentRoot)) {
			$this->documentRoot = $_SERVER['DOCUMENT_ROOT'];
		}
		$type = null;
		$info = false;
		if (strpos($file, '://') === false) {
			$file = $this->imageDir . $file;
			$info = @getimagesize($this->documentRoot . $file);
		} else {
			$info = @getimagesize($file);
		}
				if (is_array($info)) {
			$type = $info[2];
			if (is_null($width) && is_null($height)) {
				$width = $info[0];
				$height = $info[1];
			}
		}
		unset($info);
		if (stristr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && $type === 3) {
			$html = '<span style="position: relative;';
			if ($height) {
				$html .= ' height: ' . $height . 'px;';
			}
			if ($width) {
				$html .= ' width: ' . $width . 'px;';
			}
			$html .= ' filter:progid:DXImageTransform.Microsoft.AlphaImageLoader';
			$html .= "(src='$file',sizingMethod='scale');\"";
			$html .= ' title="' . htmlspecialchars($alt) . '"';
			$html .= $this->_attr($attr);
			$html .= '></span>';
		} else {
			$html = '<img';
			$html .= ' src="' . htmlspecialchars($file) . '"';
			if (is_null($alt)) {
				$alt = basename($file);
			}
			$html .= ' alt="' . htmlspecialchars($alt) . '"';
			if ($height) {
				$html .= ' height="' . htmlspecialchars($height) . '"';
			}
			if ($width) {
				$html .= ' width="' . htmlspecialchars($width) . '"';
			}
			$html .= $this->_attr($attr);
			$html .= ' />';
		}
		!
		return $html;
	}
function plugin ( $ file , $ alt = null , $ height = null , $ width = null , $ attr = null ) { if ( is_null ( $ this -> documentRoot ) ) { $ this -> documentRoot = $ _SERVER [ 'DOCUMENT_ROOT' ] ; } $ type = null ; $ info = false ; if ( strpos ( $ file , '://' ) === false ) { $ file = $ this -> imageDir . $ file ; $ info = @ getimagesize ( $ this -> documentRoot . $ file ) ; } else { $ info = @ getimagesize ( $ file ) ; } if ( is_array ( $ info ) ) { $ type = $ info [ 2 ] ; if ( is_null ( $ width ) && is_null ( $ height ) ) { $ width = $ info [ 0 ] ; $ height = $ info [ 1 ] ; } } unset ( $ info ) ; if ( stristr ( $ _SERVER [ 'HTTP_USER_AGENT' ] , 'MSIE' ) && $ type === 3 ) { $ html = '<span style="position: relative;' ; if ( $ height ) { $ html .= ' height: ' . $ height . 'px;' ; } if ( $ width ) { $ html .= ' width: ' . $ width . 'px;' ; } $ html .= ' filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' ; $ html .= " (src=' $ file ',sizingMethod='scale'); \" " ; $ html .= ' title="' . htmlspecialchars ( $ alt ) . '"' ; $ html .= $ this -> _attr ( $ attr ) ; $ html .= '></span>' ; } else { $ html = '<img' ; $ html .= ' src="' . htmlspecialchars ( $ file ) . '"' ; if ( is_null ( $ alt ) ) { $ alt = basename ( $ file ) ; } $ html .= ' alt="' . htmlspecialchars ( $ alt ) . '"' ; if ( $ height ) { $ html .= ' height="' . htmlspecialchars ( $ height ) . '"' ; } if ( $ width ) { $ html .= ' width="' . htmlspecialchars ( $ width ) . '"' ; } $ html .= $ this -> _attr ( $ attr ) ; $ html .= ' />' ; } return $ html ; }
Outputs an <img ... /> tag.
Outputs an <img ... / > tag .
// is the document root set?
 // no, so set it // the image file type code (PNG = 3) // get the file information // no "://" in the file, so it's local // get the file size info as from a stream // did we find the file?
 // capture type info regardless // capture size info where both not specified // clean up // is the file a PNG? if so, check user agent, we will need to // make special allowances for Microsoft IE. // support alpha transparency for PNG files in MSIE // done // not IE, so build a normal image tag. // add the alt attribute // add the height attribute // add the width attribute // done // done!