Answers.Body: <p>$op = 'participant.selector.row';
  $objectName = 'Participant';</p>
  
  <p>The hook is called from CRM_Core_Action::formLink</p>
  
  <p>search for the above string in CRM/Event/Selector/Search.php, and the last couple of arguments gives the needed values which is then passed on to the hook</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-10T21:02:26.953Z
Answers.LastActivityDate: 2015-05-10T21:02:26.953Z
Answers.UserDisplayName: Donald Lobo
Body: <p>I've looked at CRM/Event/Selector/Search.php to see it creating the View/Edit/Delete links, but am just unsure how to make this work. Can someone advise what the appropriate $objectName and $op should be? I'd like to do something like this:</p>
  
  <pre><code>function testmodule_civicrm_links( $op, $objectName, $objectId, &amp;$links, &amp;$mask, &amp;$values ) {
  
    switch ($objectName) {
      case ???:  //Event or Contact perhaps?
  
        switch ($op) {
          case ???:  //a participant selector perhaps?
  
              $links[] = array(
                  'name' =&gt; ts('Send Invoice'),
                  'title' =&gt; ts('Send Invoice'),
                  'url' =&gt; 'civicrm/activity/email/add',
                  'qs' =&gt; 'action=add&amp;reset=1&amp;cid=%%cid%%&amp;selectedChild=activity&amp;atype=3&amp;pid=%%id%%'
                );
            break;
        }
    }
  }
  </code></pre>
  
  <p>Where %%id%% comes in from the context of that row in the grid. If I can't get there with a hook, would it be prudent to extend CRM_Event_Selector_Search and override the links function with my own?</p>
  
Tags: <hooks><developer><links>
Title: Can hook_civicrm_links create links beside rows of a contact's Events tab?
ThreadText: # Can hook_civicrm_links create links beside rows of a contact's Events tab?
  
  (Asked by: username_0 on 2015-05-10)
  
  I've looked at CRM/Event/Selector/Search.php to see it creating the View/Edit/Delete links, but am just unsure how to make this work. Can someone advise what the appropriate $objectName and $op should be? I'd like to do something like this:
  
  ```
  function testmodule_civicrm_links( $op, $objectName, $objectId, &$links, &$mask, &$values ) {
  
    switch ($objectName) {
      case ???:  //Event or Contact perhaps?
  
        switch ($op) {
          case ???:  //a participant selector perhaps?
  
              $links[] = array(
                  'name' => ts('Send Invoice'),
                  'title' => ts('Send Invoice'),
                  'url' => 'civicrm/activity/email/add',
                  'qs' => 'action=add&reset=1&cid=%%cid%%&selectedChild=activity&atype=3&pid=%%id%%'
                );
            break;
        }
    }
  }
  
  ```
  
  Where %%id%% comes in from the context of that row in the grid. If I can't get there with a hook, would it be prudent to extend CRM\_Event\_Selector\_Search and override the links function with my own?
  
  **Tags:** hooks, developer, links
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-10. Score: 1 | Accepted answer
  
  $op = 'participant.selector.row';
  $objectName = 'Participant';
  
  The hook is called from CRM\_Core\_Action::formLink
  
  search for the above string in CRM/Event/Selector/Search.php, and the last couple of arguments gives the needed values which is then passed on to the hook
  
  
  ---
  
  