You are here

function fb_likebox_block_configure in Facebook Page Plugin 7.2

Same name and namespace in other branches
  1. 7 fb_likebox.module \fb_likebox_block_configure()

Implements hook_block_configure().

File

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

Code

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

      // Facebook Widget settings.
      $form['fb_likebox_display_settings'] = array(
        '#type' => 'fieldset',
        '#title' => t('Display options'),
        '#collapsible' => TRUE,
        '#collapsed' => FALSE,
      );
      $form['fb_likebox_display_settings']['fb_likebox_url'] = array(
        '#type' => 'textfield',
        '#title' => t('Facebook Page URL'),
        '#default_value' => variable_get('fb_likebox_url', 'https://www.facebook.com/FacebookDevelopers'),
        '#description' => t('Enter the Facebook Page URL. I.e.: https://www.facebook.com/FacebookDevelopers'),
        '#required' => TRUE,
      );
      $form['fb_likebox_display_settings']['fb_likebox_app_id'] = array(
        '#type' => 'textfield',
        '#title' => t('Facebook App ID'),
        '#default_value' => variable_get('fb_likebox_app_id', ''),
      );
      $form['fb_likebox_display_settings']['page_tabs'] = array(
        '#type' => 'fieldset',
        '#title' => t('Page Tabs: Timeline, Events & Messages'),
        '#collapsible' => FALSE,
        '#collapsed' => FALSE,
      );
      $form['fb_likebox_display_settings']['page_tabs']['fb_likebox_stream'] = array(
        '#type' => 'checkbox',
        '#title' => t("Show posts from the Page's timeline"),
        '#default_value' => variable_get('fb_likebox_stream', '1'),
      );
      $form['fb_likebox_display_settings']['page_tabs']['fb_likebox_events'] = array(
        '#type' => 'checkbox',
        '#title' => t("Show events from the Page"),
        '#default_value' => variable_get('fb_likebox_events', '0'),
      );
      $form['fb_likebox_display_settings']['page_tabs']['fb_likebox_messages'] = array(
        '#type' => 'checkbox',
        '#title' => t("Show messages from the Page"),
        '#default_value' => variable_get('fb_likebox_messages', '0'),
        '#description' => t('To enable messaging on your Facebook page, "Allow people to contact my Page privately by showing the Message button" (Direct Link: https://www.facebook.com/{your-page-name}/settings/?tab=settings&section=messages&view).'),
      );
      $form['fb_likebox_display_settings']['fb_likebox_hide_header'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide cover photo in the header'),
        '#default_value' => variable_get('fb_likebox_hide_header', '0'),
      );
      $form['fb_likebox_display_settings']['fb_likebox_show_faces'] = array(
        '#type' => 'checkbox',
        '#title' => t('Show profile photos when friends like this'),
        '#default_value' => variable_get('fb_likebox_show_faces', '1'),
      );
      $form['fb_likebox_display_settings']['fb_likebox_hide_cta'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide the custom call to action button (if available)'),
        '#default_value' => variable_get('fb_likebox_hide_cta', '0'),
      );
      $form['fb_likebox_display_settings']['fb_likebox_small_header'] = array(
        '#type' => 'checkbox',
        '#title' => t('Use the small header instead'),
        '#default_value' => variable_get('fb_likebox_small_header', '0'),
      );
      $form['fb_likebox_display_settings']['fb_likebox_adapt_container_width'] = array(
        '#type' => 'checkbox',
        '#title' => t('Try to fit inside the container width'),
        '#default_value' => variable_get('fb_likebox_adapt_container_width', '1'),
      );
      $form['fb_likebox_display_settings']['fb_likebox_title'] = array(
        '#type' => 'textfield',
        '#title' => t('iFrame title attribute'),
        '#default_value' => variable_get('fb_likebox_title', 'Like us on Facebook'),
        '#description' => t('The value of the title attribute.'),
        '#required' => TRUE,
      );
      $form['fb_likebox_display_settings']['fb_likebox_width'] = array(
        '#type' => 'textfield',
        '#title' => t('Width'),
        '#default_value' => variable_get('fb_likebox_width', '340'),
        '#description' => t('The width of the Facebook likebox. Must be a number between 180 and 500, limits included.'),
        '#required' => TRUE,
      );
      $form['fb_likebox_display_settings']['fb_likebox_height'] = array(
        '#type' => 'textfield',
        '#title' => t('Height'),
        '#default_value' => variable_get('fb_likebox_height', '500'),
        '#description' => t('The height of the plugin in pixels. Must be a number bigger than 70.'),
        '#required' => TRUE,
      );
      $form['fb_likebox_display_settings']['fb_likebox_language'] = array(
        '#type' => 'select',
        '#title' => t('Choose your language'),
        '#options' => _fb_likebox_languages(),
        '#default_value' => variable_get('fb_likebox_language', 'en_EN'),
        '#description' => t('This is the language the Page plugin will be displayed in.'),
      );
      return $form;
  }
}