You are here

function socialfeed_settings_form in Social Feed 6

Form constructor for the socialfeed settings form.

Path: admin/settings/socialfeed

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

File

./socialfeed.module, line 38
Module for fetching data from Facebook, Twitter, Youtube, and Foursquare. This module provides block content retrieved from a

Code

function socialfeed_settings_form() {
  drupal_add_js(drupal_get_path('module', 'socialfeed') . '/js/socialfeed_form.js');
  $form = array();
  $form['socialfeed_meta_set'] = array(
    '#type' => 'fieldset',
    '#title' => t('Basic settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['socialfeed_meta_set']['socialfeed_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#description' => t('This is the title of the person or organization represented by your feed.'),
    '#default_value' => variable_get('socialfeed_title', FALSE),
    '#required' => TRUE,
  );
  $form['socialfeed_meta_set']['socialfeed_displaycount'] = array(
    '#type' => 'textfield',
    '#title' => t('Display count'),
    '#description' => t('This is the number of items that will display.'),
    '#default_value' => variable_get('socialfeed_displaycount', FALSE),
    '#maxlength' => 3,
    '#size' => 3,
    '#required' => TRUE,
  );

  // Facebook Fieldset.
  $form['socialfeed_facebook'] = array(
    '#type' => 'fieldset',
    '#title' => t('Facebook settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['socialfeed_facebook']['socialfeed_facebook_title_checkbox'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use default title'),
    '#description' => t('This is the name that appears over each post Facebook post. If this is not defined, it will use the username of the API instead.'),
    '#default_value' => variable_get('socialfeed_facebook_title_checkbox', FALSE),
  );
  $form['socialfeed_facebook']['socialfeed_facebook_title'] = array(
    '#type' => 'textfield',
    '#description' => t('Put the title of your choice here.'),
    '#default_value' => variable_get('socialfeed_facebook_title', FALSE),
  );
  $form['socialfeed_facebook']['socialfeed_facebook_profile_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Profile id'),
    '#description' => t('This is the id of the Facebook profile you wish to pull data from.'),
    '#default_value' => variable_get('socialfeed_facebook_profile_id', FALSE),
  );
  $form['socialfeed_facebook']['socialfeed_facebook_app_id'] = array(
    '#type' => 'textfield',
    '#title' => t('App id'),
    '#description' => t('This is the id of your Facebook application. This is needed to retrieve an access token.'),
    '#default_value' => variable_get('socialfeed_facebook_app_id', FALSE),
  );
  $form['socialfeed_facebook']['socialfeed_facebook_app_secret'] = array(
    '#type' => 'textfield',
    '#title' => t('App secret'),
    '#description' => t('This is the app secret of your Facebook application. This is needed to retrieve an access token.'),
    '#default_value' => variable_get('socialfeed_facebook_app_secret', FALSE),
  );

  // Twitter Fieldset.
  $form['socialfeed_twitter'] = array(
    '#type' => 'fieldset',
    '#title' => t('Twitter settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['socialfeed_twitter']['socialfeed_twitter_title_checkbox'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use default title'),
    '#description' => t('This is the name that appears over each post Twitter post. If this is not defined, it will use the username of the API instead.'),
    '#default_value' => variable_get('socialfeed_twitter_title_checkbox', FALSE),
  );
  $form['socialfeed_twitter']['socialfeed_twitter_title'] = array(
    '#type' => 'textfield',
    '#description' => t('Put the title of your choice here.'),
    '#default_value' => variable_get('socialfeed_twitter_title', FALSE),
  );
  $form['socialfeed_twitter']['socialfeed_twitter_profile_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Profile id'),
    '#description' => t('This is the id of the Twitter profile you wish to pull data from.'),
    '#default_value' => variable_get('socialfeed_twitter_profile_id', FALSE),
  );

  // Youtube Fieldset.
  $form['socialfeed_youtube'] = array(
    '#type' => 'fieldset',
    '#title' => t('Youtube settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['socialfeed_youtube']['socialfeed_youtube_title_checkbox'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use default title'),
    '#description' => t('This is the name that appears over each post Youtube post. If this is not defined, it will use the username of the API instead.'),
    '#default_value' => variable_get('socialfeed_youtube_title_checkbox', FALSE),
  );
  $form['socialfeed_youtube']['socialfeed_youtube_title'] = array(
    '#type' => 'textfield',
    '#description' => t('Put the title of your choice here.'),
    '#default_value' => variable_get('socialfeed_youtube_title', FALSE),
  );
  $form['socialfeed_youtube']['socialfeed_youtube_profile_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Profile name'),
    '#description' => t('This is the name of the Youtube profile you wish to pull data from.'),
    '#default_value' => variable_get('socialfeed_youtube_profile_name', FALSE),
  );

  // Foursquare Fieldset.
  $form['socialfeed_foursquare'] = array(
    '#type' => 'fieldset',
    '#title' => t('Foursquare settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['socialfeed_foursquare']['socialfeed_foursquare_title_checkbox'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use default title'),
    '#description' => t('This is the name that appears over each post Foursquare post. If this is not defined, it will use the username of the API instead.'),
    '#default_value' => variable_get('socialfeed_foursquare_title_checkbox', FALSE),
  );
  $form['socialfeed_foursquare']['socialfeed_foursquare_title'] = array(
    '#type' => 'textfield',
    '#description' => t('Put the title of your choice here.'),
    '#default_value' => variable_get('socialfeed_foursquare_title', FALSE),
  );
  $form['socialfeed_foursquare']['socialfeed_foursquare_access_token'] = array(
    '#type' => 'textfield',
    '#title' => t('Access token'),
    '#description' => t('This is the access token of the Foursquare profile you wish to pull data from.'),
    '#default_value' => variable_get('socialfeed_foursquare_access_token', FALSE),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save settings'),
  );
  return $form;
}