From 7b6604fba29afca6f447d4db2975416658a9b34b Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Tue, 3 Jun 2014 10:10:20 +0000 Subject: [PATCH] Replace "thread.php" with a controller --- .../Controller/Chat/ThreadController.php | 46 +++++++++++++++++++ src/mibew/libs/routing.yml | 4 ++ .../templates_src/server_side/chat.handlebars | 2 +- src/mibew/thread.php | 21 --------- 4 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 src/mibew/libs/classes/Mibew/Controller/Chat/ThreadController.php delete mode 100644 src/mibew/thread.php diff --git a/src/mibew/libs/classes/Mibew/Controller/Chat/ThreadController.php b/src/mibew/libs/classes/Mibew/Controller/Chat/ThreadController.php new file mode 100644 index 00000000..b573875a --- /dev/null +++ b/src/mibew/libs/classes/Mibew/Controller/Chat/ThreadController.php @@ -0,0 +1,46 @@ +receiveRequest($request->request->get('data')); + $content = ob_get_clean(); + + return $content; + } +} diff --git a/src/mibew/libs/routing.yml b/src/mibew/libs/routing.yml index cf0f9314..3a4bf767 100644 --- a/src/mibew/libs/routing.yml +++ b/src/mibew/libs/routing.yml @@ -1,4 +1,8 @@ # Chat actions +chat_thread_update: + path: /thread/update + defaults: + _controller: Mibew\Controller\Chat\ThreadController::updateAction ## Operator's chat chat_operator: diff --git a/src/mibew/styles/dialogs/default/templates_src/server_side/chat.handlebars b/src/mibew/styles/dialogs/default/templates_src/server_side/chat.handlebars index 22fbd571..1220d7ad 100644 --- a/src/mibew/styles/dialogs/default/templates_src/server_side/chat.handlebars +++ b/src/mibew/styles/dialogs/default/templates_src/server_side/chat.handlebars @@ -77,7 +77,7 @@ jQuery(document).ready(function(){ Mibew.Application.start({ server: { - url: '{{mibewRoot}}/thread.php', + url: '{{mibewRoot}}/thread/update', requestsFrequency: {{frequency}} }, page: { diff --git a/src/mibew/thread.php b/src/mibew/thread.php deleted file mode 100644 index 4f850284..00000000 --- a/src/mibew/thread.php +++ /dev/null @@ -1,21 +0,0 @@ -receiveRequest($_POST['data']);