Skip to content

Commit

Permalink
Merge pull request #13068 from alifrumin/formLink
Browse files Browse the repository at this point in the history
send action links on any page that extends CRM_Core_Page_basic thru hook_civicrm_links
  • Loading branch information
eileenmcnaughton authored Mar 23, 2019
2 parents fe1f075 + 81eb94b commit 30b6117
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions CRM/Core/Page/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,12 @@ public function action(&$object, $action, &$values, &$links, $permission, $force
}
}

$object_type = get_class($object);

if (!$forceAction) {
if (array_key_exists('is_reserved', $object) && $object->is_reserved) {
$values['class'] = 'reserved';
// check if object is relationship type
$object_type = get_class($object);

$exceptions = array(
'CRM_Contact_BAO_RelationshipType',
Expand Down Expand Up @@ -365,7 +366,16 @@ public function action(&$object, $action, &$values, &$links, $permission, $force
// make sure we only allow those actions that the user is permissioned for
$newAction = $newAction & CRM_Core_Action::mask($permissions);

$values['action'] = CRM_Core_Action::formLink($links, $newAction, array('id' => $object->id));
$values['action'] = CRM_Core_Action::formLink(
$links,
$newAction,
['id' => $object->id],
'more',
FALSE,
"basic.$object_type.page",
$object_type,
$object->id
);
}

/**
Expand Down

0 comments on commit 30b6117

Please sign in to comment.