コード例 #1
0
ファイル: health_status.php プロジェクト: jotes/transvision
        // If we have more than one repo for which we need to get status
        if (!isset($status['translated'])) {
            foreach ($status as $repo => $component) {
                $html[$project]['repos'] .= Health::addRow(Health::getColumnsKeys(), $component);
            }
        } else {
            $html[$project]['repos'] .= Health::addRow(Health::getColumnsKeys(), $status);
        }
        $new_tab = $first_tab = false;
    }
}
// Closing content div for each tab, concatenate all the html
$content = '';
foreach (array_keys($html) as $project) {
    if (!empty($html[$project]['repos'])) {
        $content .= $html[$project]['repos'] . '</table>' . Health::getStatsPane($projects[$project]) . '</div>';
    }
}
// Get stats
$stats = Health::getStats($projects);
$translated = $stats['translated'];
$reference = $stats['total'];
$completion = round($translated / $reference * 100, 2);
$completion = $completion > 100 ? 100 : $completion;
// Get color from completion value
$color = Utils::redYellowGreen($completion);
// Get active projects
$active_projects = '<h4>Active projects:</h4><ul>';
if (isset($projects['release']['repos'])) {
    $active_projects .= '<li><b>Desktop:</b> ';
    foreach (array_keys($projects['release']['repos']) as $repo) {