E::ts('New subliminal message'), // 'name' => 'mailing_subliminal_message', // 'url' => 'civicrm/mailing/subliminal', // 'permission' => 'access CiviMail', // 'operator' => 'OR', // 'separator' => 0, // )); // _oauth_client_civix_navigationMenu($menu); //} /** * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container */ function oauth_client_civicrm_container($container) { $container->addResource(new \Symfony\Component\Config\Resource\FileResource(__FILE__)); $container->setDefinition('oauth2.league', new \Symfony\Component\DependencyInjection\Definition( \Civi\OAuth\OAuthLeagueFacade::class, []))->setPublic(TRUE); $container->setDefinition('oauth2.token', new \Symfony\Component\DependencyInjection\Definition( \Civi\OAuth\OAuthTokenFacade::class, []))->setPublic(TRUE); } /** * Implements hook_civicrm_oauthProviders(). */ function oauth_client_civicrm_oauthProviders(&$providers) { $ingest = function($pat) use (&$providers) { $files = (array) glob($pat); foreach ($files as $file) { if (!defined('CIVICRM_TEST') && preg_match(';\.test\.json$;', $file)) { continue; } $name = preg_replace(';\.(dist\.|test\.|)json$;', '', basename($file)); $provider = json_decode(file_get_contents($file), 1); $provider['name'] = $name; $providers[$name] = $provider; } }; $ingest(__DIR__ . '/providers/*.json'); $localDir = Civi::paths()->getPath('[civicrm.private]/oauth-providers'); if (file_exists($localDir)) { $ingest($localDir . '/*.json'); } } /** * Implements hook_civicrm_mailSetupActions(). * * @see CRM_Utils_Hook::mailSetupActions() */ function oauth_client_civicrm_mailSetupActions(&$setupActions) { $setupActions = array_merge($setupActions, CRM_OAuth_MailSetup::buildSetupLinks()); } /** * Implements hook_civicrm_oauthReturn(). */ function oauth_client_civicrm_oauthReturn($token, &$nextUrl) { CRM_OAuth_MailSetup::onReturn($token, $nextUrl); } /** * Implements hook_civicrm_alterMailStore(). * * @see CRM_Utils_Hook::alterMailStore() */ function oauth_client_civicrm_alterMailStore(&$mailSettings) { CRM_OAuth_MailSetup::alterMailStore($mailSettings); }