You are here

answers.display.inc in Answers 7.3

Same filename and directory in other branches
  1. 6.2 includes/answers.display.inc
  2. 7.4 includes/answers.display.inc

Reports for the Ansers module.

File

includes/answers.display.inc
View source
<?php

/**
 * @file
 * Reports for the Ansers module.
 */

/**
 * Reports orphaned answers.
 *
 * @return string
 *   Orphan report html table.
 */
function answers_orphan_report() {
  $orphan_nids = _answers_orphan_nids();
  $questions = node_load_multiple($orphan_nids);
  $header = array(
    'Node ID',
    'Title',
    'Type',
    'Created',
    'Published',
  );
  $rows = array();
  foreach ($questions as $node) {
    $rows[] = array(
      array(
        'data' => $node->nid,
        'align' => 'center',
      ),
      l($node->title, 'node/' . $node->nid . '/edit'),
      $node->type,
      format_date($node->created),
      array(
        'data' => $node->status ? t('Published') : t('Unpublished'),
        'class' => $node->status ? 'published' : 'unpublished',
      ),
    );
  }
  $table_attributes = array(
    'id' => 'ralphs-node-table',
    'align' => 'center',
  );
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => $table_attributes,
  ));
}

Functions

Namesort descending Description
answers_orphan_report Reports orphaned answers.