You are here

fb_social_likebox.module in Facebook social plugins integration 6

File

modules/fb_social_likebox/fb_social_likebox.module
View source
<?php

/**
 * Implementation of hook_menu
 */
function fb_social_likebox_menu() {
  $items = array();
  $items['admin/settings/fb/social/likebox'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'likebox',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fb_social_likebox_settings_form',
    ),
    'file' => 'fb_social_likebox.admin.inc',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
  );
  return $items;
}

/**
 * Implementation of hook_block
 */
function fb_social_likebox_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks['likebox'] = array(
        'info' => t('fb like box'),
      );
      return $blocks;
    case 'view':
      switch ($delta) {
        case 'likebox':
          return array(
            'subject' => t(''),
            'content' => theme('fb_social_likebox_block_likebox_view'),
          );
      }
      break;
  }
}

/**
 * Implementation of hook_theme
 */
function fb_social_likebox_theme() {
  return array(
    'fb_social_likebox_block_likebox_view' => array(),
  );
}
function theme_fb_social_likebox_block_likebox_view() {
  global $_fb_script_init;
  $_fb_script_init = TRUE;
  $attrs = array(
    'href' => variable_get('fb_social_likebox_href', ''),
    'width' => variable_get('fb_social_likebox_width', 292),
    'height' => variable_get('fb_social_likebox_height', 63),
    'colorscheme' => variable_get('fb_social_likebox_color', 'light'),
    'connections' => variable_get('fb_social_likebox_connections', 10),
    'stream' => variable_get('fb_social_likebox_stream', 1) ? "true" : "false",
    'header' => variable_get('fb_social_likebox_header', 1) ? "true" : "false",
  );
  if ($width = variable_get('fb_social_likebox_height', '')) {
    $attrs['height'] = $width;
  }
  $attrs = drupal_attributes($attrs);
  return '<fb:like-box ' . $attrs . '></fb:like-box>';
}

Functions

Namesort descending Description
fb_social_likebox_block Implementation of hook_block
fb_social_likebox_menu Implementation of hook_menu
fb_social_likebox_theme Implementation of hook_theme
theme_fb_social_likebox_block_likebox_view