You are here

ajax_comments.admin.inc in AJAX Comments 6

Same filename and directory in other branches
  1. 7 ajax_comments.admin.inc

AJAX comments settings form.

File

ajax_comments.admin.inc
View source
<?php

/**
 * @file
 * AJAX comments settings form.
 */

/**
 * AJAX comments settings form.
 */
function ajax_comments_settings() {
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Settings'),
  );
  $form['settings']['ajax_comments_always_expand_form'] = array(
    '#type' => 'checkbox',
    '#title' => t('Form always expanded'),
    '#description' => t('This setting allows to render comments as collapsed link by default.'),
    '#default_value' => variable_get('ajax_comments_always_expand_form', FALSE),
  );
  $form['settings']['ajax_comments_blink_new'] = array(
    '#type' => 'checkbox',
    '#title' => t('Blink new comment'),
    '#description' => t('This effect helps to find new comment after replying to long threads.'),
    '#default_value' => variable_get('ajax_comments_blink_new', TRUE),
  );
  $form['settings']['comment_bonus_api_fold_comments'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display only first level of comments, fold replies'),
    '#default_value' => variable_get('comment_bonus_api_fold_comments', FALSE),
  );
  $form['settings']['ajax_comments_default_row_count'] = array(
    '#type' => 'textfield',
    '#title' => t('Default row count'),
    '#description' => t('Allows to control comment forms\' textarea size. Leave blank to use system defined.'),
    '#default_value' => variable_get('ajax_comments_default_row_count', 5),
  );
  $form['settings']['ajax_comments_reply_row_count'] = array(
    '#type' => 'textfield',
    '#title' => t('Row count in replies'),
    '#description' => t('Usually, there is no need in big forms for replies, so this setting allows to reduce their size.'),
    '#default_value' => variable_get('ajax_comments_reply_row_count', 3),
  );
  $form['node_types'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content types'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['node_types']['ajax_comments_node_types'] = array(
    '#type' => 'checkboxes',
    '#description' => t('Select node types you want to activate ajax comments on. If you select nothing, AJAX Comments will be enabled everywhere.'),
    '#default_value' => variable_get('ajax_comments_node_types', array()),
    '#options' => node_get_types('names'),
  );
  return system_settings_form($form);
}

Functions

Namesort descending Description
ajax_comments_settings AJAX comments settings form.