class CRM_Core_Action

The core concept of the system is an action performed on an object. Typically this will be a "data model" object as specified in the API specs. We attempt to keep the number and type of actions consistent and similar across all objects (thus providing both reuse and standards)

Constants

NONE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

ADD

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

UPDATE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

VIEW

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

DELETE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

BROWSE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

ENABLE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

DISABLE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

EXPORT

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

BASIC

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

ADVANCED

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

PREVIEW

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

FOLLOWUP

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

MAP

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

PROFILE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

COPY

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

RENEW

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

DETACH

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

REVERT

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

CLOSE

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

REOPEN

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

MAX_ACTION

Different possible actions are defined here. Keep in sync with the constant from CRM_Core_Form for various modes.

Properties

static array $_names Map the action names to the relevant constant. We perform bit manipulation operations so we can perform multiple actions on the same object if needed
static array $_description The flipped version of the names array, initialized when used

Methods

static int
resolve(string $str)

Called by the request object to translate a string into a mask.

static int
map(mixed $item)

Given a string or an array of strings, determine the bitmask for this set of actions

static int
mapItem(string $item)

Given a string determine the bitmask for this specific string.

static string
description(int $mask)

Given an action mask, find the corresponding description

static string
formLink(array $links, int $mask, array $values, string $extraULName = 'more', bool $enclosedAllInSingleUL = FALSE, null $op = NULL, null $objectName = NULL, int $objectId = NULL)

Given a set of links and a mask, return the html action string for the links associated with the mask

static string
replace(string $str, array $values)

Given a string and an array of values, substitute the real values in the placeholder in the str in the CiviCRM format

static int
mask(array $permissions)

Get the mask for a permission (view, edit or null)

Details

at line 116
static int resolve(string $str)

Called by the request object to translate a string into a mask.

Parameters

string $str The action to be resolved.

Return Value

int the action mask corresponding to the input string

at line 135
static int map(mixed $item)

Given a string or an array of strings, determine the bitmask for this set of actions

Parameters

mixed $item Either a single string or an array of strings.

Return Value

int the action mask corresponding to the input args

at line 158
static int mapItem(string $item)

Given a string determine the bitmask for this specific string.

Parameters

string $item The input action to process.

Return Value

int the action mask corresponding to the input string

at line 173
static string description(int $mask)

Given an action mask, find the corresponding description

Parameters

int $mask The action mask.

Return Value

string the corresponding action description

Given a set of links and a mask, return the html action string for the links associated with the mask

Parameters

array $links The set of link items.
int $mask The mask to be used. a null mask means all items.
array $values The array of values for parameter substitution in the link items.
string $extraULName Enclosed extra links in this UL.
bool $enclosedAllInSingleUL Force to enclosed all links in single UL.
null $op
null $objectName
int $objectId

Return Value

string the html string

at line 313
static string replace(string $str, array $values)

Given a string and an array of values, substitute the real values in the placeholder in the str in the CiviCRM format

Parameters

string $str The string to be replaced.
array $values The array of values for parameter substitution in the str.

Return Value

string the substituted string

at line 328
static int mask(array $permissions)

Get the mask for a permission (view, edit or null)

Parameters

array $permissions

Return Value

int The mask for the above permission