You are here

whatsappshare.module in Whatsapp Share 7.2

Help to share your content on whatsapp.

File

whatsappshare.module
View source
<?php

/**
 * @file
 * Help to share your content on whatsapp.
 */

/**
 * Implements menu hook().
 */
function whatsappshare_menu() {
  $items = array();
  $items['admin/config/services/whatsappshare'] = array(
    'title' => 'Whatsapp Share',
    'description' => 'Help to share your content on whatsapp',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'whatsappshare_form',
    ),
    'access arguments' => array(
      'administer whatsappshare',
    ),
    'file' => 'whatsappshare.admin.inc',
  );
  return $items;
}

/**
 * Implements hook_permission().
 */
function whatsappshare_permission() {
  return array(
    'administer whatsappshare' => array(
      'title' => t('Administer Whatsapp Share'),
      'description' => t('Provide permission to user for Whatsapp share.'),
    ),
  );
}

/**
 * Function whatsappshare_init() will contain rendering logic.
 */

/**
 * Note This hook is run at the beginning of the page request.
 */
function whatsappshare_init() {
  global $base_url;
  $path = $base_url . '/' . request_path();
  drupal_add_js(array(
    'whatsappshare' => array(
      'whatsappshare_button_text' => variable_get('whatsappshare_button_text', t('Share on whatsapp')),
      'whatsappshare_button_size' => variable_get('whatsappshare_button_size', t('Small')),
      'whatsappshare_sharing_text' => variable_get('whatsappshare_sharing_text', t('Your sharing text will come here.')),
      'whatsappshare_sharing_location' => variable_get('whatsappshare_sharing_location', '#page-title'),
      'base_path' => $path,
    ),
  ), 'setting');
  drupal_add_js(drupal_get_path('module', 'whatsappshare') . '/js/whatsappshare.js');
}

Functions

Namesort descending Description
whatsappshare_init Note This hook is run at the beginning of the page request.
whatsappshare_menu Implements menu hook().
whatsappshare_permission Implements hook_permission().