You are here

zopim.install in Zopim Live Chat 8

Same filename and directory in other branches
  1. 6.2 zopim.install
  2. 6 zopim.install
  3. 7 zopim.install

Install, update and uninstall functions for the Zopim Chat module.

File

zopim.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Zopim Chat module.
 */

/**
 * Implementation of hook_requirements().
 */
function zopim_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {

    // Raise warning if Zopim Chat user account has not been set yet.
    if (\Drupal::config('zopim.settings')
      ->get('account_number', FALSE) == FALSE) {
      $requirements['zopim'] = [
        'title' => t('Zopim Chat module'),
        'description' => t('Zopim Chat module has not been configured yet. Please configure its settings from the <a href=":url">Zopim Chat settings page</a>.', [
          ':url' => \Drupal::url('zopim.settings'),
        ]),
        'severity' => REQUIREMENT_ERROR,
        'value' => t('Not configured'),
      ];
    }
  }
  return $requirements;
}

Functions

Namesort descending Description
zopim_requirements Implementation of hook_requirements().