You are here

function theme_cdn_numbers in CDN 5

Renders site-wide CDN integration statistics.

Parameters

$files_scheduled: Array of files that are scheduled for synchronization.

$files_scheduled_size: Total size of files that are scheduled for synchronization, in bytes.

$files_synced: Array of files that are already synchronized to the CDN.

$coverage: Floating point number, indicating the percentage of synchronized scheduled files

Return value

The rendered HTML.

1 theme call to theme_cdn_numbers()
cdn_admin_settings_form in ./cdn.module
Form definition: CDN admin settings form.

File

./cdn.module, line 378

Code

function theme_cdn_numbers($files_scheduled, $files_scheduled_size, $files_synced, $coverage) {
  $output = '';
  $header = array(
    array(
      'data' => t('Scheduled files'),
    ),
    array(
      'data' => t('Size of scheduled files'),
    ),
    array(
      'data' => t('Synchronized files'),
    ),
    array(
      'data' => t('Coverage'),
    ),
  );
  $rows[0] = array(
    'data' => array(
      count($files_scheduled),
      number_format($files_scheduled_size / 1024) . ' KB',
      count($files_synced),
      number_format($coverage * 100, 2) . '%',
    ),
  );
  $output .= theme('table', $header, $rows);
  return $output;
}