*/
public static function workflowEnabled() {
$config = CRM_Core_Config::singleton();
-
- // early exit, since not true for most
- if (!$config->userSystem->is_drupal ||
- !function_exists('module_exists')
- ) {
- return FALSE;
- }
-
- if (!module_exists('rules')) {
- return FALSE;
- }
-
- $enableWorkflow = Civi::settings()->get('civimail_workflow');
-
- return $enableWorkflow && $config->userSystem->is_drupal;
+ return $config->userSystem->mailingWorkflowIsEnabled();
}
/**
return $_SERVER['REMOTE_ADDR'] ?? NULL;
}
+ /**
+ * Check if mailing workflow is enabled
+ *
+ * @return bool
+ */
+ public function mailingWorkflowIsEnabled():bool {
+ return FALSE;
+ }
+
}
return class_exists('Drupal') ? \Drupal::request()->getClientIp() : ($_SERVER['REMOTE_ADDR'] ?? NULL);
}
+ /**
+ * @inheritdoc
+ */
+ public function mailingWorkflowIsEnabled():bool {
+ if (!\Drupal::moduleHandler()->moduleExists('rules')) {
+ return FALSE;
+ }
+
+ $enableWorkflow = Civi::settings()->get('civimail_workflow');
+
+ return (bool) $enableWorkflow;
+ }
+
}
return $emailName;
}
+ /**
+ * @inheritdoc
+ */
+ public function mailingWorkflowIsEnabled():bool {
+ if (!module_exists('rules')) {
+ return FALSE;
+ }
+
+ $enableWorkflow = Civi::settings()->get('civimail_workflow');
+
+ return (bool) $enableWorkflow;
+ }
+
}