* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team * */ // {{{ICINGA_LICENSE_HEADER}}} /** * Class Zend_View_Helper_Img */ class Zend_View_Helper_Img extends Zend_View_Helper_Abstract { public function img($url, array $properties = array()) { $attributes = array(); $has_alt = false; foreach ($properties as $key => $val) { if ($key === 'alt') $has_alt = true; $attributes[] = sprintf( '%s="%s"', filter_var($key, FILTER_SANITIZE_URL), filter_var($val, FILTER_SANITIZE_FULL_SPECIAL_CHARS) ); } if (! $has_alt) $attributes[] = 'alt=""'; return sprintf( '', $this->view->baseUrl($url), !empty($attributes) ? ' ' . implode(' ', $attributes) : '' ); } } // @codingStandardsIgnoreStart