public static function getSystemImage($image, $dir = 'images')
	{
		$image = ltrim($image, DS);

		if (!self::isImage($image))
		{
			return $image;
		}

		$template = DS . 'core' . DS . 'templates' . DS . 'system';
		if ($t = self::app('template'))
		{
			$template = substr($t->path, strlen(PATH_ROOT));
		}

		$paths = array();
		$paths[] = $template . DS . 'html' . DS . 'system' . ($dir ? DS . $dir : '') . DS . $image;
		$paths[] = DS . 'core' . DS . 'assets' . DS . $dir . DS . $image;

		// Run through each path until we find one that works
		foreach ($paths as $path)
		{
			if (file_exists(PATH_ROOT . $path))
			{
				// Push script to the document
				return str_replace('/administrator', '', rtrim(Request::base(true), '/')) . $path;
			}
		}
	}
public static function getSystemImage($image, $dir = 'images')
	{
		$image = ltrim($image, DS);

		if (!self::isImage($image))
		{
			return $image;
		}

		$template = DS . 'core' . DS . 'templates' . DS . 'system';
		if ($t = self::app('template'))
		{
			$template = substr($t->path, strlen(PATH_ROOT));
		}

		$paths = array();
		$paths[] = $template . DS . 'html' . DS . 'system' . ($dir ? DS . $dir : '') . DS . $image;
		$paths[] = DS . 'core' . DS . 'assets' . DS . $dir . DS . $image;

		// Run through each path until we find one that works
		foreach ($paths as $path)
		{
			if (file_exists(PATH_ROOT . $path))
			{
				// Push script to the document
				return str_replace('/administrator', '', rtrim(Request::base(true), '/')) . $path;
			}
		}
	}
public static function getSystemImage ( $ image , $ dir = 'images' ) { $ image = ltrim ( $ image , DS ) ; if ( ! self :: isImage ( $ image ) ) { return $ image ; } $ template = DS . 'core' . DS . 'templates' . DS . 'system' ; if ( $ t = self :: app ( 'template' ) ) { $ template = substr ( $ t -> path , strlen ( PATH_ROOT ) ) ; } $ paths = array ( ) ; $ paths [ ] = $ template . DS . 'html' . DS . 'system' . ( $ dir ? DS . $ dir : '' ) . DS . $ image ; $ paths [ ] = DS . 'core' . DS . 'assets' . DS . $ dir . DS . $ image ; // Run through each path until we find one that works foreach ( $ paths as $ path ) { if ( file_exists ( PATH_ROOT . $ path ) ) { // Push script to the document return str_replace ( '/administrator' , '' , rtrim ( Request :: base ( true ) , '/' ) ) . $ path ; } } }
Gets the path to a system image

@param   string  $image  Image to look for
@param   string  $dir    Asset directory to look in
@return  string  Path to an image file
Gets the path to a system image