} else {
    $displayed_sites = $sites;
}
foreach ($displayed_sites as $site_index => $current_website) {
    $websitename = Project::getWebsiteName($current_website);
    $website_data_source = Project::getWebsiteDataType($current_website);
    if ($website_data_source == 'lang') {
        $table_headers = "<th>Filename</th><th>URL</th><th>Status</th><th>Translations</th><th>Strings</th><th>Words</th>";
    } else {
        $table_headers = "<th>Filename</th>\n<th>Status</th>\n\n";
    }
    $html_output .= "\n\t<h2 id='{$websitename}'><a href='#{$websitename}'>{$websitename}</a></h2>\n";
    $html_output .= "\t<table class='listpages'>\n        <thead>\n            <tr>{$table_headers}</tr>\n        </thead>\n        <tbody>\n";
    // Totals to display in the table footer
    $total_strings = $total_words = $total_files = 0;
    foreach (Project::getWebsiteFiles($current_website) as $current_filename) {
        if ($website_data_source == 'lang') {
            $reference_locale = Project::getReferenceLocale($current_website);
            $reference_data = LangManager::loadSource($current_website, $reference_locale, $current_filename);
            $get_words = function ($item) {
                return str_word_count(strip_tags($item));
            };
            $nb_words = array_sum(array_map($get_words, $reference_data['strings']));
            $nb_strings = count($reference_data['strings']);
            $total_strings += $nb_strings;
            $total_words += $nb_words;
            $total_files++;
            $html_output .= "<tr>\n";
            // Check if the file is obsolete for all locales
            if (Project::isObsoleteFile($current_website, $current_filename, 'all')) {
                $html_output .= "  <td class='obsolete' title='Obsolete file'>{$current_filename}</td>\n";