You are here

tawk_to.module in Tawk.to - Live chat application (Drupal 8) 8

Same filename and directory in other branches
  1. 8.2 tawk_to.module

Contains main module code.

File

tawk_to.module
View source
<?php

/**
 * @file
 * Contains main module code.
 */

/**
 * Implements hook_help().
 *
 * @see hook_help()
 */
function tawk_to_help($route_name) {
  switch ($route_name) {
    case 'help.page.tawk_to':
      return t('
        <h2><a href="http://tawk.to">Tawk.to</a> widget for Drupal 8.</h2>
        <p>Tawk.to widget cutomization, using this module you can select widget which will be used on specific site pages.</p>
      ');
  }
}

/**
 * Implements hook_page_bottom().
 *
 * Hook for adding widget script to every page.
 *
 * @see hook_page_bottom()
 */
function tawk_to_page_bottom(array &$page_bottom) {
  $page_bottom['tawk_to_widget'] = \Drupal::service('tawk_to.embed_render')
    ->render();
}

/**
 * Implements hook_theme().
 */
function tawk_to_theme() {
  return [
    'tawk_to' => [
      'variables' => [
        'items' => [],
      ],
    ],
    'tawk_to_iframe' => [
      'variables' => [
        'items' => [],
      ],
    ],
  ];
}

Functions

Namesort descending Description
tawk_to_help Implements hook_help().
tawk_to_page_bottom Implements hook_page_bottom().
tawk_to_theme Implements hook_theme().