Skip to content

Commit

Permalink
raw variables support
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jun 21, 2021
1 parent a266c89 commit 69b047d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<h1><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons','Edit');?> - <?php echo htmlspecialchars($object_trans['name'])?></h1>
<h1 ng-non-bindable><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons','Edit');?> - <?php echo htmlspecialchars($object_trans['name'])?></h1>
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ public static function makeRequest($host, $methodSettings, $paramsCustomer)
} elseif (isset($methodSettings['body_request_type']) && $methodSettings['body_request_type'] == 'raw') {

$rawReplaceArray = array();
foreach ($replaceVariablesJSON as $keyVariable) {
$rawReplaceArray['raw_'.$keyVariable] = trim($replaceVariablesJSON[$keyVariable],"\"");
foreach ($replaceVariablesJSON as $keyVariable => $keyValue) {
$rawReplaceArray['raw_'.$keyVariable] = trim($keyValue,"\"");
}

$bodyPOST = str_replace(array_keys($rawReplaceArray), array_values($rawReplaceArray), $file_api === true ? $methodSettings['body_raw_file'] : $methodSettings['body_raw']);
Expand Down
8 changes: 4 additions & 4 deletions lhc_web/lib/core/lhgenericbot/lhgenericbotworkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public static function userMessageAdded(& $chat, $msg) {
}

if ($event instanceof erLhcoreClassModelGenericBotTriggerEvent) {
$responseTrigger = self::processTrigger($chat, $event->trigger, false, array('args' => array('msg' => $msg)));
$responseTrigger = self::processTrigger($chat, $event->trigger, false, array('args' => array('chat' => $chat, 'msg' => $msg)));
if (!is_array($responseTrigger) || !isset($responseTrigger['ignore_trigger']) || $responseTrigger['ignore_trigger'] === false) {
return;
}
Expand Down Expand Up @@ -314,7 +314,7 @@ public static function sendDefault(& $chat, $botId, $msg = null)
}

if ($trigger instanceof erLhcoreClassModelGenericBotTrigger) {
$message = erLhcoreClassGenericBotWorkflow::processTrigger($chat, $trigger, false, array('args' => array('msg' => $msg)));
$message = erLhcoreClassGenericBotWorkflow::processTrigger($chat, $trigger, false, array('args' => array('chat' => $chat, 'msg' => $msg)));

if (isset($message) && $message instanceof erLhcoreClassModelmsg) {
self::setLastMessageId($chat, $message->id, true);
Expand Down Expand Up @@ -349,7 +349,7 @@ public static function sendAlwaysDefault(& $chat, $botId, $msg = null)

if ($event instanceof erLhcoreClassModelGenericBotTriggerEvent) {

self::processTrigger($chat, $event->trigger, true, array('args' => array('msg' => $msg)));
self::processTrigger($chat, $event->trigger, true, array('args' => array('chat' => $chat, 'msg' => $msg)));

self::$currentAlwaysEvent = $event;

Expand Down Expand Up @@ -1820,7 +1820,7 @@ public static function processTriggerClick($chat, $messageContext, $payload, $pa
$message = self::sendAsUser($chat, $messageClick);
}

$messageTrigger = self::processTrigger($chat, $trigger);
$messageTrigger = self::processTrigger($chat, $trigger, false,array('args' => array('msg' => $messageClick, 'chat' => $chat)));

if ($messageTrigger instanceof erLhcoreClassModelmsg)
{
Expand Down

0 comments on commit 69b047d

Please sign in to comment.