You are here

public function TwitterTimelineBean::form in Twitter Timeline 7

Builds extra settings for the block edit form.

Overrides BeanPlugin::form

File

plugins/bean/twitter_timeline.inc, line 24
Twitter Pull bean plugin.

Class

TwitterTimelineBean
@file Twitter Pull bean plugin.

Code

public function form($bean, $form, &$form_state) {
  $form = array();
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#tree' => 1,
    '#title' => t('Options'),
  );
  $form['settings']['widget_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Widget ID'),
    '#description' => t('ID of the widget to embed.'),
    '#size' => 25,
    '#maxlength' => 25,
    '#default_value' => isset($bean->settings['widget_id']) ? $bean->settings['widget_id'] : '',
  );
  $form['settings']['placeholder_text'] = array(
    '#type' => 'textfield',
    '#title' => t('Placeholder text'),
    '#description' => t('Text to display while the twitter widget loads.'),
    '#default_value' => isset($bean->settings['placeholder_text']) ? $bean->settings['placeholder_text'] : '',
  );
  $form['settings']['placeholder_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Placeholder url'),
    '#description' => t('Link for the placeholder text.'),
    '#default_value' => isset($bean->settings['placeholder_url']) ? $bean->settings['placeholder_url'] : '',
  );
  return $form;
}