You are here

function comments_drupal_settings in Facebook social plugins integration 7.2

Same name and namespace in other branches
  1. 6.2 plugins/fb_plugin/comments.inc \comments_drupal_settings()

File

plugins/fb_plugin/comments.inc, line 73

Code

function comments_drupal_settings($options) {
  $form = array();
  $form['node_types'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content types'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['node_types']['types'] = array(
    '#type' => 'checkboxes',
    '#description' => t('Select types that will use the facebook comments plugin'),
    '#default_value' => isset($options['node_types']['types']) ? array_keys(array_filter($options['node_types']['types'])) : array(),
    '#options' => node_type_get_names(),
  );
  $form['plugin_location'] = array(
    '#type' => 'fieldset',
    '#title' => t('plugin location and display'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['plugin_location']['node_view_modes'] = array(
    '#type' => 'checkboxes',
    '#title' => t('View modes'),
    '#description' => t('Select view mode where it will be displayed.'),
    '#options' => _fb_social_get_node_view_modes(),
    '#default_value' => isset($options['plugin_location']['node_view_modes']) ? $options['plugin_location']['node_view_modes'] : array(
      'full',
      'teaser',
    ),
  );
  $form['plugin_comments_count'] = array(
    '#type' => 'fieldset',
    '#title' => t('Number of comments link'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['plugin_comments_count']['count'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show number of comments link in the teaser view'),
    '#description' => t("If checked this will use facebook's Open Graph to get the number of comments for each \n                           node and display in the node links (e.g. '10 comments')."),
    '#default_value' => isset($options['plugin_comments_count']['count']) ? $options['plugin_comments_count']['count'] : 1,
  );
  $form['plugin_comments_count']['cache'] = array(
    '#type' => 'textfield',
    '#title' => t('Cache the result for'),
    '#description' => t("To speed up the page rendering time the nr of comments is cached. Enter the ammount of time (in minutes) before the cache is cleared"),
    '#default_value' => isset($options['plugin_comments_count']['cache']) ? $options['plugin_comments_count']['cache'] : 30,
  );
  $form['plugin_comments_seo'] = array(
    '#type' => 'fieldset',
    '#title' => t('SEO'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['plugin_comments_seo']['seo'] = array(
    '#type' => 'checkbox',
    '#title' => t('Print comments (hidden) behind the comment box'),
    '#description' => t("The Facebook comments box is rendered in an iframe on the page, and most search engines will not crawl content within an iframe.\n                          If checked, it will grab the comments from the graph API and render them behind the comments box"),
    '#default_value' => isset($options['plugin_comments_seo']['seo']) ? $options['plugin_comments_seo']['seo'] : 0,
  );
  $form['plugin_comments_seo']['nr_comments'] = array(
    '#type' => 'textfield',
    '#title' => t('Nr of comments to print'),
    '#description' => t("How many comments to grab from facebook"),
    '#default_value' => isset($options['plugin_comments_seo']['nr_comments']) ? $options['plugin_comments_seo']['nr_comments'] : 100,
  );
  $form['plugin_comments_seo']['cache_length'] = array(
    '#type' => 'textfield',
    '#title' => t('Cache the result for'),
    '#description' => t("To speed up the page rendering time the comments are cached. Enter the ammount of time (in minutes) before the cache is cleared"),
    '#default_value' => isset($options['plugin_comments_seo']['cache_length']) ? $options['plugin_comments_seo']['cache_length'] : 720,
  );
  return $form;
}