function FM_CallFunction($s_func, $a_params, &$m_return, &$s_mesg, &$a_debug, &$a_alerts)
 {
     switch ($s_func) {
         case "FMFatalError":
             SendComputeAlerts();
             if (count($a_params) < 3) {
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 Error("fmcompute_error", $a_params[0], $a_params[1], $a_params[2]);
             }
             break;
         case "FMFatalUserError":
             SendComputeAlerts();
             if (count($a_params) < 1) {
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 UserError("fmcompute_usererror", $a_params[0]);
             }
             break;
         case "FMUserError":
             if (count($a_params) < 1) {
                 SendComputeAlerts();
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 global $FM_UserErrors;
                 $FM_UserErrors[] = $a_params[0];
             }
             break;
         case "FMSaveAllFilesToRepository":
             if (count($a_params) != 0) {
                 SendComputeAlerts();
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 $m_return = SaveAllFilesToRepository();
             }
             break;
         case "FMDeleteFileFromRepository":
             if (count($a_params) != 1) {
                 SendComputeAlerts();
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 $m_return = DeleteFileFromRepository($a_params[0]);
             }
             break;
         case "FMNextNum":
             if (count($a_params) != 2) {
                 SendComputeAlerts();
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 $i_pad = $a_params[0];
                 $i_base = $a_params[1];
                 if ($i_base < 2 || $i_base > 36) {
                     Error("fmcompute_call", GetMessage(MSG_CALL_INVALID_PARAM, array("FUNC" => $s_func, "PARAM" => 2, "CORRECT" => 2.0 . 0.36)), false, false);
                 }
                 $m_return = GetNextNum($i_pad, $i_base);
             }
             break;
         default:
             $s_mesg = GetMessage(MSG_CALL_UNK_FUNC, array("FUNC" => $s_func));
             return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 function FM_CallFunction($s_func, $a_params, &$m_return, &$s_mesg, &$a_debug, &$a_alerts)
 {
     switch ($s_func) {
         case "FMFatalError":
             SendComputeAlerts();
             if (count($a_params) < 3) {
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 Error("fmcompute_error", $a_params[0], $a_params[1], $a_params[2]);
             }
             break;
         case "FMFatalUserError":
             SendComputeAlerts();
             if (count($a_params) < 1) {
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 UserError("fmcompute_usererror", $a_params[0]);
             }
             break;
         case "FMUserError":
             if (count($a_params) < 1) {
                 SendComputeAlerts();
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 global $FM_UserErrors;
                 $FM_UserErrors[] = $a_params[0];
             }
             break;
         case "FMSaveAllFilesToRepository":
             if (count($a_params) != 0) {
                 SendComputeAlerts();
                 Error("fmcompute_call", GetMessage(MSG_CALL_PARAM_COUNT, array("FUNC" => $s_func, "COUNT" => count($a_params))), false, false);
             } else {
                 $m_return = SaveAllFilesToRepository();
             }
             break;
         default:
             $s_mesg = GetMessage(MSG_CALL_UNK_FUNC, array("FUNC" => $s_func));
             return false;
     }
     return true;
 }