/** * This method returns the links that are given for each search row. * currently the links added for each row are * * - View * - Edit * * @return array * @access public * */ static function &links() { $args = func_get_args(); $hideOption = CRM_Utils_Array::value(0, $args); $key = CRM_Utils_Array::value(1, $args); $extraParams = $key ? "&key={$key}" : NULL; $cancelExtra = ts('Cancelling this pledge will also cancel any scheduled (and not completed) pledge payments.') . ' ' . ts('This action cannot be undone.') . ' ' . ts('Do you want to continue?'); self::$_links = array(CRM_Core_Action::VIEW => array('name' => ts('View'), 'url' => 'civicrm/contact/view/pledge', 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=view&context=%%cxt%%&selectedChild=pledge' . $extraParams, 'title' => ts('View Pledge')), CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/contact/view/pledge', 'qs' => 'reset=1&action=update&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams, 'title' => ts('Edit Pledge')), CRM_Core_Action::DETACH => array('name' => ts('Cancel'), 'url' => 'civicrm/contact/view/pledge', 'qs' => 'reset=1&action=detach&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams, 'extra' => 'onclick = "return confirm(\'' . $cancelExtra . '\');"', 'title' => ts('Cancel Pledge')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/contact/view/pledge', 'qs' => 'reset=1&action=delete&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams, 'title' => ts('Delete Pledge'))); if (in_array('Cancel', $hideOption)) { unset(self::$_links[CRM_Core_Action::DETACH]); } return self::$_links; }