afform_html - Add status-check for Monaco files
authorTim Otten <totten@civicrm.org>
Sat, 4 May 2019 04:51:51 +0000 (21:51 -0700)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:18 +0000 (19:13 -0700)
ext/afform/html/afform_html.php

index 815a2b0beebc0d8202e5e27805686572ede1d54f..fc81ca2ab4171e7c609902b26ade84284346b38b 100644 (file)
@@ -161,3 +161,19 @@ function afform_html_civicrm_navigationMenu(&$menu) {
   ));
   _afform_html_civix_navigationMenu($menu);
 } // */
+
+/**
+ * Implements hook_civicrm_check().
+ */
+function afform_html_civicrm_check(&$messages) {
+  $dir = E::path(CRM_AfformHtml_Page_HtmlEditor::MONACO_DIR);
+  if (!file_exists($dir)) {
+    $messages[] = new CRM_Utils_Check_Message(
+      'afform_html_monaco',
+      ts('Afform HTML is missing its "node_modules" folder. Please consult the README.md for current installation instructions.'),
+      ts('Afform HTML: Packages are missing'),
+      \Psr\Log\LogLevel::CRITICAL,
+      'fa-chain-broken'
+    );
+  }
+}