You are here

public function HeartbeatActivityCommentsPlugin::pluginUIForm in Heartbeat 7

pluginUIForm().

Overrides HeartbeatBasePlugin::pluginUIForm

File

modules/heartbeat_comments/plugins/activitycomments.inc, line 349
Defines activity comments.

Class

HeartbeatActivityCommentsPlugin
Class HeartbeatFlagAttachmentPlugin.

Code

public function pluginUIForm(&$form, &$form_state) {
  $settings = $form_state['item']->settings;
  $form['settings']['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' => isset($settings['heartbeat_comments_cache']) ? $settings['heartbeat_comments_cache'] : '',
    '#weight' => -5,
  );
  $form['settings']['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' => isset($settings['heartbeat_comments_position']) ? $settings['heartbeat_comments_position'] : 'up',
    '#weight' => -5,
  );
  $form['settings']['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' => isset($settings['heartbeat_comments_order']) ? $settings['heartbeat_comments_order'] : 'oldest_on_top',
    '#weight' => -5,
  );
  $form['settings']['heartbeat_comments_comment_count'] = array(
    '#title' => t('Maximum of displayed heartbeat comments'),
    '#type' => 'textfield',
    '#default_value' => isset($settings['heartbeat_comments_comment_count']) ? $settings['heartbeat_comments_comment_count'] : '',
    '#weight' => -5,
  );
  $form['settings']['heartbeat_comments_node_count'] = array(
    '#title' => t('Maximum of displayed heartbeat node comments'),
    '#type' => 'textfield',
    '#default_value' => isset($settings['heartbeat_comments_node_count']) ? $settings['heartbeat_comments_node_count'] : '',
    '#weight' => -5,
  );
  $form['settings']['heartbeat_comments_show'] = array(
    '#title' => t('Choose whether to show comments or hide them by default'),
    '#type' => 'select',
    '#options' => array(
      'block' => t('Show comments by default'),
      'none' => t('Hide comments by default'),
    ),
    '#default_value' => isset($settings['heartbeat_comments_show']) ? $settings['heartbeat_comments_show'] : 'block',
    '#weight' => -5,
  );
  $form['settings']['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' => isset($settings['heartbeat_comments_load_more']) ? $settings['heartbeat_comments_load_more'] : '',
    '#description' => t('Note that the ajax loading will be very heavy on for high traffic sites. Use this feature wisely!'),
  );
}