You are here

function _systeminfo_admin_overview_drupal_content in System Information 6.3

Same name and namespace in other branches
  1. 7.3 systeminfo.admin.inc \_systeminfo_admin_overview_drupal_content()
1 call to _systeminfo_admin_overview_drupal_content()
systeminfo_admin_overview in ./systeminfo.admin.inc
Menu callback; displays the overview page.

File

./systeminfo.admin.inc, line 81
Admin page callbacks for the systeminfo module.

Code

function _systeminfo_admin_overview_drupal_content() {
  $rows = array();
  $rows[] = array(
    t('Total'),
    format_plural(db_result(db_query('SELECT COUNT(nid) FROM {node}')), '1 node', '@count nodes'),
  );
  $node_types = array();
  $result = db_query('SELECT n.type, nt.name, COUNT(n.nid) AS count FROM {node} n LEFT JOIN {node_type} nt ON n.type = nt.type GROUP BY n.type');
  while ($record = db_fetch_object($result)) {
    if (!$record->name) {
      $record->name = $record->type;
    }
    $node_types[$record->name] = $record;
  }
  ksort($node_types);
  foreach ($node_types as $node_type) {
    $rows[] = array(
      array(
        'data' => check_plain($node_type->name),
        'class' => 'text1',
      ),
      format_plural($node_type->count, '1 node', '@count nodes'),
    );
  }
  return theme('table', array(), $rows, array(
    'class' => 'systeminfo systeminfo-width50',
  ));
}