[ 'name' => ts('Edit'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Location Type'), ], CRM_Core_Action::DISABLE => [ 'name' => ts('Disable'), 'ref' => 'crm-enable-disable', 'title' => ts('Disable Location Type'), ], CRM_Core_Action::ENABLE => [ 'name' => ts('Enable'), 'ref' => 'crm-enable-disable', 'title' => ts('Enable Location Type'), ], CRM_Core_Action::DELETE => [ 'name' => ts('Delete'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Location Type'), ], ]; } return self::$_links; } /** * Get name of edit form. * * @return string * Classname of edit form. */ public function editForm() { return 'CRM_Admin_Form_LocationType'; } /** * Get edit form name. * * @return string * name of this page. */ public function editName() { return 'Location Types'; } /** * Get user context. * * @param null $mode * * @return string * user context. */ public function userContext($mode = NULL) { return 'civicrm/admin/locationType'; } /** * @param $sort * @param $action * @param array $links * * @return array */ protected function getRows($sort, $action, array $links): array { $rows = parent::getRows($sort, $action, $links); foreach ($rows as &$row) { // prevent smarty notices. foreach (['is_default', 'class', 'vcard_name'] as $expectedField) { if (!isset($row['is_default'])) { $row[$expectedField] = NULL; } } } return $rows; } }