You are here

mylivechat.module in My Live Chat 7

Same filename and directory in other branches
  1. 6 mylivechat.module

File

mylivechat.module
View source
<?php

/**
 * @file
 * Drupal Module: mylivechat
 */
require_once drupal_get_path('module', 'mylivechat') . '/mylivechat.php';

/**
 * Implements hook_init().
 */
function mylivechat_init() {
  MyLiveChat::get_instance()
    ->install_codes();
}

/**
 * Implements hook_permission().
 */
function mylivechat_permission() {
  return array(
    'administer mylivechat' => array(
      'title' => t('Administer MyLiveChat'),
      'restrict access' => TRUE,
    ),
  );
}

/**
 * Implements hook_menu().
 */
function mylivechat_menu() {
  $items['admin/settings/mylivechat'] = array(
    'title' => 'MyLiveChat',
    'description' => 'Integrate MyLiveChat software with your website.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'mylivechat_admin_settings_form',
    ),
    'access arguments' => array(
      'administer mylivechat',
    ),
    'file' => 'mylivechat.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}

/**
 * Chat button for Drupal block - admin configuration
 */
function mylivechat_block_info() {
  return array(
    'live-chat-display' => array(
      'info' => t('MyLiveChat'),
    ),
  );
}

/**
 * Chat button for Drupal block - render
 */
function mylivechat_block_view() {
  return array(
    'content' => MyLiveChat::get_instance()
      ->getChatCode(),
  );
}

Functions

Namesort descending Description
mylivechat_block_info Chat button for Drupal block - admin configuration
mylivechat_block_view Chat button for Drupal block - render
mylivechat_init Implements hook_init().
mylivechat_menu Implements hook_menu().
mylivechat_permission Implements hook_permission().