afform.php
Table of Contents
Functions
- _afform_fields_filter() : array<string|int, mixed>
- Filter the content of $params to only have supported afform fields.
- afform_civicrm_config() : mixed
- Implements hook_civicrm_config().
- afform_civicrm_install() : mixed
- Implements hook_civicrm_install().
- afform_civicrm_enable() : mixed
- Implements hook_civicrm_enable().
- afform_civicrm_managed() : mixed
- Implements hook_civicrm_managed().
- afform_civicrm_tabset() : mixed
- Implements hook_civicrm_tabset().
- afform_civicrm_pageRun() : mixed
- Implements hook_civicrm_pageRun().
- afform_civicrm_contactSummaryBlocks() : mixed
- Implements hook_civicrm_contactSummaryBlocks().
- _afform_get_contact_types() : array<string|int, mixed>
- Resolve a mixed list of contact types and sub-types into just top-level contact types (Individual, Organization, Household)
- _afform_hook_civicrm_angularModules() : mixed
- Late-listener for Angular modules: adds all Afforms and their dependencies.
- _afform_get_partials() : array<string|int, mixed>
- Callback to retrieve partials for a given afform/angular module.
- afform_civicrm_buildAsset() : mixed
- Implements hook_civicrm_buildAsset().
- afform_civicrm_alterMenu() : mixed
- Implements hook_civicrm_alterMenu().
- afform_civicrm_permission() : mixed
- Implements hook_civicrm_permission().
- afform_civicrm_permission_check() : mixed
- Implements hook_civicrm_permission_check().
- afform_civicrm_permissionList() : mixed
- Implements hook_civicrm_permissionList().
- _afform_clear() : mixed
- Clear any local/in-memory caches based on afform data.
- _afform_angular_module_name() : string
- afform_civicrm_preProcess() : mixed
- Implements hook_civicrm_preProcess().
- afform_civicrm_pre() : mixed
- Implements hook_civicrm_pre().
- afform_civicrm_referenceCounts() : mixed
- Implements hook_civicrm_referenceCounts().
- afform_shortcode_content() : string
- Wordpress only: Render Afform content for shortcodes.
- afform_civicrm_searchKitTasks() : mixed
- Implements hook_civicrm_searchKitTasks().
Functions
_afform_fields_filter()
Filter the content of $params to only have supported afform fields.
_afform_fields_filter(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>afform_civicrm_config()
Implements hook_civicrm_config().
afform_civicrm_config(mixed &$config) : mixed
Parameters
- $config : mixed
Tags
afform_civicrm_install()
Implements hook_civicrm_install().
afform_civicrm_install() : mixed
Tags
afform_civicrm_enable()
Implements hook_civicrm_enable().
afform_civicrm_enable() : mixed
Tags
afform_civicrm_managed()
Implements hook_civicrm_managed().
afform_civicrm_managed(mixed &$entities, mixed $modules) : mixed
Generate a list of entities to create/deactivate/delete when this module is installed, disabled, uninstalled.
Parameters
- $entities : mixed
- $modules : mixed
Tags
afform_civicrm_tabset()
Implements hook_civicrm_tabset().
afform_civicrm_tabset(mixed $tabsetName, mixed &$tabs, mixed $context) : mixed
Adds afforms as contact summary tabs.
Parameters
- $tabsetName : mixed
- $tabs : mixed
- $context : mixed
afform_civicrm_pageRun()
Implements hook_civicrm_pageRun().
afform_civicrm_pageRun(mixed &$page) : mixed
Adds afforms as contact summary blocks.
Parameters
- $page : mixed
afform_civicrm_contactSummaryBlocks()
Implements hook_civicrm_contactSummaryBlocks().
afform_civicrm_contactSummaryBlocks(mixed &$blocks) : mixed
Parameters
- $blocks : mixed
Tags
_afform_get_contact_types()
Resolve a mixed list of contact types and sub-types into just top-level contact types (Individual, Organization, Household)
_afform_get_contact_types(array<string|int, mixed> $mixedTypes) : array<string|int, mixed>
Parameters
- $mixedTypes : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>_afform_hook_civicrm_angularModules()
Late-listener for Angular modules: adds all Afforms and their dependencies.
_afform_hook_civicrm_angularModules(GenericHookEvent $e) : mixed
Must run last so that all other modules are present for reverse-dependency mapping.
Parameters
- $e : GenericHookEvent
Tags
_afform_get_partials()
Callback to retrieve partials for a given afform/angular module.
_afform_get_partials(string $moduleName, array<string|int, mixed> $module) : array<string|int, mixed>
Parameters
- $moduleName : string
-
The module name.
- $module : array<string|int, mixed>
-
The module definition.
Tags
Return values
array<string|int, mixed> —Array(string $filename => string $html).
afform_civicrm_buildAsset()
Implements hook_civicrm_buildAsset().
afform_civicrm_buildAsset(mixed $asset, mixed $params, mixed &$mimeType, mixed &$content) : mixed
Parameters
- $asset : mixed
- $params : mixed
- $mimeType : mixed
- $content : mixed
afform_civicrm_alterMenu()
Implements hook_civicrm_alterMenu().
afform_civicrm_alterMenu(mixed &$items) : mixed
Parameters
- $items : mixed
afform_civicrm_permission()
Implements hook_civicrm_permission().
afform_civicrm_permission(mixed &$permissions) : mixed
Define Afform permissions.
Parameters
- $permissions : mixed
afform_civicrm_permission_check()
Implements hook_civicrm_permission_check().
afform_civicrm_permission_check(mixed $permission, mixed &$granted, mixed $contactId) : mixed
This extends the list of permissions available in CRM_Core_Permission:check()
by introducing virtual-permissions named @afform:myForm
. The evaluation
of these virtual-permissions is dependent on the settings for myForm
.
myForm
may be exposed/integrated through multiple subsystems (routing,
nav-menu, API, etc), and the use of virtual-permissions makes easy to enforce
consistent permissions across any relevant subsystems.
Parameters
- $permission : mixed
- $granted : mixed
- $contactId : mixed
Tags
afform_civicrm_permissionList()
Implements hook_civicrm_permissionList().
afform_civicrm_permissionList(mixed &$permissions) : mixed
Parameters
- $permissions : mixed
Tags
_afform_clear()
Clear any local/in-memory caches based on afform data.
_afform_clear() : mixed
_afform_angular_module_name()
_afform_angular_module_name(string $fileBaseName[, string $format = 'camel' ]) : string
Parameters
- $fileBaseName : string
-
Ex: foo-bar
- $format : string = 'camel'
-
'camel' or 'dash'.
Tags
Return values
string —Ex: 'FooBar' or 'foo-bar'.
afform_civicrm_preProcess()
Implements hook_civicrm_preProcess().
afform_civicrm_preProcess(mixed $formName, mixed &$form) : mixed
Wordpress only: Adds Afforms to the shortcode dialog (when editing pages/posts).
Parameters
- $formName : mixed
- $form : mixed
afform_civicrm_pre()
Implements hook_civicrm_pre().
afform_civicrm_pre(mixed $op, mixed $entity, mixed $id, mixed &$params) : mixed
Parameters
- $op : mixed
- $entity : mixed
- $id : mixed
- $params : mixed
afform_civicrm_referenceCounts()
Implements hook_civicrm_referenceCounts().
afform_civicrm_referenceCounts(mixed $dao, mixed &$counts) : mixed
Parameters
- $dao : mixed
- $counts : mixed
afform_shortcode_content()
Wordpress only: Render Afform content for shortcodes.
afform_shortcode_content(string $content, array<string|int, mixed> $atts, array<string|int, mixed> $args, string $context) : string
Parameters
- $content : string
-
HTML Markup
- $atts : array<string|int, mixed>
-
Shortcode attributes.
- $args : array<string|int, mixed>
-
Existing shortcode arguments.
- $context : string
-
How many shortcodes are present on the page: 'single' or 'multiple'.
Return values
string —Modified markup.
afform_civicrm_searchKitTasks()
Implements hook_civicrm_searchKitTasks().
afform_civicrm_searchKitTasks(array<string|int, mixed> &$tasks, bool $checkPermissions, int|null $userID) : mixed
Parameters
- $tasks : array<string|int, mixed>
- $checkPermissions : bool
- $userID : int|null