17 if (!defined(
"PSF_ENTRY_POINT"))
18 die(
"Not a valid psf entry point");
20 require_once (dirname(__FILE__) .
"/../../functions.php");
21 require_once (dirname(__FILE__) .
"/element.php");
25 public $Format = NULL;
26 public $Height = NULL;
29 public $AlternateText =
"";
32 public function __construct($image, $alt =
"", $w = NULL, $h = NULL, $_parent = NULL)
34 parent::__construct($_parent = NULL);
36 $this->AlternateText = $alt;
41 public function GetFormat()
43 $f =
" alt=\"" . $this->AlternateText .
"\"";
44 if ($this->Width !== NULL)
45 $f .=
" width=\"" . $this->Width .
"\"";
46 if ($this->Height !== NULL)
47 $f .=
" height=\"" . $this->Height .
"\"";
48 if ($this->Style !== NULL)
49 $f .=
" style=\"" . $this->Style->ToCss() .
"\"";
50 if ($this->Format !== NULL)
52 $f .=
" $this->Format";
57 public function ToHtml()
59 $html =
"<img src=\"" . $this->URL .
"\"" . $this->GetFormat();
60 if ($this->Title !== NULL)
61 $html .=
" title=\"" . $this->Title .
"\"";
62 if ($this->ClassName !== NULL)
63 $html .=
" class=\"" . $this->ClassName .
"\"";
65 if ($this->Style !== NULL)
67 $style = $this->Style->ToCss();
68 if (strlen($style) > 0)
69 $html .=
" style=\"" . $style .
"\"";