Merge pull request #22848 from braders/extension-manager-notices
[civicrm-core.git] / CRM / Admin / Page / MailSettings.php
index 6ede83649efaeff2a72b1afbf1314281e3902a70..28844d60782df6af6553fe40d79f9edcaa2eda8f 100644 (file)
@@ -105,8 +105,17 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic {
         $mailSetting->id
       );
     }
-
+    $expectedKeys = ['server', 'username', 'localpart', 'domain', 'return_path', 'protocol', 'source', 'port', 'is_ssl'];
+    foreach ($allMailSettings as $key => $allMailSetting) {
+      // make sure they are there to prevent smarty notices.
+      $allMailSettings[$key] = array_merge(array_fill_keys($expectedKeys, NULL), $allMailSetting);
+    }
     $this->assign('rows', $allMailSettings);
+
+    $setupActions = CRM_Core_BAO_MailSettings::getSetupActions();
+    if (count($setupActions) > 1 || !isset($setupActions['standard'])) {
+      $this->assign('setupActions', $setupActions);
+    }
   }
 
   /**