You are here

function socialfeed_facebook_settings in Social Feed 7

Same name and namespace in other branches
  1. 7.2 socialfeed.admin.inc \socialfeed_facebook_settings()

Form builder; Configure social feeds settings for this site.

See also

system_settings_form()

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

File

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

Code

function socialfeed_facebook_settings($form, &$form_state) {
  $form['socialfeed_facebook_page_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Facebook Page Name'),
    '#default_value' => variable_get('socialfeed_facebook_page_name'),
    '#description' => t('eg. If your Facebook page URL is this http://www.facebook.com/YOUR_PAGE_NAME, <br />then you just need to add this YOUR_PAGE_NAME above.'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  );
  $form['socialfeed_facebook_app_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Facebook App ID'),
    '#default_value' => variable_get('socialfeed_facebook_app_id'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  );
  $form['socialfeed_facebook_secret_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Facebook Secret Key'),
    '#default_value' => variable_get('socialfeed_facebook_secret_key'),
    '#size' => 60,
    '#maxlength' => 100,
    '#required' => TRUE,
  );
  $form['socialfeed_facebook_no_feeds'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of Feeds'),
    '#default_value' => variable_get('socialfeed_facebook_no_feeds', 10),
    '#size' => 60,
    '#maxlength' => 60,
  );
  $form['socialfeed_facebook_all_types'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show all post types'),
    '#default_value' => variable_get('socialfeed_facebook_all_types', TRUE),
  );
  $form['socialfeed_facebook_post_type'] = array(
    '#type' => 'select',
    '#title' => 'Select your post type(s) to show',
    '#default_value' => variable_get('socialfeed_facebook_post_type', 0),
    '#options' => array(
      'None',
      'link',
      'status',
      'photo',
      'video',
    ),
    // '#multiple' => TRUE,
    '#states' => array(
      'visible' => array(
        ':input[name="socialfeed_facebook_all_types"]' => array(
          'checked' => FALSE,
        ),
      ),
    ),
  );
  $form['socialfeed_facebook_display_pic'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Post Picture'),
    '#default_value' => variable_get('socialfeed_facebook_display_pic', FALSE),
    '#states' => array(
      'visible' => array(
        ':input[name="socialfeed_facebook_all_types"]' => array(
          'checked' => FALSE,
        ),
        ':input[name="socialfeed_facebook_post_type"]' => array(
          'value' => 3,
        ),
      ),
    ),
  );
  $form['socialfeed_facebook_trim_length'] = array(
    '#type' => 'textfield',
    '#title' => t('Trim Length'),
    '#default_value' => variable_get('socialfeed_facebook_trim_length', 120),
    '#size' => 60,
    '#maxlength' => 60,
  );
  $form['socialfeed_facebook_time_stamp'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Date/Time'),
    '#default_value' => variable_get('socialfeed_facebook_time_stamp', FALSE),
  );
  $form['socialfeed_facebook_time_format'] = array(
    '#type' => 'textfield',
    '#title' => t('Date/Time format'),
    '#default_value' => variable_get('socialfeed_facebook_time_format', 'd-M-Y'),
    '#description' => t('You can check for PHP Date Formats <a href="@datetime" target="@blank">here</a>', array(
      '@datetime' => 'http://php.net/manual/en/datetime.formats.date.php#datetime.formats.date',
      '@blank' => '_blank',
    )),
    '#size' => 60,
    '#maxlength' => 100,
    '#states' => array(
      'visible' => array(
        ':input[name="socialfeed_facebook_time_stamp"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
  return system_settings_form($form);
}