'com.megaphonetech.entitytemplates', 'name' => 'entity_template_for', 'entity' => 'OptionGroup', 'params' => [ 'name' => 'entity_template_for', 'title' => ts('Entity Template for'), 'data_type' => 'String', 'is_reserved' => 1, 'is_active' => 1, 'is_locked' => 0, 'version' => 3, ], ]; foreach ([ 'Individual' => ['CRM_Contact_Form_Contact', 'civicrm/contact/add?reset=1&ct=Individual'], 'Organization' => ['CRM_Contact_Form_Contact', 'civicrm/contact/add?reset=1&ct=Organization'], 'Contribution' => ['CRM_Contribute_Form_Contribution', 'civicrm/contribute/add?reset=1&action=add&context=standalone'], ] as $entityType => $formClassName) { $entities[] = [ 'module' => 'com.megaphonetech.entitytemplates', 'name' => $entityType, 'entity' => 'OptionValue', 'params' => [ 'version' => 3, 'option_group_id' => 'entity_template_for', 'label' => ts("{$entityType}"), 'value' => $entityType, 'name' => $formClassName[1], 'description' => $formClassName[0], 'is_default' => '0', 'weight' => '1', 'is_optgroup' => '0', 'is_reserved' => '0', 'is_active' => '1' ], ]; } } /** * Implements hook_civicrm_caseTypes(). * * Generate a list of case-types. * * Note: This hook only runs in CiviCRM 4.4+. * * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_caseTypes */ function entitytemplates_civicrm_caseTypes(&$caseTypes) { _entitytemplates_civix_civicrm_caseTypes($caseTypes); } /** * Implements hook_civicrm_angularModules(). * * Generate a list of Angular modules. * * Note: This hook only runs in CiviCRM 4.5+. It may * use features only available in v4.6+. * * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules */ function entitytemplates_civicrm_angularModules(&$angularModules) { _entitytemplates_civix_civicrm_angularModules($angularModules); } /** * Implements hook_civicrm_alterSettingsFolders(). * * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders */ function entitytemplates_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { _entitytemplates_civix_civicrm_alterSettingsFolders($metaDataFolders); } /** * Implements hook_civicrm_entityTypes(). * * Declare entity types provided by this module. * * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityTypes */ function entitytemplates_civicrm_entityTypes(&$entityTypes) { _entitytemplates_civix_civicrm_entityTypes($entityTypes); $entityTypes[] = [ 'name' => 'EntityTemplates', 'class' => 'CRM_Core_DAO_EntityTemplates', 'table' => 'civicrm_entity_templates', ]; } /** * Implements hook_civicrm_navigationMenu(). * * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu * */ function entitytemplates_civicrm_navigationMenu(&$menu) { _entitytemplates_civix_insert_navigation_menu($menu, 'Administer/Customize Data and Screens', [ 'label' => ts('Entity Templates', ['domain' => 'com.megaphonetech.entitytemplates']), 'name' => 'entity_templates', 'url' => CRM_Utils_System::url('civicrm/entity/templates', 'reset=1&action=browse', TRUE), 'active' => 1, 'permission_operator' => 'AND', 'permission' => 'administer CiviCRM', ]); _entitytemplates_civix_navigationMenu($menu); }