Skip to content
Snippets Groups Projects
Commit d201f92d authored by Arthur Mueller's avatar Arthur Mueller
Browse files

Move chat to a submodule

parent beeb88ef
No related branches found
No related tags found
No related merge requests found
File moved
<?php
namespace Drupal\websocket;
namespace Drupal\websocket_chat;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
......
<?php
namespace Drupal\websocket\Form;
namespace Drupal\websocket_chat\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
......
<?php
namespace Drupal\websocket\Plugin\Block;
namespace Drupal\websocket_chat\Plugin\Block;
use Drupal\Core\Block\BlockBase;
......@@ -21,10 +21,10 @@ class ChatBlock extends BlockBase {
return [
'#title' => 'Chat block',
'#theme' => 'chat_block',
'#form' => \Drupal::formBuilder()->getForm('\Drupal\websocket\Form\ChatForm'),
'#form' => \Drupal::formBuilder()->getForm('\Drupal\websocket_chat\Form\ChatForm'),
'#attached' => [
'library' => [
'websocket/chat',
'websocket_chat/chat',
],
],
];
......
name: Web socket chat
type: module
description: Real-time Drupal chat with web socket
core: 8.x
package: Web socket
dependencies:
- websocket:websocket
chat:
js:
js/chat.js: {}
dependencies:
- websocket/core
<?php
/**
* @file
* Websocket chat hooks.
*/
/**
* Implements hook_theme().
*/
function websocket_chat_theme($existing, $type, $theme, $path) {
return [
'chat_block' => [
'variables' => [
'form' => '',
],
'template' => 'block--chat-block',
],
];
}
# Websocket service plugin definitions.
chat:
class: Drupal\websocket\Chat
class: Drupal\websocket_chat\Chat
enabled: true
\ No newline at end of file
......@@ -6,9 +6,3 @@ core:
- core/drupal
- core/drupal.ajax
- core/drupalSettings
chat:
js:
js/chat.js: {}
dependencies:
- websocket/core
......@@ -4,17 +4,3 @@
* @file
* Websocket hooks.
*/
/**
* Implements hook_theme().
*/
function websocket_theme($existing, $type, $theme, $path) {
return [
'chat_block' => [
'variables' => [
'form' => '',
],
'template' => 'block--chat-block',
],
];
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment