_mediamosa_maintenance_status()Generate the status page.
sites/all/modules/mediamosa/maintenance/mediamosa_maintenance.module, line 195
<?php
function _mediamosa_maintenance_status() {
// If we are set as Home page, the breadcrumb isnt set, lets do it here.
$breadcrumb = array();
$breadcrumb[] = l(t('Home'), NULL);
$breadcrumb[] = l(t('Administer'), 'admin');
$breadcrumb[] = l(t('MediaMosa'), 'admin/mediamosa');
drupal_set_breadcrumb($breadcrumb);
// Need the classes of simpletest.
drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css');
// Get the result.
$tests = variable_get('mediamosa_test_results', array('tests' => array()));
$header = array(
array('data' => t('Component')),
array('data' => t('Test')),
array('data' => t('Result')),
array('data' => t('TTR (seconds)')),
array('data' => t('Last run')),
);
$rows = array();
if (isset($tests[mediamosa_settings::MEDIAMOSA_RUN_10_MINUTES])) {
foreach ($tests[mediamosa_settings::MEDIAMOSA_RUN_10_MINUTES] as $name => $test) {
$class = 'simpletest-pass';
if (!isset($test['results']) || empty($test['results'])) {
$test['results'] = array(
'#fail' => 0,
'#exception' => 0,
'#pass' => 0,
);
$test['ended'] = $test['started'] = 0;
}
if ($test['results']['#fail'] > 0 || $test['results']['#exception'] > 0 || $test['results']['#pass'] == 0) {
$class = 'simpletest-fail';
}
//simpletest-fail
$rows[] = array(
'data' => array(
$test['info']['group'],
$test['info']['name'],
t('Passes: (!passes), Failures: (!failures), Exceptions: (!exceptions)',
array(
'!passes' => $test['results']['#pass'],
'!failures' => $test['results']['#fail'],
'!exceptions' => $test['results']['#exception'],
)
),
round($test['ended'] - $test['started'], 2),
theme('mediamosa_maintenance_date', array('timestamp' => round($test['started']))),
),
'class' => array($class)
);
}
}
// theme de arrays naar een tabel
$content = theme('table', array('header' => $header, 'rows' => $rows, 'empty' => 'No status information found, please check if cron is working properly.'));
return $content;
}
?>