Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
43 additions
and
74 deletions.
There are no files selected for viewing
43 changes: 20 additions & 23 deletions
43
lhc_web/design/defaulttheme/tpl/lhchat/lists/msg_obj_list.tpl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,29 @@ | ||
<?php | ||
|
||
<?php | ||
$lastOperatorChanged = false; | ||
$lastOperatorId = false; | ||
$lastOperatorNick = ''; | ||
|
||
foreach ($messages as $msg ) : if ($msg->user_id > -1 || $msg->user_id == -2) : | ||
$messagesStats = array( | ||
'total_messages' => count($messages), | ||
'counter_messages' => 0, | ||
); | ||
|
||
if ($lastOperatorId !== false && $lastOperatorId != $msg->user_id) { | ||
$lastOperatorChanged = true; | ||
} else { | ||
$lastOperatorChanged = false; | ||
} | ||
foreach ($messages as $msg) : | ||
$msg = $msg->getState(); | ||
$messagesStats['counter_messages']++; | ||
|
||
$lastOperatorId = $msg->user_id; | ||
if ($lastOperatorId !== false && ($lastOperatorId != $msg['user_id'] || $msg['name_support'] != $lastOperatorNick)) { | ||
$lastOperatorChanged = true; | ||
$lastOperatorNick = $msg['name_support']; | ||
} else { | ||
$lastOperatorChanged = false; | ||
} | ||
|
||
if ($msg->meta_msg != '') { | ||
$metaMessageData = json_decode($msg->meta_msg, true); $messageId = $msg->id; | ||
} else if (isset($metaMessageData)) { | ||
unset($metaMessageData); | ||
} | ||
$lastOperatorId = $msg['user_id']; | ||
$lastOperatorNick = $msg['name_support']; | ||
|
||
?> | ||
<div class="message-row<?php echo $msg->user_id == 0 ? ' response' : ' message-admin'.($lastOperatorChanged == true ? ' operator-changes' : '')?>" id="msg-<?php echo $msg->id?>"><div class="msg-date"><?php echo date(erLhcoreClassModule::$dateDateHourFormat,$msg->time);?></div><span class="usr-tit<?php echo $msg->user_id == 0 ? ' vis-tit' : ' op-tit'?>"><?php echo $msg->user_id == 0 ? htmlspecialchars($chat->nick) : htmlspecialchars($msg->name_support) ?>: </span> | ||
|
||
<?php $msgBody = $msg->msg; $paramsMessageRender = array('sender' => $msg->user_id);?> | ||
<?php include(erLhcoreClassDesign::designtpl('lhchat/lists/msg_body.tpl.php'));?> | ||
?> | ||
<?php include(erLhcoreClassDesign::designtpl('lhchat/lists/user_msg_row.tpl.php'));?> | ||
<?php endforeach; ?> | ||
|
||
<?php if (isset($metaMessageData)) : ?> | ||
<?php include(erLhcoreClassDesign::designtpl('lhgenericbot/message/meta_render.tpl.php'));?> | ||
<?php endif; ?> | ||
</div> | ||
<?php endif; endforeach; ?> |
49 changes: 6 additions & 43 deletions
49
lhc_web/design/defaulttheme/tpl/lhchat/lists/msg_obj_list_admin.tpl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,8 @@ | ||
<?php | ||
|
||
$lastOperatorChanged = false; | ||
$lastOperatorId = false; | ||
$lastOperatorNick = ''; | ||
|
||
foreach ($messages as $msg) : | ||
|
||
if ($lastOperatorId !== false && ($lastOperatorId != $msg->user_id || $lastOperatorNick != $msg->name_support)) { | ||
$lastOperatorChanged = true; | ||
$lastOperatorNick = $msg->name_support; | ||
} else { | ||
$lastOperatorChanged = false; | ||
<?php | ||
$messagesDefault = []; | ||
foreach ($messages as $msg) { | ||
$messagesDefault[] = $msg->getState(); | ||
} | ||
|
||
$lastOperatorId = $msg->user_id; | ||
|
||
if ($msg->meta_msg != '') { | ||
$metaMessageData = json_decode($msg->meta_msg, true); $messageId = $msg->id; | ||
} else if (isset($metaMessageData)) { | ||
unset($metaMessageData); | ||
} | ||
|
||
$messages = $messagesDefault; | ||
?> | ||
<?php if ($msg->user_id == -1) : ?> | ||
<div class="message-row system-response" id="msg-<?php echo $msg->id?>"><div class="msg-date"><?php echo date(erLhcoreClassModule::$dateDateHourFormat,$msg->time);?></div><i><span class="usr-tit sys-tit"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmin','System assistant')?></span><?php echo erLhcoreClassBBCode::make_clickable(htmlspecialchars($msg->msg))?></i></div> | ||
<?php else : ?> | ||
<?php if ($msg->msg != '' || | ||
isset($metaMessageData['content']['text_conditional']) || | ||
isset($metaMessageData['content']['chat_operation']) || | ||
isset($metaMessageData['content']['html']['content']) || | ||
isset($metaMessageData['content']['button_message']) | ||
) : ?> | ||
<div class="message-row<?php echo $msg->user_id == 0 ? ' response' : ' message-admin'.($lastOperatorChanged == true ? ' operator-changes' : '')?>" id="msg-<?php echo $msg->id?>"><div class="msg-date"><?php echo date(erLhcoreClassModule::$dateDateHourFormat,$msg->time);?></div><span class="usr-tit<?php echo $msg->user_id == 0 ? ' vis-tit' : ' op-tit'?>"><?php if ($msg->user_id == 0) : ?><i class="material-icons"><?php echo ($chat->device_type == 0 ? 'computer' : ($chat->device_type == 1 ? 'smartphone' : 'tablet'))?></i><?php endif;?><?php echo $msg->user_id == 0 ? htmlspecialchars($chat->nick) : htmlspecialchars($msg->name_support) ?></span> | ||
<?php $msgBody = $msg->msg; $paramsMessageRender = array('sender' => $msg->user_id, 'html_as_text' => true);?> | ||
<?php include(erLhcoreClassDesign::designtpl('lhchat/lists/msg_body.tpl.php'));?> | ||
|
||
<?php if (isset($metaMessageData)) : ?> | ||
<?php include(erLhcoreClassDesign::designtpl('lhgenericbot/message/meta_render_admin.tpl.php'));?> | ||
<?php endif; ?> | ||
|
||
</div> | ||
<?php endif;?> | ||
<?php endif;?> | ||
<?php endforeach;?> | ||
<?php include(erLhcoreClassDesign::designtpl('lhchat/syncadmin.tpl.php'));?> |
14 changes: 13 additions & 1 deletion
14
lhc_web/design/defaulttheme/tpl/lhchat/messagelist/plain.tpl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
<?php foreach ($messages as $msg ) : ?><?php if (!isset($remove_meta) || $remove_meta == false ) :?>[<?php echo date(erLhcoreClassModule::$dateDateHourFormat,$msg->time);?>] [<?php echo $msg->user_id == 0 ? htmlspecialchars($chat->nick) : htmlspecialchars($msg->name_support) ?>] <?php endif;?><?php echo erLhcoreClassBBCodePlain::make_clickable($msg->msg, array('sender' => $msg->user_id)),"\n"?><?php endforeach; ?> | ||
<?php foreach ($messages as $msg ) : | ||
|
||
if (isset($msg->meta_msg) && $msg->meta_msg != '') { | ||
$metaMessageData = json_decode($msg->meta_msg, true); $messageId = isset($triggerMessageId) ? $triggerMessageId : $msg->id; | ||
} else if (isset($metaMessageData)) { | ||
unset($metaMessageData); | ||
} | ||
|
||
if (isset($metaMessageData['content']['whisper']) || empty($msg->msg)) { | ||
continue; | ||
} | ||
|
||
?><?php if (!isset($remove_meta) || $remove_meta == false ) :?>[<?php echo date(erLhcoreClassModule::$dateDateHourFormat,$msg->time);?>] [<?php echo $msg->user_id == 0 ? htmlspecialchars($chat->nick) : htmlspecialchars($msg->name_support) ?>] <?php endif;?><?php echo erLhcoreClassBBCodePlain::make_clickable($msg->msg, array('sender' => $msg->user_id)),"\n"?><?php endforeach; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
lhc_web/design/defaulttheme/tpl/lhtheme/adminthemeedit.tpl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters