From: Tim Otten Date: Wed, 1 Dec 2021 00:53:40 +0000 (-0800) Subject: mixin/ang-php - Convert live Angular modules from `hook_angularModules` to `` X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b5bd1143f4e71e5b7ade48e8ea7ee59c80517afc;p=civicrm-core.git mixin/ang-php - Convert live Angular modules from `hook_angularModules` to `` --- diff --git a/ext/message_admin/info.xml b/ext/message_admin/info.xml index aed58fc759..deb1c78283 100644 --- a/ext/message_admin/info.xml +++ b/ext/message_admin/info.xml @@ -30,6 +30,9 @@ + + ang-php@1.0.0 + CRM/MessageAdmin diff --git a/ext/message_admin/message_admin.civix.php b/ext/message_admin/message_admin.civix.php index d665c618f0..ee0c64c7e1 100644 --- a/ext/message_admin/message_admin.civix.php +++ b/ext/message_admin/message_admin.civix.php @@ -285,31 +285,6 @@ function _message_admin_civix_civicrm_caseTypes(&$caseTypes) { } } -/** - * (Delegated) Implements hook_civicrm_angularModules(). - * - * Find any and return any files matching "ang/*.ang.php" - * - * Note: This hook only runs in CiviCRM 4.5+. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules - */ -function _message_admin_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { - return; - } - - $files = _message_admin_civix_glob(__DIR__ . '/ang/*.ang.php'); - foreach ($files as $file) { - $name = preg_replace(':\.ang\.php$:', '', basename($file)); - $module = include $file; - if (empty($module['ext'])) { - $module['ext'] = E::LONG_NAME; - } - $angularModules[$name] = $module; - } -} - /** * (Delegated) Implements hook_civicrm_themes(). * diff --git a/ext/message_admin/message_admin.php b/ext/message_admin/message_admin.php index 4efd0b74fb..acca57502d 100644 --- a/ext/message_admin/message_admin.php +++ b/ext/message_admin/message_admin.php @@ -102,20 +102,6 @@ function message_admin_civicrm_caseTypes(&$caseTypes) { _message_admin_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 https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules - */ -function message_admin_civicrm_angularModules(&$angularModules) { - _message_admin_civix_civicrm_angularModules($angularModules); -} - /** * Implements hook_civicrm_entityTypes(). * diff --git a/ext/oauth-client/info.xml b/ext/oauth-client/info.xml index 9458ed9f12..433c2fa4ab 100644 --- a/ext/oauth-client/info.xml +++ b/ext/oauth-client/info.xml @@ -30,6 +30,7 @@ CRM_OAuth_Upgrader + ang-php@1.0.0 setting-php@1.0.0 diff --git a/ext/oauth-client/oauth_client.civix.php b/ext/oauth-client/oauth_client.civix.php index 305b176ec7..e48163534b 100644 --- a/ext/oauth-client/oauth_client.civix.php +++ b/ext/oauth-client/oauth_client.civix.php @@ -285,31 +285,6 @@ function _oauth_client_civix_civicrm_caseTypes(&$caseTypes) { } } -/** - * (Delegated) Implements hook_civicrm_angularModules(). - * - * Find any and return any files matching "ang/*.ang.php" - * - * Note: This hook only runs in CiviCRM 4.5+. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules - */ -function _oauth_client_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { - return; - } - - $files = _oauth_client_civix_glob(__DIR__ . '/ang/*.ang.php'); - foreach ($files as $file) { - $name = preg_replace(':\.ang\.php$:', '', basename($file)); - $module = include $file; - if (empty($module['ext'])) { - $module['ext'] = E::LONG_NAME; - } - $angularModules[$name] = $module; - } -} - /** * (Delegated) Implements hook_civicrm_themes(). * diff --git a/ext/oauth-client/oauth_client.php b/ext/oauth-client/oauth_client.php index ef2ac35426..cdfb1a9cff 100644 --- a/ext/oauth-client/oauth_client.php +++ b/ext/oauth-client/oauth_client.php @@ -78,20 +78,6 @@ function oauth_client_civicrm_caseTypes(&$caseTypes) { _oauth_client_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 https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules - */ -function oauth_client_civicrm_angularModules(&$angularModules) { - _oauth_client_civix_civicrm_angularModules($angularModules); -} - /** * Implements hook_civicrm_entityTypes(). * diff --git a/ext/search_kit/info.xml b/ext/search_kit/info.xml index b08d284384..d31e49d478 100644 --- a/ext/search_kit/info.xml +++ b/ext/search_kit/info.xml @@ -26,6 +26,9 @@ CRM_Search_Upgrader + + ang-php@1.0.0 + CRM/Search diff --git a/ext/search_kit/search_kit.civix.php b/ext/search_kit/search_kit.civix.php index fa2b1660c3..66ce942fd2 100644 --- a/ext/search_kit/search_kit.civix.php +++ b/ext/search_kit/search_kit.civix.php @@ -285,31 +285,6 @@ function _search_kit_civix_civicrm_caseTypes(&$caseTypes) { } } -/** - * (Delegated) Implements hook_civicrm_angularModules(). - * - * Find any and return any files matching "ang/*.ang.php" - * - * Note: This hook only runs in CiviCRM 4.5+. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules - */ -function _search_kit_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { - return; - } - - $files = _search_kit_civix_glob(__DIR__ . '/ang/*.ang.php'); - foreach ($files as $file) { - $name = preg_replace(':\.ang\.php$:', '', basename($file)); - $module = include $file; - if (empty($module['ext'])) { - $module['ext'] = E::LONG_NAME; - } - $angularModules[$name] = $module; - } -} - /** * (Delegated) Implements hook_civicrm_themes(). * diff --git a/ext/search_kit/search_kit.php b/ext/search_kit/search_kit.php index 50fb6085ae..431e6103d2 100644 --- a/ext/search_kit/search_kit.php +++ b/ext/search_kit/search_kit.php @@ -70,7 +70,6 @@ function search_kit_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function search_kit_civicrm_angularModules(&$angularModules) { - _search_kit_civix_civicrm_angularModules($angularModules); // Fetch all search tasks provided by extensions and add their Angular modules as crmSearchTasks dependencies $tasks = []; $null = NULL;