You are here

function jquery_social_stream_settings_form in jQuery social stream 8.2

Same name and namespace in other branches
  1. 8 jquery_social_stream.module \jquery_social_stream_settings_form()
  2. 7.2 jquery_social_stream.module \jquery_social_stream_settings_form()
  3. 7 jquery_social_stream.module \jquery_social_stream_settings_form()

General stream settings.

1 call to jquery_social_stream_settings_form()
JquerySocialStreamBlock::blockForm in src/Plugin/Block/JquerySocialStreamBlock.php

File

./jquery_social_stream.module, line 219
Code for the Campaign social media module.

Code

function jquery_social_stream_settings_form($conf) {
  $form = array();
  $general_form = jquery_social_stream_common_form(!empty($conf['general']) ? $conf['general'] : array());
  $general_form['#type'] = 'details';
  $general_form['#title'] = 'General streams settings';
  $general_form['#tree'] = TRUE;
  $general_form['#open'] = FALSE;
  $form['id'] = array(
    '#type' => 'textfield',
    '#title' => 'Feed ID',
    '#description' => 'Feed container <em>id</em> attribute.',
    '#required' => TRUE,
    '#default_value' => isset($conf['id']) ? $conf['id'] : '',
    '#element_validate' => array(
      'jquery_social_stream_validate_container_id',
    ),
  );
  $form['header'] = array(
    '#type' => 'textarea',
    '#title' => t('Header text'),
    '#description' => 'Text right above the feed.',
    '#default_value' => isset($conf['header']) ? $conf['header'] : '',
  );
  $form['footer'] = array(
    '#type' => 'textarea',
    '#title' => t('Footer text'),
    '#description' => 'Text right below the feed.',
    '#default_value' => isset($conf['footer']) ? $conf['footer'] : '',
  );
  $form['general'] = $general_form;
  $form['feeds'] = array(
    '#type' => 'details',
    '#title' => t('Feeds'),
    '#tree' => TRUE,
    '#open' => TRUE,
  );
  $types = array(
    'facebook' => t('Facebook'),
    'twitter' => t('Twitter'),
    'google' => t('Google +1'),
    'youtube' => t('YouTube'),
    'flickr' => t('Flickr'),
    'delicious' => t('Delicious'),
    'pinterest' => t('Pinterest'),
    'rss' => t('RSS feed'),
    'lastfm' => t('Last.fm'),
    'dribbble' => t('Dribbble'),
    'vimeo' => t('Vimeo'),
    'stumbleupon' => t('Stumbleupon'),
    'deviantart' => t('Deviantart'),
    'tumblr' => t('Tumblr'),
    'instagram' => t('Instagram'),
  );
  foreach ($types as $type => $type_name) {
    $function = "jquery_social_stream_{$type}_form";
    if (function_exists($function)) {
      $type_form = $function(!empty($conf['feeds'][$type]) ? $conf['feeds'][$type] : array());
      $type_form['#type'] = 'details';
      $type_form['#title'] = $type_name;
      $type_form['#open'] = FALSE;
      $form['feeds'][$type] = $type_form;
    }
  }
  return $form;
}