示例#1
0
                }
                $field->setAttribute("params", $params);
                $options = array();
                $optionsValues = explode('||', $_POST["selectValues_new"]);
                $optionsLabels = explode('||', $_POST["selectLabels_new"]);
                if (sizeof($optionsValues) && sizeof($optionsLabels)) {
                    foreach ($optionsValues as $key => $value) {
                        $options[$value] = $optionsLabels[$key];
                    }
                }
                $field->setAttribute("options", $options);
                //generate unique name
                $field->setAttribute("name", md5($_POST["label_new"] . $_POST["type_new"] . $_POST["required_new"] . microtime()));
                $field->writeToPersistence();
                //then replace field in XHTML source
                $xhtml = $form->addField($_POST['formCode'], $field);
                //then go to next step (send xhtml to wysiwyg)
                $step = 4;
                break;
        }
        break;
}
// +----------------------------------------------------------------------+
// | Rendering                                                            |
// +----------------------------------------------------------------------+
switch ($step) {
    case 1:
        // used to send wysiwyg form content to server before analysis
        $content = '
			<div id="divInfo" style="DISPLAY: none">
				<form id="analyseForm" action="' . $_SERVER["SCRIPT_NAME"] . '" method="post">