4 # FILE: OptionFormField.php
6 # Part of the Collection Workflow Integration System (CWIS)
7 # Copyright 2013 Edward Almasy and Internet Scout Research Group
8 # http://scout.wisc.edu/cwis/
18 # ---- PUBLIC INTERFACE --------------------------------------------------
34 $Name, $IsRequired, $Label, $Length, $Options,
35 $ValidFunc = NULL, $ValidMsgs = NULL)
37 $this->MyLength = $Length;
38 $this->MyOptions = $Options;
40 $this->
FormField($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs);
52 function Length($NewVal = NULL) {
return $this->GetOrSet(
"MyLength", $NewVal); }
59 function Options($NewVal = NULL) {
return $this->GetOrSet(
"MyOptions", $NewVal); }
72 print(
"<select name=\"".$this->MyName.
"\" size=\"".$this->MyLength.
"\">\n");
73 foreach ($this->MyOptions as $OptionValue => $OptionLabel)
75 print(
" <option value=\"".htmlspecialchars($OptionValue).
"\""
76 .(($OptionValue == $this->
Value()) ?
" selected" :
"")
77 .
">".htmlspecialchars($OptionLabel).
"\n");
84 # ---- PRIVATE INTERFACE -------------------------------------------------