You are here

function zopim_requirements in Zopim Live Chat 8

Same name and namespace in other branches
  1. 6.2 zopim.module \zopim_requirements()
  2. 6 zopim.module \zopim_requirements()
  3. 7 zopim.module \zopim_requirements()

Implementation of hook_requirements().

File

./zopim.install, line 11
Install, update and uninstall functions for the Zopim Chat module.

Code

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;
}