3 # FILE: OptionFormField.php 5 # Part of the Collection Workflow Integration System (CWIS) 6 # Copyright 2013-2015 Edward Almasy and Internet Scout Research Group 7 # http://scout.wisc.edu/cwis/ 17 # ---- PUBLIC INTERFACE -------------------------------------------------- 33 $Name, $IsRequired, $Label, $Length, $Options,
34 $ValidFunc = NULL, $ValidMsgs = NULL)
36 $this->MyLength = $Length;
37 $this->MyOptions = $Options;
39 parent::__construct($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs);
51 public function Length($NewVal = NULL)
53 return $this->GetOrSet(
"MyLength", $NewVal);
63 return $this->GetOrSet(
"MyOptions", $NewVal);
75 public function PrintInput($DisplayErrorIndicator = FALSE)
77 print(
"<select name=\"".$this->MyName.
"\" size=\"".$this->MyLength.
"\">\n");
78 foreach ($this->MyOptions as $OptionValue => $OptionLabel)
80 print(
" <option value=\"".htmlspecialchars($OptionValue).
"\"" 81 .(($OptionValue == $this->
Value()) ?
" selected" :
"")
82 .
">".htmlspecialchars($OptionLabel).
"\n");
89 # ---- PRIVATE INTERFACE -------------------------------------------------