示例#1
0
			.retrait{
				margin:				0 0 0 10px;
			}
		</style>
	</head>
	<body>
		<!--<script language="JavaScript" type="text/javascript">window.name = "cms_forms";</script>-->
<?php 
// +----------------------------------------------------------------------+
// | Actions                                                              |
// +----------------------------------------------------------------------+
switch ($step) {
    case 2:
        $form = new CMS_forms_formular($_POST["formId"]);
        //analyse the form from his xhtml code
        if (!$form->checkFormCode($_POST["formCode"])) {
            $errorMsg = 'DlgCMSFormsCopyError';
            //then go to error window
            $step = 5;
            break;
        }
        $field = new CMS_forms_field('', $form->getID());
        if (!is_object($field)) {
            $errorMsg = 'DlgCMSFormsFieldError';
            //then go to error window
            $step = 5;
            break;
        }
        switch ($_POST["cms_action"]) {
            case "validate":
                //modify needed field values
示例#2
0
}
// All item relations with categories
$item_relations = new CMS_forms_formularCategories($item);
switch ($_POST["cms_action"]) {
    case "validate":
        //checks and assignments
        $cms_message = "";
        $item->setDebug(false);
        //check mandatory fields
        if (!$_POST["name"]) {
            $cms_message .= $cms_language->getMessage(MESSAGE_FORM_ERROR_MANDATORY_FIELDS);
        } else {
            $item->setAttribute('name', $_POST["name"]);
        }
        //check for copy-pasted code
        if (!$item->checkFormCode($_POST["source_" . $item->getID()])) {
            $cms_message .= $cms_language->getMessage(MESSAGE_FORM_ERROR_COPY_PASTED_CODE, false, MOD_CMS_FORMS_CODENAME);
        }
        $public = $_POST["public"] > -1 ? true : false;
        $item->setAttribute('public', $public);
        $item->setAttribute("responses", (int) $_POST["responses"]);
        // If new item set current user as media owner
        if ($item->getAttribute('ownerID') <= 0) {
            $item->setAttribute('ownerID', $cms_user->getUserID());
        }
        // Validate XHTML source
        $domdocument = new CMS_DOMDocument();
        try {
            $domdocument->loadXML("<dummy>" . $_POST["source_" . $item->getID()] . "</dummy>");
        } catch (DOMException $e) {
            $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_ERROR_INVALID_XHTML, false, MOD_CMS_FORMS_CODENAME) . " : " . $e->getMessage();