public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/builder/easyform.php
/**
		 * Handle processing the form when it's posted, such as saving and handling errors.
		 */
Handle processing the form when it's posted, such as saving and handling errors.
Handle processing the form when it ' s posted such as saving and handling errors .
protected function processPost() {
			if ( ! $this->formObj ) {
				return false;
			}
			if ( $this->formObj->formSubmitted() ) {
				if ( $this->formObj->formValid() ) {
					$originalFormValues = $this->formObj->getFormValues();
					$gotFnErrorMsg = false;
					if ( $this->filterExtraValidationFunction && function_exists( $this->filterExtraValidationFunction ) ) {
						$gotFnErrorMsg = call_user_func( $this->filterExtraValidationFunction, $originalFormValues, $this );
					}
					if ( $gotFnErrorMsg ) {
						$this->messages = $this->showMessage( $gotFnErrorMsg, true );
						return false;
					}
					if ( $this->filterBeforeSaveFunction && function_exists( $this->filterBeforeSaveFunction ) ) {
						$formValues = call_user_func( $this->filterBeforeSaveFunction, $originalFormValues, $this );
						$this->loadDefaults( $formValues );
					} else {
						$formValues = $originalFormValues;
					}
					$this->handleSave( $formValues );
					if ( $this->afterSaveFunction && function_exists( $this->afterSaveFunction ) ) {
						call_user_func( $this->afterSaveFunction, $formValues, $originalFormValues, $this );
					}
				} else {
					$this->messages .= $this->showListOfErrors( $this->formObj->getListOfErrors() );
				}
			}
		}
protected function processPost ( ) { if ( ! $ this -> formObj ) { return false ; } if ( $ this -> formObj -> formSubmitted ( ) ) { if ( $ this -> formObj -> formValid ( ) ) { $ originalFormValues = $ this -> formObj -> getFormValues ( ) ; $ gotFnErrorMsg = false ; if ( $ this -> filterExtraValidationFunction && function_exists ( $ this -> filterExtraValidationFunction ) ) { $ gotFnErrorMsg = call_user_func ( $ this -> filterExtraValidationFunction , $ originalFormValues , $ this ) ; } if ( $ gotFnErrorMsg ) { $ this -> messages = $ this -> showMessage ( $ gotFnErrorMsg , true ) ; return false ; } if ( $ this -> filterBeforeSaveFunction && function_exists ( $ this -> filterBeforeSaveFunction ) ) { $ formValues = call_user_func ( $ this -> filterBeforeSaveFunction , $ originalFormValues , $ this ) ; $ this -> loadDefaults ( $ formValues ) ; } else { $ formValues = $ originalFormValues ; } $ this -> handleSave ( $ formValues ) ; if ( $ this -> afterSaveFunction && function_exists ( $ this -> afterSaveFunction ) ) { call_user_func ( $ this -> afterSaveFunction , $ formValues , $ originalFormValues , $ this ) ; } } else { $ this -> messages .= $ this -> showListOfErrors ( $ this -> formObj -> getListOfErrors ( ) ) ; } } }
Handle processing the form when it's posted, such as saving and handling errors.
Handle processing the form when it ' s posted such as saving and handling errors .
// Form is valid, so save data // Add optional function to validate the data // Got an error message, so show and abort. // Add optional filter to tweak the form values before saving // If we're modifying values, then we need to update the data being stored in the form // Now save the form values as normal. // Optional function once data has been saved