-
Andie Hunt authoredAndie Hunt authored
hook_civicrm_links
Description
This hook is an opportunity to modify action links in CiviCRM. These include the actions at the end of a search result row, the Create New dropdown, and the Actions dropdown at the top of a contact record.
Note: remember to use the string processing functions of your host
framework ( ts()
for CiviCRM extensions, t()
for Drupal modules, etc).
Definition
hook_civicrm_links($op, $objectName, $objectId, &$links, &$mask, &$values)
Parameters
-
string
$op
- the context in which the links appear, such asview.contact.activity
,survey.dashboard.row
, orpdfFormat.manage.action
-
string
$objectName
- the entity the links relate to (orNULL
if$op
iscreate.new.shorcuts
) -
int
$objectId
- the CiviCRM internal ID of the entity (orNULL
if$op
iscreate.new.shorcuts
) -
array
$links
- the links to modify in placeeach item in the array may have:
-
name
: the link text -
url
: the link URL base path (likecivicrm/contact/view
, and fillable from$values
) -
qs
: the link URL query parameters to be used by sprintf() with values (like `reset=1&cid=%%id%%` when `values['id']` is the contact ID) -
title
(optional): the text that appears when hovering over the link -
extra
(optional): additional attributes for the<a>
tag (fillable from$values
) -
bit
(optional): a binary number that will be fitered by mask (sending nothing as `links['bit']` means the link will always display) -
ref
(optional, recommended): a CSS class to apply to the<a>
tag. -
class
(optional): Any other CSS classes to apply to the<a>
tag (e.g. no-popup).
-
-
int
$mask
- a bitmask that will fiter$links
-
array
$values
- values to fill$links['url']
,$links['qs']
, and/or$links['extra']
usingsprintf()
-style percent signs
Returns
NULL