'CiviGrant', 'translatedName' => ts('CiviGrant'), 'title' => 'CiviCRM Grant Management Engine', 'path' => 'CRM_Grant_', 'search' => 1, 'showActivitiesInCore' => 1, ]; } /** * @inheritDoc * @param bool $getAllUnconditionally * @param bool $descriptions * Whether to return permission descriptions * * @return array */ public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) { $permissions = [ 'access CiviGrant' => [ ts('access CiviGrant'), ts('View all grants'), ], 'edit grants' => [ ts('edit grants'), ts('Create and update grants'), ], 'delete in CiviGrant' => [ ts('delete in CiviGrant'), ts('Delete grants'), ], ]; if (!$descriptions) { foreach ($permissions as $name => $attr) { $permissions[$name] = array_shift($attr); } } return $permissions; } /** * @inheritDoc * @return null */ public function getUserDashboardElement() { // no dashboard element for this component return NULL; } /** * @inheritDoc * @return null */ public function getUserDashboardObject() { // no dashboard element for this component return NULL; } /** * @inheritDoc * @return array */ public function registerTab() { return [ 'title' => ts('Grants'), 'url' => 'grant', 'weight' => 60, ]; } /** * @inheritDoc * @return string */ public function getIcon() { return 'crm-i fa-money'; } /** * @inheritDoc * @return array */ public function registerAdvancedSearchPane() { return [ 'title' => ts('Grants'), 'weight' => 50, ]; } /** * @inheritDoc * @return null */ public function getActivityTypes() { return NULL; } /** * add shortcut to Create New. * @param $shortCuts */ public function creatNewShortcut(&$shortCuts) { if (CRM_Core_Permission::check('access CiviGrant') && CRM_Core_Permission::check('edit grants') ) { $shortCuts = array_merge($shortCuts, [ [ 'path' => 'civicrm/grant/add', 'query' => "reset=1&action=add&context=standalone", 'ref' => 'new-grant', 'title' => ts('Grant'), ], ]); } } }