| Server IP : 52.25.153.185 / Your IP : 216.73.217.131 Web Server : Apache System : Linux ip-172-26-6-158 5.10.0-35-cloud-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64 User : daemon ( 1) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/fluentformpro/src/classes/ |
Upload File : |
<?php
namespace FluentFormPro\classes;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Calculation
{
public function enqueueScripts()
{
wp_enqueue_script('fluentform-advanced');
wp_enqueue_script('fluent-math-expression', FLUENTFORMPRO_DIR_URL.'public/libs/math-expression.min.js', array(), '1.2.17');
}
public function localizeCalculationMessages($form)
{
// Add calculation field messages for translation
$calculationMessages = [
'calculation_error' => __('Calculation error occurred', 'fluentformpro'),
'invalid_formula' => __('Invalid formula provided', 'fluentformpro'),
'division_by_zero' => __('Division by zero error', 'fluentformpro')
];
$calculationMessages = apply_filters('fluentform/calculation_field_messages', $calculationMessages, $form);
// Use form-specific variable name to match JavaScript expectations
wp_localize_script('fluentform-advanced', 'fluentform_calculation_messages_' . $form->id, $calculationMessages);
}
}