You are here

function fb_likebox_block_view in Facebook Page Plugin 7

Same name and namespace in other branches
  1. 7.2 fb_likebox.module \fb_likebox_block_view()

Implements hook_block_view().

File

./fb_likebox.module, line 159
Simple module that provides a configurable block with Facebook Likebox's plugin.

Code

function fb_likebox_block_view($delta = '') {
  switch ($delta) {
    case '0':

      // Get the values given in the admin form.
      $fb_url = variable_get('fb_likebox_url', 'https://www.facebook.com/FacebookDevelopers');
      $fb_colorscheme = variable_get('fb_likebox_colorscheme', 'light');
      $fb_header = variable_get('fb_likebox_header', 'true');
      $fb_stream = variable_get('fb_likebox_stream', 'true');
      $fb_show_faces = variable_get('fb_likebox_show_faces', 'true');
      $fb_scrolling = variable_get('fb_likebox_scrolling', 'no');
      $fb_width = variable_get('fb_likebox_width', '292');
      $fb_width_units = variable_get('fb_likebox_width_units', 'px');
      $fb_height = variable_get('fb_likebox_height', '556');
      $fb_show_border = variable_get('fb_likebox_show_border', 'true');
      $fb_force_wall = variable_get('fb_likebox_force_wall', 'false');
      $fb_iframe_title = variable_get('fb_likebox_iframe_title', 'Like us on Facebook');

      // Set the subject of the block
      $block['subject'] = t('@site_name on Facebook', array(
        '@site_name' => variable_get('site_name', 'Default site name'),
      ));

      // Call to the theming function.
      $block['content'] = theme('fb_likebox_facebook', array(
        'fb_url' => $fb_url,
        'fb_colorscheme' => $fb_colorscheme,
        'fb_header' => $fb_header,
        'fb_stream' => $fb_stream,
        'fb_show_faces' => $fb_show_faces,
        'fb_scrolling' => $fb_scrolling,
        'fb_width' => $fb_width,
        'fb_width_units' => $fb_width_units,
        'fb_height' => $fb_height,
        'fb_show_border' => $fb_show_border,
        'fb_force_wall' => $fb_force_wall,
        'fb_iframe_title' => $fb_iframe_title,
      ));
      return $block;
  }
}