Documentation

CRM_Contribute_Controller_Contribution extends CRM_Core_Controller
in package

This class is used by the Search functionality.

  • the search controller is used for building/processing multiform searches.

Typically the first form will display the search criteria and it's results

The second form is used to process search results with the associated actions

Table of Contents

Properties

$_destination  : string
The destination if set will override the destination the code wants to send it to.
$_entryURL  : string
The entry url for a top level form or wizard. Typically the URL with a reset=1 used to redirect back to when we land into some session wierdness
$_generateQFKey  : bool
Should we generate a qfKey, true by default
$_key  : string
The key associated with this controller.
$_print  : int|string
Are we in print mode? if so we need to modify the display functionality to do a minimal display :)
$_QFResponseType  : string
QF response type.
$_embedded  : bool
Is this object being embedded in another object. If so the display routine needs to not do any work. (The parent object takes care of the display)
$_parent  : object
The parent of this form if embedded.
$_scope  : object
The name of the session scope where values are stored.
$_session  : CRM_Core_Session
Cache the session for efficiency reasons.
$_skipRedirection  : bool
After entire form execution complete, do we want to skip control redirection.
$_stateMachine  : object
The state machine associated with this controller.
$_template  : CRM_Core_Smarty
Cache the smarty template for efficiency reasons.
$_title  : string
The title associated with this controller.

Methods

__construct()  : mixed
Class constructor.
addActions()  : mixed
Helper function to add all the needed default actions.
addPages()  : mixed
Add pages to the controller. Note that the controller does not really care the order in which the pages are added
addUploadAction()  : mixed
addWizardStyle()  : mixed
append()  : mixed
Appends values to template variables.
assign()  : mixed
Assign value to name in template.
assign_by_ref()  : mixed
Assign value to name in template by reference.
cancelAction()  : mixed
fini()  : mixed
get()  : mixed
Get the variable from the form scope.
get_template_vars()  : array<string|int, mixed>
Returns an array containing template variables.
getButtonName()  : string
QFC does not provide native support to have different 'submit' buttons.
getDestination()  : string
getEmbedded()  : bool
Getter for embedded.
getParent()  : object
getPrint()  : int|string
Getter for print.
getSkipRedirection()  : bool
Getter for skipRedirection.
getStateMachine()  : CRM_Core_StateMachine
Getter method for stateMachine.
getTemplateFile()  : string
getTemplateVars()  : mixed
Get the value/s assigned to the Template Engine (Smarty).
invalidKey()  : mixed
Write a simple fatal error message.
invalidKeyCommon()  : mixed
invalidKeyRedirect()  : mixed
Instead of outputting a fatal error message, we'll just redirect to the entryURL if present
key()  : mixed|string
process()  : mixed
Virtual function to do any processing of data.
reset()  : mixed
Destroy all the session state of the controller.
run()  : mixed
Process the request, overrides the default QFC run method This routine actually checks if the QFC is modal and if it is the first invalid page, if so it call the requested action if not, it calls the display action on the first invalid page avoids the issue of users hitting the back button and getting a broken page
set()  : mixed
Store the variable with the value in the form scope.
setDestination()  : mixed
setEmbedded()  : mixed
Setter for embedded.
setExcel()  : void
Output HTTP headers for Excel document (note .xls, not the newer .xlsx format)
setParent()  : mixed
setPrint()  : void
Setter for print.
setSkipRedirection()  : mixed
Setter for skipRedirection.
setStateMachine()  : mixed
Setter method for stateMachine.
setWord()  : void
Output HTTP headers for Word document (note .doc, not the newer .docx format)
validate()  : bool
wizardHeader()  : array<string|int, mixed>
Create the header for the wizard from the list of pages.

Properties

$_destination

The destination if set will override the destination the code wants to send it to.

public string $_destination = \NULL

$_entryURL

The entry url for a top level form or wizard. Typically the URL with a reset=1 used to redirect back to when we land into some session wierdness

public string $_entryURL = \NULL

$_generateQFKey

Should we generate a qfKey, true by default

public bool $_generateQFKey = \TRUE

$_key

The key associated with this controller.

public string $_key

$_print

Are we in print mode? if so we need to modify the display functionality to do a minimal display :)

public int|string $_print = 0

Should match a CRM_Core_Smarty::PRINT_* constant, or equal 0 if not in print mode

$_QFResponseType

QF response type.

public string $_QFResponseType = 'html'

$_embedded

Is this object being embedded in another object. If so the display routine needs to not do any work. (The parent object takes care of the display)

protected bool $_embedded = \FALSE

$_parent

The parent of this form if embedded.

protected object $_parent = \NULL

$_scope

The name of the session scope where values are stored.

protected object $_scope

$_skipRedirection

After entire form execution complete, do we want to skip control redirection.

protected bool $_skipRedirection = \FALSE

Default - It get redirect to user context.

Useful when we run form in non civicrm context and we need to transfer control back.(eg. drupal)

$_stateMachine

The state machine associated with this controller.

protected object $_stateMachine

$_title

The title associated with this controller.

protected string $_title

Methods

__construct()

Class constructor.

public __construct([string $title = NULL ][, bool|int $action = CRM_Core_Action::NONE ][, bool $modal = TRUE ]) : mixed
Parameters
$title : string = NULL
$action : bool|int = CRM_Core_Action::NONE
$modal : bool = TRUE

addActions()

Helper function to add all the needed default actions.

public addActions([string $uploadDirectory = NULL ][, array<string|int, mixed> $uploadNames = NULL ]) : mixed

Note that the framework redefines all of the default QFC actions.

Parameters
$uploadDirectory : string = NULL

to store all the uploaded files

$uploadNames : array<string|int, mixed> = NULL

for the various upload buttons (note u can have more than 1 upload)

addPages()

Add pages to the controller. Note that the controller does not really care the order in which the pages are added

public addPages(CRM_Core_StateMachine &$stateMachine[, const|int $action = CRM_Core_Action::NONE ]) : mixed
Parameters
$stateMachine : CRM_Core_StateMachine
$action : const|int = CRM_Core_Action::NONE

the mode in which the state machine is operating typically this will be add/view/edit

addUploadAction()

public addUploadAction(mixed $uploadDir, mixed $uploadNames) : mixed
Parameters
$uploadDir : mixed
$uploadNames : mixed

addWizardStyle()

public addWizardStyle(array<string|int, mixed> &$wizard) : mixed
Parameters
$wizard : array<string|int, mixed>

append()

Appends values to template variables.

public append(array<string|int, mixed>|string $tpl_var[, mixed $value = NULL ][, bool $merge = FALSE ]) : mixed
Parameters
$tpl_var : array<string|int, mixed>|string

the template variable name(s)

$value : mixed = NULL

The value to append.

$merge : bool = FALSE

assign()

Assign value to name in template.

public assign(string $var[, mixed $value = NULL ]) : mixed
Parameters
$var : string
$value : mixed = NULL

Value of variable.

assign_by_ref()

Assign value to name in template by reference.

public assign_by_ref(string $var, mixed &$value) : mixed

since 5.72 will be removed around 5.84

Parameters
$var : string
$value : mixed

(reference) value of variable.

get()

Get the variable from the form scope.

public get(string $name) : mixed
Parameters
$name : string

name of the variable.

get_template_vars()

Returns an array containing template variables.

public get_template_vars([string $name = NULL ]) : array<string|int, mixed>

since 5.69 will be removed around 5.93. use getTemplateVars.

Parameters
$name : string = NULL
Return values
array<string|int, mixed>

getButtonName()

QFC does not provide native support to have different 'submit' buttons.

public getButtonName() : string

We introduce this notion to QFC by using button specific data. Thus if we have two submit buttons, we could have one displayed as a button and the other as an image, both are of type 'submit'.

Return values
string

the name of the button that has been pressed by the user

getDestination()

public getDestination() : string
Return values
string

getEmbedded()

Getter for embedded.

public getEmbedded() : bool
Return values
bool

return the embedded value

getParent()

public getParent() : object
Return values
object

getPrint()

Getter for print.

public getPrint() : int|string
Return values
int|string

Value matching a CRM_Core_Smarty::PRINT_* constant, or 0 if not in print mode

getSkipRedirection()

Getter for skipRedirection.

public getSkipRedirection() : bool
Return values
bool

return the skipRedirection value

getTemplateFile()

public getTemplateFile() : string
Return values
string

getTemplateVars()

Get the value/s assigned to the Template Engine (Smarty).

public getTemplateVars([string|null $name = NULL ]) : mixed
Parameters
$name : string|null = NULL

invalidKey()

Write a simple fatal error message.

public invalidKey() : mixed

Other controllers can decide to do something else and present the user a better message and/or redirect to the same page with a reset url

invalidKeyCommon()

public invalidKeyCommon() : mixed

invalidKeyRedirect()

Instead of outputting a fatal error message, we'll just redirect to the entryURL if present

public invalidKeyRedirect() : mixed

key()

public key(string $name[, bool $addSequence = FALSE ][, bool $ignoreKey = FALSE ]) : mixed|string
Parameters
$name : string
$addSequence : bool = FALSE
$ignoreKey : bool = FALSE
Return values
mixed|string

process()

Virtual function to do any processing of data.

public process() : mixed

Sometimes it is useful for the controller to actually process data. This is typically used when we need the controller to figure out what pages are potentially involved in this wizard. (this is dynamic and can change based on the arguments

reset()

Destroy all the session state of the controller.

public reset() : mixed

run()

Process the request, overrides the default QFC run method This routine actually checks if the QFC is modal and if it is the first invalid page, if so it call the requested action if not, it calls the display action on the first invalid page avoids the issue of users hitting the back button and getting a broken page

public run() : mixed

This run is basically a composition of the original run and the jump action

set()

Store the variable with the value in the form scope.

public set(string|array<string|int, mixed> $name[, mixed $value = NULL ]) : mixed
Parameters
$name : string|array<string|int, mixed>

name of the variable or an assoc array of name/value pairs

$value : mixed = NULL

Value of the variable if string.

setDestination()

public setDestination([string|null $url = NULL ][, bool $setToReferer = FALSE ]) : mixed
Parameters
$url : string|null = NULL
$setToReferer : bool = FALSE

setEmbedded()

Setter for embedded.

public setEmbedded(bool $embedded) : mixed
Parameters
$embedded : bool

setExcel()

Output HTTP headers for Excel document (note .xls, not the newer .xlsx format)

public setExcel([string|null $fileName = NULL ]) : void
Parameters
$fileName : string|null = NULL

setParent()

public setParent(mixed $parent) : mixed
Parameters
$parent : mixed

setPrint()

Setter for print.

public setPrint(int|string $print) : void

Historically the $print argument has also accepted a string (xls or doc), but this usage is now deprecated.

Parameters
$print : int|string

Should match a CRM_Core_Smarty::PRINT_* constant, or equal 0 if not in print mode

setSkipRedirection()

Setter for skipRedirection.

public setSkipRedirection(bool $skipRedirection) : mixed
Parameters
$skipRedirection : bool

setWord()

Output HTTP headers for Word document (note .doc, not the newer .docx format)

public setWord([string|null $fileName = NULL ]) : void
Parameters
$fileName : string|null = NULL

validate()

public validate() : bool
Return values
bool

wizardHeader()

Create the header for the wizard from the list of pages.

public wizardHeader(string $currentPageName) : array<string|int, mixed>

Store the created header in smarty

Parameters
$currentPageName : string

Name of the page being displayed.

Return values
array<string|int, mixed>

        
On this page

Search results