function pageError($err) { $err = l("error") . ": {$err}"; $GLOBALS["h"]->setTitle($err); $e = jumbo(); $legend = $GLOBALS["h"]->html->createElement("legend"); applyText($legend, $err); $e->appendChild($legend); $GLOBALS["h"]->body->appendChild($e); die($GLOBALS["h"]->html->saveHTML()); }
public function apply($html, $el) { $legend = $html->createElement("legend"); applyText($legend, $this->title); $el->appendChild($legend); $e = $html->createElement("form"); $e->setAttribute("method", "POST"); $e->setAttribute("class", "form-horizontal"); $hdiv = $html->createElement("div"); $hdiv->setAttribute("class", "control-group"); if ($this->err) { $ediv = $html->createElement("div"); $ediv->setAttribute("class", "controls"); $elabel = $html->createElement("label"); $elabel->setAttribute("class", "control-label"); $elabel->setAttribute("style", "color:red;"); applyText($elabel, $this->err); $ediv->appendChild($elabel); $e->appendChild($ediv); } $div = $html->createElement("div"); $div->setAttribute("class", "controls"); $label = $html->createElement("label"); $label->setAttribute("class", "control-label"); $hdiv->appendChild($label); applyText($label, $this->qtitle); $s = $html->createElement("select"); foreach ($this->answers as $key => $value) { $ad = $html->createElement("label"); $ad->setAttribute("class", "radio"); $a = $html->createElement("input"); $a->setAttribute("type", "radio"); $a->setAttribute("name", "answer"); $a->setAttribute("value", $key); $ad->appendChild($a); applyText($ad, $value); $div->appendChild($ad); } $hdiv->appendChild($div); $submit = $html->createElement("button"); $submit->setAttribute("type", "submit"); $submit->setAttribute("value", "true"); $submit->setAttribute("name", "send"); $submit->setAttribute("class", "btn btn-default"); applyText($submit, l("next")); $hdiv->appendChild($submit); $e->appendChild($hdiv); $el->appendChild($e); }