You are here

function socialfeed_instagram_settings in Social Feed 7.2

Same name and namespace in other branches
  1. 7 socialfeed.admin.inc \socialfeed_instagram_settings()

Form builder; Configure social feeds settings for this site.

See also

system_settings_form()

1 string reference to 'socialfeed_instagram_settings'
socialfeed_menu in ./socialfeed.module
Implements hook_menu().

File

./socialfeed.admin.inc, line 250
Social Feed module admin inc file.

Code

function socialfeed_instagram_settings($form, &$form_state) {
  $form['socialfeed_instagram_header']['#markup'] = t('To get App ID you need to manage clients from your instagram account detailed information <a href="@admin" target="@blank">here</a>.', [
    '@admin' => url('admin/help/socialfeed'),
    '@blank' => '_blank',
  ]);
  $form['socialfeed_instagram_client_id'] = [
    '#type' => 'textfield',
    '#title' => t('App ID'),
    '#description' => t('App ID from your Instagram Account, for more details click <a href="@here"  target="@blank">here</a>.', [
      '@here' => 'https://gist.github.com/hemangigokhale/156db13c70840f076d766cd2b3976276#instagram',
      '@blank' => '_blank',
    ]),
    '#default_value' => variable_get('socialfeed_instagram_client_id'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  ];
  $form['socialfeed_instagram_app_secret'] = [
    '#type' => 'textfield',
    '#title' => t('App Secret'),
    '#description' => t('App Secret from your Instagram Account, for more details click <a href="@here"  target="@blank">here</a>.', [
      '@here' => 'https://gist.github.com/hemangigokhale/156db13c70840f076d766cd2b3976276#instagram',
      '@blank' => '_blank',
    ]),
    '#default_value' => variable_get('socialfeed_instagram_app_secret'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  ];
  $form['socialfeed_instagram_access_token'] = [
    '#type' => 'textfield',
    '#title' => t('Access Token'),
    '#default_value' => variable_get('socialfeed_instagram_access_token'),
    '#size' => 60,
    '#maxlength' => 255,
    '#required' => TRUE,
  ];
  $form['socialfeed_instagram_picture_count'] = [
    '#type' => 'textfield',
    '#title' => t('Picture Count'),
    '#default_value' => variable_get('socialfeed_instagram_picture_count', 1),
    '#size' => 60,
    '#maxlength' => 100,
  ];
  if (variable_get('socialfeed_instagram_access_token')) {
    $form['socialfeed_instagram_feed'] = [
      '#type' => 'item',
      '#title' => t('Feed URL'),
      '#markup' => t(SOCIALFEED_INSTAGRAM_GRAPH_URL . '&limit=@socialfeed_instagram_picture_count&access_token=@socialfeed_instagram_access_token', [
        '@socialfeed_instagram_access_token' => variable_get('socialfeed_instagram_access_token'),
        '@socialfeed_instagram_picture_count' => variable_get('socialfeed_instagram_picture_count', 1),
      ]),
    ];
  }
  $form['socialfeed_instagram_post_link'] = [
    '#type' => 'checkbox',
    '#title' => t('Show post URL'),
    '#default_value' => variable_get('socialfeed_instagram_post_link', FALSE),
  ];
  return system_settings_form($form);
}