fieldset = 0;
$this->html = '';
$this->xmpp = '';
}
public function getHTML($xmpp){
$this->setXMPP($xmpp);
$this->create();
return $this->html;
}
public function setXMPP($xmpp){
$this->xmpp = $xmpp;
}
public function create(){
$this->xmpp = str_replace('xmlns=', 'ns=', $this->xmpp);
$x = new SimpleXMLElement($this->xmpp);
foreach($x->children() as $element){
switch($element->getName()){
case "title":
$this->outTitle($element);
break;
case "instructions":
$this->outP($element);
break;
case "field":
if($element['type'] != 'hidden' && $element['type'] != 'fixed')
$this->html .='
';
switch($element['type']){
case "boolean":
$this->outCheckbox($element);
break;
case "fixed":
$this->outBold($element);
break;
case "text-single":
$this->outInput($element, "", "");
break;
case "text-multi":
$this->outTextarea($element);
break;
case "text-private":
$this->outInput($element, "password", "");
break;
case "hidden":
$this->outHiddeninput($element);
break;
case "list-multi":
$this->outList($element, "multiple");
break;
case "list-single":
$this->outList($element, "");
break;
case "jid-multi":
$this->outInput($element, "email", "multiple");
break;
case "jid-single":
$this->outInput($element, "email", "");
break;
default:
$this->html .= "";
}
if($element['type'] != 'hidden')
$this->html .='
';
break;
case 'url':
break;
/*XML without element*/
case 'username':
case 'email':
case 'password':
$this->html .='';
$this->outGeneric($element->getName());
$this->html .='
';
break;
default:
$this->html .= "";
}
}
if($this->fieldset>0){
$this->html .= '';
}
}
private function outGeneric($s){
$this->html .= '
';
}
private function outTitle($s){
$this->html .= '
';
}
private function outP($s){
$this->html .= '
';
}
private function outUrl($s) {
$this->html .= '
'.$s->getName().'';
}
private function outBold($s){
if($this->fieldset > 0){
$this->html .= '';
}
$this->html .= '