diff --git a/src/messenger/webim/client.php b/src/messenger/webim/client.php
index e669e139..65eafbb5 100644
--- a/src/messenger/webim/client.php
+++ b/src/messenger/webim/client.php
@@ -63,17 +63,16 @@ if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) {
}
setup_chatview_for_user($thread, $level);
-start_html_output();
$pparam = verifyparam( "act", "/^(mailthread)$/", "default");
if( $pparam == "mailthread" ) {
- require('view/chat_mailthread.php');
+ expand("design/default/mail.tpl");
} else if( $level == "ajaxed" ) {
expand("design/default/chat.tpl");
} else if( $level == "simple" ) {
- require('view/chat_simple.php');
+ expand("design/default/chatsimple.tpl");
} else if( $level == "old" ) {
- require('view/chat_oldbrowser.php');
+ expand("design/default/nochat.tpl");
}
?>
\ No newline at end of file
diff --git a/src/messenger/webim/design/default/chat.tpl b/src/messenger/webim/design/default/chat.tpl
index 7eb7ee3b..7265f3f2 100644
--- a/src/messenger/webim/design/default/chat.tpl
+++ b/src/messenger/webim/design/default/chat.tpl
@@ -93,7 +93,7 @@ ${if:agent}
${if:historyParams}
${msg:chat.window.chatting_with}
- ${print:ct.user.name}
+ ${print:ct.user.name}
${else:historyParams}
${msg:chat.window.chatting_with} ${print:ct.user.name}
${endif:historyParams}
@@ -141,7 +141,7 @@ ${if:canpost}
|
${endif:canpost}
${if:historyParams}
- |
+ |
${endif:historyParams}
${endif:agent}
diff --git a/src/messenger/webim/libs/expand.php b/src/messenger/webim/libs/expand.php
index 3b14796a..0c2f5280 100644
--- a/src/messenger/webim/libs/expand.php
+++ b/src/messenger/webim/libs/expand.php
@@ -60,9 +60,11 @@ function expand_var($matches) {
}
return getlocal($var);
} else if($prefix == 'form:') {
- return $page["form$var"];
+ return form_value($var);
} else if($prefix == 'page:') {
return $page[$var];
+ } else if($prefix == 'print:') {
+ return htmlspecialchars($page[$var]);
} else if($prefix == 'if:' || $prefix == 'else:' || $prefix == 'endif:' || $prefix == 'ifnot:') {
return "";
}
diff --git a/src/messenger/webim/mail.php b/src/messenger/webim/mail.php
index bbb4d46d..803a807e 100644
--- a/src/messenger/webim/mail.php
+++ b/src/messenger/webim/mail.php
@@ -14,6 +14,7 @@
require_once('libs/common.php');
require_once('libs/chat.php');
+require_once('libs/expand.php');
$errors = array();
$page = array();
@@ -40,8 +41,7 @@ if( count($errors) > 0 ) {
$page['ct.chatThreadId'] = $thread['threadid'];
$page['ct.token'] = $thread['ltoken'];
$page['level'] = "";
- start_html_output();
- require('view/chat_mailthread.php');
+ expand("design/default/mail.tpl");
exit;
}
@@ -57,7 +57,5 @@ $body = getstring2("mail.user.history.body", array($thread['userName'],$history)
webim_mail($email, $webim_from_email, $subject, $body);
-start_html_output();
-require('view/chat_mailsent.php');
-
+expand("design/default/mailsent.tpl");
?>
\ No newline at end of file
diff --git a/src/messenger/webim/view/chat_error.php b/src/messenger/webim/view/chat_error.php
deleted file mode 100644
index 7ebe22ba..00000000
--- a/src/messenger/webim/view/chat_error.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- |
- |
-
-
-
- |
-
-
-
- |
- |
- |
- |
-
-
- 0 ) {
- print getlocal("errors.header");
- foreach( $errors as $e ) {
- print getlocal("errors.prefix");
- print $e;
- print getlocal("errors.suffix");
- }
- print getlocal("errors.footer");
- } ?>
-
-
- | |
- |
- |
- |
-
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
-
diff --git a/src/messenger/webim/view/chat_mailsent.php b/src/messenger/webim/view/chat_mailsent.php
deleted file mode 100644
index 4849100a..00000000
--- a/src/messenger/webim/view/chat_mailsent.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
-
diff --git a/src/messenger/webim/view/chat_mailthread.php b/src/messenger/webim/view/chat_mailthread.php
deleted file mode 100644
index e97ae210..00000000
--- a/src/messenger/webim/view/chat_mailthread.php
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/messenger/webim/view/chat_oldbrowser.php b/src/messenger/webim/view/chat_oldbrowser.php
deleted file mode 100644
index 58f9b863..00000000
--- a/src/messenger/webim/view/chat_oldbrowser.php
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
- |
- |
-
-
-
- |
-
-
-
- |
- |
- |
- |
-
-
-
-
- | |
- |
- |
- |
-
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
-
- |
-
-
-
-
-
diff --git a/src/messenger/webim/view/chat_simple.php b/src/messenger/webim/view/chat_simple.php
deleted file mode 100644
index c4d25b76..00000000
--- a/src/messenger/webim/view/chat_simple.php
+++ /dev/null
@@ -1,238 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
-
-
-
- |
- |
-
-
- |
- |
- "> |
- |
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
-
- |
-
-
-
-
- |
-
-
-
- |
-
-
- |
-
-
- |
- |
-
-
- |
-
-
- |
-
-
-
- |
-
-
-
- |
-
-
-
- |
-
-
- |
-
-
- |
- |
-
-
- |
-
-
- |
-
-
-
- |
- |
-
-
-
- |
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
-
-
|