Skip to content
Snippets Groups Projects
Commit 448c6d78 authored by mattwire's avatar mattwire
Browse files

Add 'Install now' to minifier/contributiontransactlegacy extensions now they...

Add 'Install now' to minifier/contributiontransactlegacy extensions now they are available for automated distribution
parent e6c422f6
No related branches found
No related tags found
No related merge requests found
......@@ -51,8 +51,9 @@ class CRM_Mjwshared_Check {
* @throws \CiviCRM_API3_Exception
*/
private static function checkExtensionMinifier(&$messages) {
$extensionName = 'minifier';
$extensions = civicrm_api3('Extension', 'get', [
'full_name' => 'minifier',
'full_name' => $extensionName,
]);
if (empty($extensions['id']) || ($extensions['values'][$extensions['id']]['status'] !== 'installed')) {
......@@ -64,6 +65,12 @@ class CRM_Mjwshared_Check {
\Psr\Log\LogLevel::NOTICE,
'fa-lightbulb-o'
);
$message->addAction(
E::ts('Install now'),
NULL,
'href',
['path' => 'civicrm/admin/extensions', 'query' => ['action' => 'update', 'id' => $extensionName, 'key' => $extensionName]]
);
$messages[] = $message;
}
}
......@@ -74,14 +81,15 @@ class CRM_Mjwshared_Check {
* @throws \CiviCRM_API3_Exception
*/
private static function checkExtensionContributiontransactlegacy(&$messages) {
$extensionName = 'contributiontransactlegacy';
// Only on Drupal - do we have webform_civicrm installed?
if (function_exists('module_exists')) {
$extensions = civicrm_api3('Extension', 'get', [
'full_name' => 'contributiontransactlegacy',
'full_name' => $extensionName,
]);
if (module_exists('webform_civicrm') && (empty($extensions['id']) || ($extensions['values'][$extensions['id']]['status'] !== 'installed'))) {
$messages[] = new CRM_Utils_Check_Message(
$message = new CRM_Utils_Check_Message(
__FUNCTION__ . 'mjwshared_recommended',
E::ts('If you are using Drupal webform_civicrm to accept payments you should download and install the
<strong><a href="https://civicrm.org/extensions/contribution-transact-api">contributiontransactlegacy</a></strong> extension.
......@@ -90,6 +98,13 @@ class CRM_Mjwshared_Check {
\Psr\Log\LogLevel::WARNING,
'fa-lightbulb-o'
);
$message->addAction(
E::ts('Install now'),
NULL,
'href',
['path' => 'civicrm/admin/extensions', 'query' => ['action' => 'update', 'id' => $extensionName, 'key' => $extensionName]]
);
$messages[] = $message;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment