/** * Alters an option so that it looks disabled * * @param XhtmlOption $opt * @return XhtmlOption */ protected function DisableOption(XhtmlOption $opt) { $opt->AddAttribute('value', ''); $s_style = trim($opt->GetAttribute('style')); $i_style_len = strlen($s_style); if ($i_style_len > 0 and strrpos($s_style, ';') != $i_style_len) { $s_style .= ';'; } $s_style .= 'color: #aaa;'; $opt->AddAttribute('style', $s_style); return $opt; }
/** * @return bool * @param XhtmlOption $o_control * @desc Add an XhtmlOption to this list */ function AddControl($o_control) { /* @var $o_control XhtmlOption */ if ($this->b_page_valid === false and isset($_POST[$this->GetXhtmlId()]) and $o_control instanceof XhtmlOption and $o_control->GetAttribute('value') == $_POST[$this->GetXhtmlId()]) { $o_control->AddAttribute('selected', 'selected'); } parent::AddControl($o_control); }