You are here

function hosting_platform_listing in Hosting 6.2

Simple list for top level navigation.

1 string reference to 'hosting_platform_listing'
hosting_platform_menu in platform/hosting_platform.module
Implementation of hook_menu().

File

platform/hosting_platform.module, line 647
Platform node type definition.

Code

function hosting_platform_listing() {
  $platforms = _hosting_get_platforms();
  $header = array(
    t('Platform'),
    t('Release'),
    t('Server'),
    t('Verified'),
    t('Sites'),
  );
  $rows[] = array();
  $total = 0;
  foreach ($platforms as $nid => $title) {
    $row = array();
    $node = node_load($nid);
    $row[] = array(
      'class' => 'hosting-status',
      'data' => _hosting_node_link($nid),
    );
    $release = sprintf("%s %s", $node->release->title, $node->release->version);
    $row[] = _hosting_node_link($node->release->nid, $release);
    $row[] = _hosting_node_link($node->web_server);
    $row[] = hosting_format_interval($node->verified);
    $total += $count = hosting_site_count($nid, array(
      HOSTING_SITE_ENABLED,
      HOSTING_SITE_DISABLED,
      HOSTING_SITE_QUEUED,
    ));
    $row[] = $count;
    $rows[] = array(
      'data' => $row,
      'class' => _hosting_platform_list_class($node->platform_status),
    );
  }
  $row = array();
  $row[] = array(
    'data' => t('Total sites hosted'),
    'colspan' => 4,
  );
  $row[] = $total;
  $rows[] = $row;
  return theme('table', $header, $rows, array(
    'class' => 'hosting-table',
  ));
}