You are here

function facebook_comments_admin in Facebook Comments Social Plugin 7

Configure Facebook comments settings like the Facebook App ID.

See also

facebook_comments_admin_applyall()

1 string reference to 'facebook_comments_admin'
facebook_comments_menu in ./facebook_comments.module
Implements of hook_menu().

File

./facebook_comments.module, line 127
Facebook Comments Social Plugin module file.

Code

function facebook_comments_admin() {
  $form = array();
  $form['facebook_comments_style'] = array(
    '#type' => 'select',
    '#title' => t('Color Scheme'),
    '#default_value' => variable_get('facebook_comments_style', 'light'),
    '#options' => array(
      'light' => t('Light'),
      'dark' => t('Dark'),
    ),
  );
  $form['facebook_comments_viewmode'] = array(
    '#type' => 'select',
    '#title' => t('View mode'),
    '#default_value' => variable_get('facebook_comments_viewmode', 'full'),
    '#options' => array(
      'both' => t('Both full node and teaser'),
      'full' => t('Full node'),
      'teaser' => t('Teaser'),
    ),
  );
  $form['facebook_comments_views'] = array(
    '#type' => 'checkbox',
    '#title' => t('Views support'),
    '#default_value' => variable_get('facebook_comments_views', 0),
    '#description' => t('Enable support for the Views module. Warning: you might lose comments on existing pages.'),
  );
  $form['facebook_comments_ssl'] = array(
    '#type' => 'checkbox',
    '#title' => t('SSL support'),
    '#default_value' => variable_get('facebook_comments_ssl', 0),
    '#description' => t('Enable support for SSL. Warning: you might lose comments on existing pages.'),
  );
  $form['facebook_comments_status'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show comments on unpublished nodes'),
    '#default_value' => variable_get('facebook_comments_status', 0),
  );
  $form['facebook_comments_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Facebook comment plugin width (nodes)'),
    '#default_value' => variable_get('facebook_comments_width', 620),
    '#description' => t('The width of the Facebook comment plugin for nodes, in pixels. Example: 620'),
  );
  $form['facebook_comments_width_fluid'] = array(
    '#type' => 'checkbox',
    '#title' => t('Fluid Facebook comment plugin width'),
    '#default_value' => variable_get('facebook_comments_width_fluid', 1),
    '#description' => t('Make the width of the Facebook comment plugin fluid (100%). This overrules the width settings above.'),
  );
  $form['facebook_comments_appid'] = array(
    '#type' => 'textfield',
    '#title' => t('Facebook App ID'),
    '#default_value' => variable_get('facebook_comments_appid', ''),
    '#description' => t('Enter the Facebook App ID to ensure that all comments can be grouped for moderation.'),
  );
  $form['facebook_comments_admins'] = array(
    '#type' => 'textfield',
    '#title' => t('Facebook Admins'),
    '#default_value' => variable_get('facebook_comments_admins', ''),
    '#description' => t('Enter a comma-seperated list of all Facebook admin user id\'s to ensure that all comments can be grouped for moderation.<br/>If you enter an App ID, the Admins will be ignored. For more information read the !url.', array(
      '!url' => l(t('developer documentation'), 'https://developers.facebook.com/docs/plugins/comments#moderation-setup-instructions', array(
        'absolute' => TRUE,
      )),
    )),
  );
  $defaulttypes = array();
  $types = node_type_get_types();
  foreach ($types as $key => $type) {
    $defaulttypes[$key] = $type->name;
  }
  $form['facebook_comments_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Facebook comment default content types'),
    '#options' => $defaulttypes,
    '#default_value' => variable_get('facebook_comments_types', array()),
    '#description' => t('Check the content types that should have Facebook comments enabled by default.<br/>This default value can be changed per node by users with the "Enable/disable Facebook comments per node" permission.'),
  );
  $form['facebook_comments_applyall'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Facebook comments on existing content for the selected content types above.'),
    '#default_value' => FALSE,
  );
  $form['#submit'][] = 'facebook_comments_admin_applyall';
  return system_settings_form($form);
}