17 if (!defined(
"PSF_ENTRY_POINT"))
18 die(
"Not a valid psf entry point");
20 require_once (dirname(__FILE__) .
"/element.php");
24 public $Enabled =
true;
26 public $Selected =
false;
29 public function __construct($_value = NULL, $_text = NULL, $_parent = NULL)
31 $this->Value = $_value;
35 public function ToHtml()
39 $_e .=
' selected="selected"';
40 if ($this->Value !== NULL)
41 $_e .=
' value="' . $this->Value .
'"';
43 $_e .= $this->Text .
"</option>";
50 public $Multiple =
false;
51 public $Enabled =
true;
53 public $Autofocus =
false;
54 public $OnChangeCallback = NULL;
57 public function __construct($_name = NULL, $_parent = NULL)
60 parent::__construct($_parent);
63 public function AddDefaultValue($value, $text = NULL)
68 $item->Selected =
true;
69 $this->Items[] = $item;
72 public function AddValue($value, $text = NULL)
77 $this->Items[] = $item;
80 public function ToHtml()
83 if ($this->Name !== NULL)
84 $_e .=
" name=\"$this->Name\"";
85 if ($this->Style !== NULL)
86 $_e .=
" style=\"" . $this->Style->ToCss() .
"\"";
87 if ($this->OnChangeCallback !== NULL)
88 $_e .=
' onchange="' . $this->OnChangeCallback .
'"';
90 foreach ($this->Items as $item)
91 $_e .=
" " . $item->ToHtml() .
"\n";