You are here

function jquery_social_stream_facebook_form in jQuery social stream 8.2

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

Facebook settings form.

File

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

Code

function jquery_social_stream_facebook_form($conf) {
  $form = array();
  $api_key = \Drupal::config('jquery_social_stream.settings')
    ->get('facebook_app_id');
  if (!$api_key) {
    $form['#description'] = t('Please note you must enter Facebook App info at <a href="/admin/config/services/jquery-social-stream">admin/config/services/jquery-social-stream</a> to display Facebook feed');
  }
  $id_description = '<p>Facebook has 2 different ID options:</p>
<dl>
<dt>Facebook page wall posts</dt>
<dd>Enter the page ID. For facebook page posts the ID of your facebook page must be used -
this should be a numerical value, not the actual name of your facebook page (e.g. <em>157969574262873</em>).
To get the ID from your username you can use the following tool from facebook - replace "[username]" with the
name of your Facebook page profile: https://graph.facebook.com/[username]</dd>
<dt>Facebook page gallery images</dt>
<dd>Enter the text you would like to show for the facebook gallery name followed by "/" followed by the page gallery ID (e.g. <em>Facebook Timeline/376995711728</em>)</dd></dl>';
  _jquery_social_stream_settings_text($form, $conf, 'id', 'Facebook ID', $id_description, '', 512);
  _jquery_social_stream_settings_text($form, $conf, 'intro', 'Intro', 'Feed item intro text.', t('Posted to wall'));
  _jquery_social_stream_settings_text($form, $conf, 'out', 'Output', 'Stream item output: content blocks & order. Available options: intro, thumb, title, text, user, share.', 'intro,thumb,title,text,user,share');
  $comments_options = range(0, 25);
  $comments_options = array_combine($comments_options, $comments_options);
  _jquery_social_stream_settings_select($form, $conf, 'comments', 'Comments', 'the maximum number of comments to display for facebook page gallery images.', $comments_options, 3);
  $width_options = array(
    3 => '600px',
    4 => '480px',
    5 => '320px',
    6 => '180px',
  );
  _jquery_social_stream_settings_select($form, $conf, 'image_width', 'Image width', 'Select the image size for facebook gallery images.', $width_options, 6);
  _jquery_social_stream_settings_select($form, $conf, 'feed', 'Feed', '<em>Feed</em>: show all posts on the facebook page, including those by other users. <em>Posts</em>: show only those posts made by the page admin.', array(
    'feed' => t('Feed'),
    'posts' => t('Posts'),
  ), 'feed');
  $form['icon'] = array(
    '#type' => 'value',
    '#value' => 'facebook.png',
  );
  return $form;
}