You are here

function comment_goodness_field_extra_fields in Comment goodness 7

Implements hook_field_extra_fields().

File

./comment_goodness.module, line 644
Comment goodness provides newest to oldest comment sorting

Code

function comment_goodness_field_extra_fields() {
  $return = array();
  foreach (node_type_get_types() as $type) {
    $comment_bundle = 'comment_node_' . $type->type;
    if (variable_get('comment_expose_fields_' . $type->type, FALSE)) {
      $return['comment'][$comment_bundle]['display']['author'] = array(
        'label' => t('Author'),
        'description' => t('Author of comment'),
        'weight' => -10,
      );
      if (variable_get('comment_subject_field_' . $type->type, 1) == 1) {
        $return['comment'][$comment_bundle]['display']['subject'] = array(
          'label' => t('Subject'),
          'description' => t('Subject of comment'),
          'weight' => -9,
        );
      }
      if (variable_get('user_signatures', 1) == 1) {
        $return['comment'][$comment_bundle]['display']['signature'] = array(
          'label' => t('Signature'),
          'description' => t('Signature of author'),
          'weight' => -8,
        );
      }
      if (theme_get_setting('toggle_comment_user_picture')) {
        $return['comment'][$comment_bundle]['display']['picture'] = array(
          'label' => t('Picture'),
          'description' => t('Avatar image of author'),
          'weight' => -7,
        );
      }
      $return['comment'][$comment_bundle]['display']['created'] = array(
        'label' => t('Created'),
        'description' => t('Comment creation date'),
        'weight' => -6,
      );
      $return['comment'][$comment_bundle]['display']['changed'] = array(
        'label' => t('Changed'),
        'description' => t('Comment update date'),
        'weight' => -5,
      );
      $return['comment'][$comment_bundle]['display']['new'] = array(
        'label' => t('New'),
        'description' => t('String showing if comment is new'),
        'weight' => -4,
      );
      $return['comment'][$comment_bundle]['display']['permalink'] = array(
        'label' => t('Permalink'),
        'description' => t('Permalink to comment'),
        'weight' => -3,
      );
      $return['comment'][$comment_bundle]['display']['submitted'] = array(
        'label' => t('Submitted by'),
        'description' => t('Information about who and when submitted the comment'),
        'weight' => -2,
      );
      $return['comment'][$comment_bundle]['display']['links'] = array(
        'label' => t('Links'),
        'description' => t('Comment action links'),
        'weight' => -1,
      );
    }
  }
  return $return;
}