You are here

function facebook_boxes_block_configure in Facebook Boxes 7

Implements hook_block_configure().

File

./facebook_boxes.module, line 27

Code

function facebook_boxes_block_configure($delta = '') {
  global $base_root;
  $form = array();
  if ($delta == 'fb_like') {
    $form['fb_url'] = array(
      '#type' => 'textfield',
      '#title' => t('Facebook Page URL'),
      '#description' => t('The full URL of your Facebook page, e.g. http://www.facebook.com/platform'),
      '#default_value' => variable_get('fb_like_url', 'http://www.facebook.com/platform'),
    );
    $form['fb_width'] = array(
      '#type' => 'textfield',
      '#size' => 6,
      '#maxlength' => 4,
      '#title' => t('Width'),
      '#description' => t('Width, in pixels, of the Facebook box iframe.'),
      '#default_value' => variable_get('fb_like_width', 292),
    );
    $form['fb_height'] = array(
      '#type' => 'textfield',
      '#size' => 6,
      '#maxlength' => 5,
      '#title' => t('Height'),
      '#description' => t('Height, in pixels, of the Facebook box iframe.'),
      '#default_value' => variable_get('fb_like_height', 300),
    );
    $form['fb_colorscheme'] = array(
      '#type' => 'select',
      '#options' => array(
        'light' => t('Light'),
        'dark' => t('Dark'),
      ),
      '#title' => t('Color scheme'),
      '#description' => t('The color scheme used by the plugin.'),
      '#default_value' => variable_get('fb_like_colorscheme', 'light'),
    );
    $form['fb_border'] = array(
      '#type' => 'textfield',
      '#size' => 10,
      '#maxlength' => 7,
      '#title' => t("Border color"),
      '#description' => t('Color of 1px border around iframe, including leading "#" such as #ff0000.'),
      '#default_value' => variable_get('fb_like_border', ''),
    );
    $form['fb_toggles'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Configuration'),
      '#options' => array(
        'fb_faces' => 'Show Faces',
        'fb_stream' => 'Show Stream',
        'fb_header' => 'Show FB Header',
      ),
      '#default_value' => variable_get('fb_like_toggles', array(
        'fb_faces',
        'fb_header',
      )),
    );
  }
  elseif ($delta == 'fb_rec') {

    /**
     * recommendations box documentation is at https://developers.facebook.com/docs/reference/plugins/recommendations/
     * It includes options that aren't included here, such as app id, actions, and font
     */
    global $base_path;
    $form['fb_domain'] = array(
      '#type' => 'textfield',
      '#title' => t('Site Domain'),
      '#description' => t('The domain to track activity on, e.g. ' . parse_url($base_root, PHP_URL_HOST)),
      '#default_value' => variable_get('fb_rec_domain', parse_url($base_root, PHP_URL_HOST)),
    );
    $form['fb_width'] = array(
      '#type' => 'textfield',
      '#size' => 6,
      '#maxlength' => 4,
      '#title' => t('Width'),
      '#description' => t('Width, in pixels, of the Facebook box iframe.'),
      '#default_value' => variable_get('fb_rec_width', 292),
    );
    $form['fb_height'] = array(
      '#type' => 'textfield',
      '#size' => 6,
      '#maxlength' => 5,
      '#title' => t('Height'),
      '#description' => t('Height, in pixels, of the Facebook box iframe.'),
      '#default_value' => variable_get('fb_rec_height', 300),
    );
    $form['fb_colorscheme'] = array(
      '#type' => 'select',
      '#options' => array(
        'light' => t('Light'),
        'dark' => t('Dark'),
      ),
      '#title' => t('Color scheme'),
      '#description' => t('The color scheme used by the plugin.'),
      '#default_value' => variable_get('fb_rec_colorscheme', 'light'),
    );
    $form['fb_border'] = array(
      '#type' => 'textfield',
      '#size' => 10,
      '#maxlength' => 7,
      '#title' => t("Border color"),
      '#description' => t('Color of 1px border around iframe, including leading "#" such as #ff0000.'),
      '#default_value' => variable_get('fb_rec_border', ''),
    );
    $form['fb_toggles'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Configuration'),
      '#options' => array(
        'fb_blank' => 'Open links in new window/tab',
        'fb_header' => 'Show Facebook Header',
      ),
      '#default_value' => variable_get('fb_like_toggles', array(
        'fb_blank',
        'fb_header',
      )),
    );
  }
  elseif ($delta == 'fb_follow') {
    $form['fb_follow_url'] = array(
      '#type' => 'textfield',
      '#title' => t('Facebook Page URL'),
      '#description' => t('The full URL of your Facebook page, e.g. http://www.facebook.com/newsignature'),
      '#default_value' => variable_get('fb_follow_url', 'http://www.facebook.com/newsignature'),
    );
    $form['fb_follow_layout'] = array(
      '#type' => 'select',
      '#title' => t('Layout'),
      '#options' => array(
        'standard' => 'standard',
        'button_count' => 'button_count',
        'box_count' => 'box_count',
      ),
      '#default_value' => variable_get('fb_follow_layout', 'standard'),
    );
    $form['fb_follow_showface'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show faces'),
      '#description' => t('Specifies whether to display profile photos below the button (standard layout only)'),
      '#return_value' => 1,
      '#default_value' => variable_get('fb_follow_showface', 1),
    );
    $form['fb_follow_colorscheme'] = array(
      '#type' => 'select',
      '#title' => t('Color Scheme'),
      '#options' => array(
        'light' => 'light',
        'dark' => 'dark',
      ),
      '#default_value' => variable_get('fb_follow_colorscheme', 'light'),
    );
    $form['fb_follow_font'] = array(
      '#type' => 'select',
      '#title' => t('Font'),
      '#options' => array(
        'arial' => 'arial',
        'lucida grande' => 'lucida grande',
        'segoe ui' => 'segoe ui',
        'tahoma' => 'tahoma',
        'trebuchet ms' => 'trebuchet ms',
        'verdana' => 'verdana',
      ),
      '#default_value' => variable_get('fb_follow_font', 'arial'),
    );
    $form['fb_follow_width'] = array(
      '#type' => 'textfield',
      '#size' => 10,
      '#maxlength' => 7,
      '#title' => t('Width'),
      '#description' => t('Width of the plugin'),
      '#default_value' => variable_get('fb_follow_width', '450'),
    );
  }
  return $form;
}