firequest.class.php

FormIt

Copyright 2009-2011 by Shaun McCormick shaun@modx.com

FormIt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

FormIt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

package
formit

\fiRequest

Handles all pre and POST requests for FormIt and abstracts hooks and validation processing.

package
formit

Properties

Propertypublicboolean  $clearFieldsAtEnd= 'false'

Set to true if wanting to prevent the clearing of fields at the end

Default valuefalseDetails
Type
boolean
Propertypublicarray  $config= 'array'

An array of configuration properties

Default valuearrayDetails
Type
array
Propertypublic\fiDictionary  $dictionary= ''

Details
Type
\fiDictionary
Propertypublic\FormIt  $formit= ''

A reference to the FormIt instance

Details
Type
\FormIt
Propertypublic\modX  $modx= ''

A reference to the modX instance

Details
Type
\modX
Propertypublic\FormItReCaptcha  $reCaptcha= ''

Details
Type
\FormItReCaptcha
Propertypublic\fiValidator  $validator= ''

Details
Type
\fiValidator

Methods

methodpublic  __construct( \FormIt $formit, array $config = array ) : \fiRequest
Parameters
Name Type Description
$formit \FormIt

&$formit A reference to the FormIt class instance.

$config array Optional. An array of configuration parameters.
Returns
Type Description
\fiRequest
methodpublic  checkForRedirect( ) : void
Check to see if the redirect URL was set; if so, redirect
methodpublic  convertMODXTags(  $v ) :
Parameters
Name Type Description
$v
methodpublic  handle( array $fields = array ) : string|void
Handle the POST request
Parameters
Name Type Description
$fields array
Returns
Type Description
stringvoid
methodpublic  hasHook( string $hook ) : boolean
Check to see if a hook has been passed
Parameters
Name Type Description
$hook string
Returns
Type Description
boolean
methodpublic  hasSubmission( ) : boolean
Checks to see if a POST submission for this form has occurred
Returns
Type Description
boolean
methodpublic  loadDictionary( ) : null|\fiDictionary
Load the dictionary storage mechanism
Returns
Type Description
null\fiDictionary
methodpublic  loadReCaptcha( array $config = array ) : \reCaptcha
Load the reCaptcha service class
Parameters
Name Type Description
$config array An array of configuration parameters for the reCaptcha class
Returns
Type Description
\reCaptcha
methodpublic  loadValidator( ) : \fiValidator
Loads the Validator class.
Returns
Type Description
\fiValidator
Details
access
public
methodpublic  postProcess( ) : bool
Handle post-processing through postHooks
Returns
Type Description
bool
methodpublic  prepare( ) : array
Handle all pre-request data, including loading of preHooks, reCaptcha preparation, and the math hook.
Returns
Type Description
array
methodpublic  runPostHooks( ) : boolean
Run any postHooks that were specified.
Returns
Type Description
boolean
methodpublic  runPreHooks( ) : array
Load and run preHooks, setting any fields passed.
Returns
Type Description
array
methodpublic  setFieldsAsPlaceholders( ) : void
Sets the fields to MODX placeholders
methodpublic  setSuccessMessage( string $message ) : void
Sets the success message placeholders
Parameters
Name Type Description
$message string
methodpublic  validate( string $validationString ) : bool
Validate all fields prior to post processing
Parameters
Name Type Description
$validationString string
Returns
Type Description
bool
Documentation was generated by DocBlox 0.13-DEV.