You are here

function olark_footer in Olark Chat 6

Implements hook_footer().

File

./olark.module, line 59
Integrates Olark Chat in a Drupal site.

Code

function olark_footer() {

  // Note that the 'olark_enable' variable can be (un)set in
  // the $conf array in settings.php, or by another module to enable/disable
  // however, there is not a user interface for this variable.
  $role_display_olark_chat = olark_check_role_access();

  //if the display olark chat AND the variable for olark enable is true, then display Olark Chat
  if ($role_display_olark_chat && variable_get('olark_enable', 1) && !olark_suppress(FALSE)) {
    if (!variable_get('olark_context', 0)) {
      return variable_get('olark_code', '');
    }
    else {
      if ($plugin = context_get_plugin('reaction', 'olark_add')) {
        if ($plugin
          ->execute()) {
          return variable_get('olark_code', '');
        }
      }
    }
  }
}