CRM_Core_Controller
class CRM_Core_Controller extends HTML_QuickForm_Controller
Class CRM_Core_Controller
Properties
protected string | $_title | The title associated with this controller. | |
string | $_key | The key associated with this controller. | |
protected object | $_scope | The name of the session scope where values are stored. | |
protected object | $_stateMachine | The state machine associated with this controller. | |
protected bool | $_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 | $_skipRedirection | After entire form execution complete, do we want to skip control redirection. | |
bool | $_print | Are we in print mode? if so we need to modify the display functionality to do a minimal display :) | |
bool | $_generateQFKey | Should we generate a qfKey, true by default | |
string | $_QFResponseType | QF response type. | |
static protected CRM_Core_Smarty | $_template | Cache the smarty template for efficiency reasons. | |
static protected CRM_Core_Session | $_session | Cache the session for efficiency reasons. | |
protected object | $_parent | The parent of this form if embedded. | |
string | $_destination | The destination if set will override the destination the code wants to send it to. | |
string | $_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 |
Methods
All CRM single or multi page pages should inherit from this class.
No description
No description
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
No description
Helper function to add all the needed default actions.
Getter method for stateMachine.
Add pages to the controller. Note that the controller does not really care the order in which the pages are added
QFC does not provide native support to have different 'submit' buttons.
Destroy all the session state of the controller.
Virtual function to do any processing of data.
Store the variable with the value in the form scope.
Get the variable from the form scope.
Create the header for the wizard from the list of pages.
No description
Assign value to name in template.
Assign value to name in template by reference.
Appends values to template variables.
Returns an array containing template variables.
Setter for embedded.
Getter for embedded.
Setter for skipRedirection.
Getter for skipRedirection.
No description
No description
Setter for print.
Getter for print.
No description
No description
No description
No description
No description
No description
No description
Write a simple fatal error message.
No description
Instead of outputting a fatal error message, we'll just redirect to the entryURL if present
Details
at line 176
__construct(string $title = NULL, bool $modal = TRUE, mixed $mode = NULL, string $scope = NULL, bool $addSequence = FALSE, bool $ignoreKey = FALSE)
All CRM single or multi page pages should inherit from this class.
at line 279
fini()
at line 293
mixed|string
key(string $name, bool $addSequence = FALSE, bool $ignoreKey = FALSE)
at line 333
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
This run is basically a composition of the original run and the jump action
at line 357
bool
validate()
at line 384
addActions(string $uploadDirectory = NULL, array $uploadNames = NULL)
Helper function to add all the needed default actions.
Note that the framework redefines all of the default QFC actions.
at line 411
CRM_Core_StateMachine
getStateMachine()
Getter method for stateMachine.
at line 420
setStateMachine(CRM_Core_StateMachine $stateMachine)
Setter method for stateMachine.
at line 432
addPages(CRM_Core_StateMachine $stateMachine, const|int $action = CRM_Core_Action::NONE)
Add pages to the controller. Note that the controller does not really care the order in which the pages are added
at line 481
string
getButtonName()
QFC does not provide native support to have different 'submit' buttons.
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'.
at line 489
reset()
Destroy all the session state of the controller.
at line 502
process()
Virtual function to do any processing of data.
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
at line 512
set(string|array $name, mixed $value = NULL)
Store the variable with the value in the form scope.
at line 524
mixed
get(string $name)
Get the variable from the form scope.
at line 537
array
wizardHeader(string $currentPageName)
Create the header for the wizard from the list of pages.
Store the created header in smarty
at line 572
addWizardStyle(array $wizard)
at line 592
assign(string $var, mixed $value = NULL)
Assign value to name in template.
at line 603
assign_by_ref(string $var, mixed $value)
Assign value to name in template by reference.
at line 615
append(array|string $tpl_var, mixed $value = NULL, bool $merge = FALSE)
Appends values to template variables.
at line 626
array
get_template_vars(string $name = NULL)
Returns an array containing template variables.
at line 635
setEmbedded(bool $embedded)
Setter for embedded.
at line 645
bool
getEmbedded()
Getter for embedded.
at line 654
setSkipRedirection(bool $skipRedirection)
Setter for skipRedirection.
at line 664
bool
getSkipRedirection()
Getter for skipRedirection.
at line 671
setWord(null $fileName = NULL)
at line 685
setExcel(null $fileName = NULL)
at line 702
setPrint(bool $print)
Setter for print.
at line 718
bool
getPrint()
Getter for print.
at line 725
string
getTemplateFile()
at line 747
addUploadAction($uploadDir, $uploadNames)
at line 775
setParent($parent)
at line 782
object
getParent()
at line 789
string
getDestination()
at line 797
setDestination(null $url = NULL, bool $setToReferer = FALSE)
at line 815
mixed
cancelAction()
at line 827
invalidKey()
Write a simple fatal error message.
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
at line 831
invalidKeyCommon()
at line 840
invalidKeyRedirect()
Instead of outputting a fatal error message, we'll just redirect to the entryURL if present