You are here

function heartbeat_comments_form_alter in Heartbeat 6.4

Implementation of hook_form_alter().

File

modules/heartbeat_comments/heartbeat_comments.module, line 97
heartbeat_comments.module Heartbeat comments can come with two possible

Code

function heartbeat_comments_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'heartbeat_admin_settings') {

    // heartbeat_relations_api
    $form['hb_comments'] = array(
      '#type' => 'fieldset',
      '#weight' => -1,
      '#title' => t('Heartbeat comment settings'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['hb_comments']['heartbeat_comments_cache'] = array(
      '#title' => t('Enable heartbeat comments cache'),
      '#description' => t('When enabled, heartbeat will cache the cache with the form foreach activity. This means times and so will not be updated untill new comment is made.'),
      '#type' => 'checkbox',
      '#default_value' => variable_get('heartbeat_comments_cache', 1),
      '#weight' => -5,
    );
    $form['hb_comments']['heartbeat_comments_position'] = array(
      '#title' => t('Choose the position of the comment box'),
      '#type' => 'select',
      '#options' => array(
        'down' => t('Comment list is beneath the comment box'),
        'up' => t('Comment list is on top of the comment box'),
      ),
      '#default_value' => variable_get('heartbeat_comments_position', 'down'),
      '#weight' => -5,
    );
    $form['hb_comments']['heartbeat_comments_order'] = array(
      '#title' => t('Select the sort order of the comments'),
      '#type' => 'select',
      '#options' => array(
        'recent_on_top' => t('Most recent comments on top'),
        'oldest_on_top' => t('Oldest comments on top'),
      ),
      '#default_value' => variable_get('heartbeat_comments_order', 'recent_on_top'),
      '#weight' => -5,
    );
    $form['hb_comments']['heartbeat_comments_comment_count'] = array(
      '#title' => t('Maximum of displayed heartbeat comments'),
      '#type' => 'textfield',
      '#default_value' => variable_get('heartbeat_comments_comment_count', 5),
      '#weight' => -5,
    );
    $form['hb_comments']['heartbeat_comments_node_count'] = array(
      '#title' => t('Maximum of displayed heartbeat node comments'),
      '#type' => 'textfield',
      '#default_value' => variable_get('heartbeat_comments_node_count', 5),
      '#weight' => -5,
    );
    $form['hb_comments']['heartbeat_comments_load_more'] = array(
      '#title' => t('Choose the behaviour of the more comments button'),
      '#type' => 'select',
      '#options' => array(
        'ajax' => t('Load with ajax'),
        'page' => t('Load on detail page'),
      ),
      '#default_value' => variable_get('heartbeat_comments_load_more', 'page'),
      '#description' => t('Note that the ajax loading will be very heavy on for high traffic sites. Use this feature wisely!'),
    );
  }
}