You are here

function systeminfo_admin_overview_drupal in System Information 7.2

1 call to systeminfo_admin_overview_drupal()
systeminfo_admin_overview in ./systeminfo.admin.inc
Menu callback; retrieves overview page.

File

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

Code

function systeminfo_admin_overview_drupal() {
  $rows = array();
  $rows[] = array(
    t('Version'),
    VERSION,
  );
  $rows[] = array(
    t('Configuration file'),
    conf_path() . '/settings.php',
  );
  $cron_last = variable_get('cron_last');
  if (!is_numeric($cron_last)) {
    $cron_last = variable_get('install_time', 0);
  }
  $rows[] = array(
    t('Cron maintenance tasks'),
    t('Last run !time ago', array(
      '!time' => format_interval(REQUEST_TIME - $cron_last),
    )),
  );
  $system_info = system_get_info('module', variable_get('install_profile', 'standard'));
  $rows[] = array(
    t('Install profile'),
    $system_info['name'],
  );
  $rows[] = array(
    t('Install time'),
    format_date(variable_get('install_time', 0), 'small'),
  );
  $rows[] = array(
    t('Public file system path'),
    variable_get('file_public_path', conf_path() . '/files'),
  );
  $rows[] = array(
    t('Private file system path'),
    variable_get('file_private_path', ''),
  );

  // Content
  $rows[] = array(
    t('Content'),
    format_plural(db_query('SELECT COUNT(nid) FROM {node}')
      ->fetchField(), '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');
  foreach ($result as $record) {
    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'),
    );
  }

  // Users
  $rows[] = array(
    t('Users'),
    format_plural(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0')
      ->fetchField(), '1 account', '@count accounts'),
  );
  $rows[] = array(
    array(
      'data' => t('Active'),
      'class' => 'text1',
    ),
    format_plural(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 1')
      ->fetchField(), '1 account', '@count accounts'),
  );
  $rows[] = array(
    array(
      'data' => t('Blocked'),
      'class' => 'text1',
    ),
    format_plural(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 0')
      ->fetchField(), '1 account', '@count accounts'),
  );

  // Modules
  $rows[] = array(
    array(
      'data' => t('Modules'),
      'class' => 'title1',
      'colspan' => '2',
    ),
  );
  $modules = array();
  foreach (module_list() as $module) {
    $module_info = system_get_info('module', $module);
    $modules[$module_info['name']] = array(
      array(
        'data' => $module_info['name'],
        'class' => 'text1',
      ),
      $module_info['version'],
    );
  }
  ksort($modules);
  $rows += $modules;

  // Themes
  $rows[] = array(
    array(
      'data' => t('Themes'),
      'class' => 'title1',
      'colspan' => '2',
    ),
  );
  $themes = array();
  foreach (list_themes() as $theme) {
    if ($theme->status) {
      $themes[$theme->name] = array(
        array(
          'data' => $theme->info['name'],
          'class' => 'text1',
        ),
        $theme->info['version'],
      );
    }
  }
  ksort($themes);
  $rows += $themes;
  $output = '<h3>' . t('Drupal') . '</h3>';
  $output .= '<p>' . t('More information about the current state of the Drupal installation can be found <a href="@drupal" title="Display current state of the Drupal installation.">here</a>.', array(
    '@drupal' => url('admin/reports/systeminfo/drupal'),
  )) . '</p>';
  $output .= theme('table', array(
    'header' => array(),
    'rows' => $rows,
    'attributes' => array(
      'class' => array(
        'systeminfo',
        'systeminfo_width50',
      ),
    ),
  ));
  return $output;
}