aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-04-21 16:35:32 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-04-21 16:35:32 +0000
commitc0a09ef80af1851a003c19b3894fde4d51c1f502 (patch)
tree248e6e4a9e5c873ebd49ee940012926c6151cea7 /phpBB
parentcfc85ff84d38298bbd61d3c7b5517f628ca96187 (diff)
downloadforums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar
forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar.gz
forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar.bz2
forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar.xz
forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.zip
A few changes, moved some items to templates
git-svn-id: file:///svn/phpbb/trunk@3909 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions.php33
1 files changed, 11 insertions, 22 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 80a3d3fe34..1862629e52 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -155,6 +155,7 @@ function get_forum_parents($forum_data)
{
$forum_parents[$row['forum_id']] = $row['forum_name'];
}
+ $db->sql_freeresult($result);
$sql = 'UPDATE ' . FORUMS_TABLE . "
SET forum_parents = '" . $db->sql_escape(serialize($forum_parents)) . "'
@@ -176,7 +177,7 @@ function get_moderators(&$forum_moderators, $forum_id = false)
global $config, $template, $db;
// Have we disabled the display of moderators? If so, then return
- // from whence we came ... after setting an S_ template var
+ // from whence we came ...
if (empty($config['load_moderators']))
{
return;
@@ -256,18 +257,15 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
return;
}
-function make_jumpbox($action, $forum_id = false, $enable_select_all = false)
+function make_jumpbox($action, $forum_id = false, $select_all = false)
{
global $auth, $template, $user, $db, $nav_links, $phpEx, $SID;
- $boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }">';
- $boxstring .= ($enable_select_all) ? '<option value="0">' . $user->lang['ALL_FORUMS'] : '<option value="-1">' . $user->lang['SELECT_FORUM'];
- $boxstring .= '</option><option value="-1">-----------------</option>';
-
+ $boxstring = '';
$sql = 'SELECT forum_id, forum_name, forum_postable, left_id, right_id
FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
- $result = $db->sql_query($sql, 120);
+ $result = $db->sql_query($sql, 600);
$right = $cat_right = 0;
$padding = $forum_list = $holding = '';
@@ -322,16 +320,13 @@ function make_jumpbox($action, $forum_id = false, $enable_select_all = false)
}
$db->sql_freeresult($result);
- if (!$right)
+ if ($boxstring != '')
{
- $boxstring .= '<option value="-1">' . $user->lang['NO_FORUMS'] . '</option>';
+ $boxstring = (($select_all) ? '<option value="0">' . $user->lang['ALL_FORUMS'] : '<option value="-1">' . $user->lang['SELECT_FORUM']) . '</option><option value="-1">-----------------</option>' . $boxstring;
}
- $boxstring .= '</select>';
- $boxstring .= '<input type="hidden" name="sid" value="' . $user->session_id . '" />';
-
$template->assign_vars(array(
- 'S_JUMPBOX_SELECT' => $boxstring,
+ 'S_JUMPBOX_OPTIONS' => $boxstring,
'S_JUMPBOX_ACTION' => $action)
);
@@ -434,14 +429,8 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
AND user_id = $user_id";
$result = $db->sql_query($sql);
- if ($row = $db->sql_fetchrow($result))
- {
- $notify_status = $row['notify_status'];
- }
- else
- {
- $notify_status = NULL;
- }
+ $notify_status = ($row = $db->sql_fetchrow($result)) ? $row['notify_status'] : NULL;
+ $db->sql_freeresult($result);
}
if (!is_null($notify_status))
@@ -532,7 +521,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
// Marks a topic or form as read in the 'lastread' table.
function markread($mode, $forum_id = 0, $topic_id = 0, $post_id = 0)
{
- global $db, $user;
+ global $config, $db, $user;
if ($user->data['user_id'] == ANONYMOUS)
{
n298'>298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="robots" content="noindex,nofollow,nosnippet">
    <title>www.mageia.org translation report</title>
    <style>
        html, body { margin: 0; padding: 0; font-family: Verdana, "Trebuchet MS", "Lucida Grande", "Lucida Sans", Verdana, Tahoma, Arial, sans-serif; }
        table, th, td {
            border:1px solid gray;
            border-collapse:collapse;
        }
        th { text-align: left; }
        td, th { font-size: 80%; padding: 0.3em; }
        td a div, td.progress div { float: left; }
        #page { padding: 1em; position: absolute; top: 128px; }
        .done, .partial, .add { }
        .done { color: darkgreen; background: lightgreen; }
        .partial { color: darkslategray; background: orange; }
        .add { color: black; background: lightgrey; }
        .done a, .partial a, .add a { color: inherit; padding-right: 0.5em; }
        .view_page { background: rgba(0, 0, 0, 0.1); border-radius: 3px; padding: 0em 0.5em; margin: 0.3em; }
        .bold { font-weight: bold; }
        .minor { font-weight: normal; font-size: smaller; }
        .progress { text-align: right; }
        .percent { width: 45px; }
        .stat { font-size: smaller; }
    </style>
</head>
<body class="contribute">
    <header id="mgnavt">
        <h1><a href="//www.mageia.org/">www.mageia.org</a> translation report</h1>
        <ul>
            <li>Please check <a href="https://wiki.mageia.org/en/Internationalisation_Team_(i18n)#Website_translation">localization Wiki page</a> for special cases for navigation and some web pages like <a href="https://wiki.mageia.org/en/Internationalisation_Team_%28i18n%29#Special_cases_of_web_pages">downloads/get, constitution, license...</a></li>
        </ul>
    </header>
    <div id="page">
    <?php
    define('HLANG', TRUE);
    function time_debug($name) {
        static $start_of_microtime = NULL;
        if($start_of_microtime === NULL) {
            $start_of_microtime = microtime(TRUE);

            return array($name, number_format(0, 3), number_format(0, 3));
        }
        static $previus_microtime = NULL;
        if($previus_microtime === NULL) {
            $previus_microtime = $start_of_microtime;
        }
        $current_microtime = microtime(TRUE);

        $array = array($name, number_format($current_microtime - $previus_microtime, 3), number_format($current_microtime - $start_of_microtime, 3));
        $previus_microtime = $current_microtime;

        return $array;
    }
    $times[] = time_debug('start_time');

    /*
    * from http://www.php.net/manual/en/function.array-search.php#91365
    *
    * copyright (c) the PHP Documentation
    * covered by the Creative Commons Attribution 3.0 License (http://creativecommons.org/licenses/by/3.0/legalcode)
    */
    function recursive_array_search($needle, $haystack)
    {
        foreach ($haystack as $key => $value) {
            $current_key = $key;
            if ($needle === $value OR (is_array($value) && recursive_array_search($needle, $value) !== FALSE)) {
                return $current_key;
            }
        }
        return FALSE;
    }

    include 'lib.php';
    $one_language = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : NULL;
    $one_resource  = isset($_GET['r']) ? strip_tags(trim($_GET['r'])) : NULL;

    $one_language_all_resources      = FALSE;
    $all_languages_only_one_resource = FALSE;

    if (isset($one_language) && $one_language != 'all') {
        $one_language_all_resources = TRUE;
        $otherLangs = array('en', $one_language);
    } else {
        $otherLangs = get_other_langs();
    }

    if (isset($one_resource) && $one_resource != 'all') {
        $all_languages_only_one_resource = TRUE;
        $enFiles = array($one_resource);
    } else {
        $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file
    }
    $num_of_enFiles = count($enFiles);


    $report    = array();
    $ok_link   = '<div class="done">%s <a href="%s" title="get a copy of the file">file</a></div>';
    $diff_link = '<div class="partial">%s<a href="diff.php?s=%s&amp;l=%s" title="see detailed diff">';
    $add_trans  = '<div class="add"><a href="missing.php?s=%s&amp;l=%s" class="view_page">add translation</a>%s</div>';

    $unique_lines_in_eng_constitution = array();
    $number_of_unique_lines_in_eng_constitution = 0;

    foreach ($otherLangs as $l) {
        foreach ($enFiles as $f) {
            $references = '';
            $page_not_linked = '';
            $old_page = '';
            $resource = _extract_resource($f);
            $resource_filename = str_replace('index', '', $resource);
            $mga = array('view page' => $resource_filename);
            $langF    = _po_file_switch($f, $l);
            if (strstr($f, '../_nav/langs/en.') !== FALSE) {
                $nav = TRUE;
                $dest_en = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', 'en.pot');
                $dest_l = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', $l . '.po');
                $langF = '../_nav/langs/' . $l . '.po' . (($l == 'en') ? 't' : '');
            } else {
                $nav = FALSE;
                $dest_en = sprintf('%s/%s/%s/%s', G_APP_ROOT, 'en', $resource_filename, 'index.php');
                $dest_l = sprintf('%s/%s/%s/%s', G_APP_ROOT, $l, $resource_filename, 'index.php');
            }

            // if symlink e.g. does directly translated page exist?
            if ((realpath($dest_l) != realpath($dest_en)) && !$nav) {
                $page_not_linked = sprintf('<a href="/%s/%s">old page</a> still exists!', $l, $resource_filename);
                $old_page = sprintf(' by recycling <a href="/%s/%s">old page</a>', $l, $resource_filename);
            }
            $add_new_translation = sprintf($add_trans, $f, $l, $old_page);

            if (file_exists($langF)) {
                $test = _po_diff($l, $resource);
                $num_of_fuzzy_or_missing_strings = count($test['fuzzy_or_missing']);
                $num_of_untranslated_strings = count($test['notrans']);

                if ($nav) {
                    $mga = array('see navigation' => '');
                } else if ($resource_filename == 'downloads/get') {
                    $mga = array(
                        'view page A' => 'downloads/get/index.php?q=Mageia-2-dual-CD.iso&amp;d=1',
                        'B' => 'downloads/get/index.php?q=Non_existing_file&amp;d=1',
                    );
                } else if ($resource_filename == '2') {
                    $mga = array(
                        'view page A' => '2/index.php',
                        'B' => '2/download_index.php',
                        'C' => '2/for-pc/index.php',
                        'D' => '2/for-server/index.php',
                    );
                } else if ($resource_filename == '3') {
                    $mga = array(
                        'view page A' => '3/index.php',
                        'B' => '3/download_index.php',
                        'C' => '3/for-pc/index.php',
                        'D' => '3/for-server/index.php',
                    );
                } else if ($resource_filename == '4') {
                    $mga = array(
                        'view page A' => '4/index.php',
                        'B' => '4/download_index.php',
                    );
                } else if ($resource_filename == 'cauldron') {
                    $mga = array('view page' => '5/download_index.php');
                } else if ($resource_filename == 'documentation') {
                    $mga = array(
                        'view page doc' => 'doc/index.php',
                        'archive' => 'doc/archive.php',
                    );
                } else if ($resource_filename == 'about/constitution') {
                    $constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, $l, $unique_lines_in_eng_constitution);
                    if ($l == 'en') {
                        $unique_lines_in_eng_constitution = $constitution_results['unique_lines_in_constitution'];
                        $number_of_unique_lines_in_eng_constitution = count($unique_lines_in_eng_constitution);
                    }
                    $test['a'] += $number_of_unique_lines_in_eng_constitution; // add aproximate number of lines from constitution to translate
                    $num_of_untranslated_strings += $constitution_results['aproximate_number_of_untranslated_lines'];
                } else if ($resource_filename == 'about/license') {
                    require_once('../en/about/license/license.php');
                    $license_numbers = load_license_numbers($l, TRUE);
                    if ($l == 'en') {
                        $number_of_unique_lines_in_eng_license = $license_numbers["all"];
                    }
                    $test['a'] += $license_numbers["all"]; // add aproximate number of untranslated sentences from license
                    $num_of_untranslated_strings += $license_numbers["untran"]; // add number of all license sentences
                }
                $link = '';
                foreach ($mga as $k => $v) {
                    $link .= sprintf('<a href="/%s/%s" class="view_page">%s</a>', $l, $v, $k);
                }
                $link .= $page_not_linked; // . '</div>';

                if ($num_of_fuzzy_or_missing_strings === 0 && $num_of_untranslated_strings === 0) {
                    $references .= sprintf($ok_link, $link, $langF);
                } else {
                    if(($num_of_fuzzy_or_missing_strings + $num_of_untranslated_strings) < $test['a']) {
                        $references .= sprintf($diff_link, $link, $f, $l);
                        $fuzzy = FALSE;
                        if ($num_of_fuzzy_or_missing_strings > 0) {
                            $references .= $num_of_fuzzy_or_missing_strings . '&nbsp;fuzzy or missing';
                            $fuzzy = TRUE;
                        }
                        if ($num_of_untranslated_strings > 0) {
                            $references .= ($fuzzy ? ', ' : '') . $num_of_untranslated_strings . '&nbsp;untranslated';
                        }
                        $references .= '</a></div>';
                    } else {
                        $references .= $add_new_translation;
                    }
                }
            } else { // file $langF doesn't exists
                $references .= $add_new_translation;
                $test = _po_diff('en', $resource);
                $num_of_fuzzy_or_missing_strings = 0;
                $num_of_untranslated_strings = count($test['notrans']);
                if ($resource_filename == 'about/constitution') { // add aproximate number of all lines from constitution
                    $test['a'] += $number_of_unique_lines_in_eng_constitution;
                    $num_of_untranslated_strings += $number_of_unique_lines_in_eng_constitution;
                }
                if ($resource_filename == 'about/license') { // add number of all license sentences
                    $test['a'] += $number_of_unique_lines_in_eng_license;
                    $num_of_untranslated_strings += $number_of_unique_lines_in_eng_license;
                }
            }
            $report[] = array(
                'language'                        => $l,
                'resource_filename'               => $f,
                'num_of_all_strings'              => $test['a'],
                'num_of_fuzzy_or_missing_strings' => $num_of_fuzzy_or_missing_strings,
                'num_of_untranslated_strings'     => $num_of_untranslated_strings,
                'references'                      => $references,
            );
        }
    }

    $total_num_of_strings = 0; // total of all source strings
    $language_summary = array();
    $resource_summary = array();
    foreach ($report as $resource_data) {
        if ($resource_data['language'] == 'en') {
            $total_num_of_strings += $resource_data['num_of_all_strings'];
        }
        // don't add if there is a need to store languages only for one resource
        if(!$all_languages_only_one_resource || $resource_data['resource_filename'] == $one_resource) {
            $key_exists = recursive_array_search($resource_data['language'], $language_summary); // is language already in the $language_summary array?
            if($resource_data['resource_filename'] == $one_resource) {
                $temp_var[0]['language']                        = $resource_data['language'];
                $temp_var[0]['num_of_all_strings']              = $resource_data['num_of_all_strings'];
                $temp_var[0]['num_of_fuzzy_or_missing_strings'] = $resource_data['num_of_fuzzy_or_missing_strings'];
                $temp_var[0]['num_of_untranslated_strings']     = $resource_data['num_of_untranslated_strings'];
                $temp_var[0]['references']                      = $resource_data['references'];
                $language_summary[] = $temp_var[0];
                unset($temp_var[0]); // clear var
            } else {
                if ($key_exists !== FALSE) {
                    $language_summary[$key_exists]['num_of_all_strings']              += $resource_data['num_of_all_strings'];
                    $language_summary[$key_exists]['num_of_fuzzy_or_missing_strings'] += $resource_data['num_of_fuzzy_or_missing_strings'];
                    $language_summary[$key_exists]['num_of_untranslated_strings']     += $resource_data['num_of_untranslated_strings'];
                } else {
                    if($key_exists === FALSE) {
                        $key_exists = count($language_summary);
                    }
                    $language_summary[$key_exists]['language']                         = $resource_data['language'];
                    $language_summary[$key_exists]['num_of_all_strings']               = $resource_data['num_of_all_strings'];
                    $language_summary[$key_exists]['num_of_fuzzy_or_missing_strings']  = $resource_data['num_of_fuzzy_or_missing_strings'];
                    $language_summary[$key_exists]['num_of_untranslated_strings']      = $resource_data['num_of_untranslated_strings'];
                    $language_summary[$key_exists]['references']                       = $resource_data['references'];
                }
            }
        }

        // don't add if there is a need to store resources only for one language
        if(!$one_language_all_resources || ($resource_data['language'] == $one_language || $resource_data['language'] == 'en')) {
            $key_exists = recursive_array_search($resource_data['resource_filename'], $resource_summary); // is resource already in the $resource_summary array?
            if($resource_data['language'] == 'en') {
                $temp_var[0]['resource_filename']               = $resource_data['resource_filename'];
                $temp_var[0]['num_of_all_strings']              = $resource_data['num_of_all_strings'];
                $temp_var[0]['num_of_fuzzy_or_missing_strings'] = $resource_data['num_of_fuzzy_or_missing_strings'];
                $temp_var[0]['num_of_untranslated_strings']     = $resource_data['num_of_untranslated_strings'];
                $temp_var[0]['references']                      = $resource_data['references'];
                $resource_summary[] = $temp_var[0];
                unset($temp_var[0]); // clear var
            } else {
                if($one_language_all_resources) {
                    if($key_exists === FALSE) {
                        $key_exists = count($resource_summary);
                    }
                    $resource_summary[$key_exists]['num_of_fuzzy_or_missing_strings']  = $resource_data['num_of_fuzzy_or_missing_strings'];
                    $resource_summary[$key_exists]['num_of_untranslated_strings']      = $resource_data['num_of_untranslated_strings'];
                    $resource_summary[$key_exists]['references']                       = $resource_data['references'];
                } else if ($key_exists !== FALSE) {
                    $resource_summary[$key_exists]['num_of_all_strings']              += $resource_data['num_of_all_strings'];
                    $resource_summary[$key_exists]['num_of_fuzzy_or_missing_strings'] += $resource_data['num_of_fuzzy_or_missing_strings'];
                    $resource_summary[$key_exists]['num_of_untranslated_strings']     += $resource_data['num_of_untranslated_strings'];
                }
            }
        }
    }
    foreach ($language_summary as &$single_language_summary) {
        $single_language_summary['num_of_translated_strings'] = 
            $single_language_summary['num_of_all_strings'] -
            $single_language_summary['num_of_fuzzy_or_missing_strings'] -
            $single_language_summary['num_of_untranslated_strings'];
    }
    unset($single_language_summary); // foreach by reference
    foreach ($resource_summary as &$single_resource_summary) {
        $single_resource_summary['num_of_translated_strings'] = 
            $single_resource_summary['num_of_all_strings'] -
            $single_resource_summary['num_of_fuzzy_or_missing_strings'] -
            $single_resource_summary['num_of_untranslated_strings'];
    }
    unset($single_resource_summary); // foreach by reference

    if ($one_language_all_resources) {
        $report_text     = '<p>Restore <a href="?l=all" title="see all languages">all languages</a>.</p>';
        $count           = 'One language: ' . $langs[$one_language];
        $summary_text    = 'Summary for each of ' . $num_of_enFiles . ' resources';
        $display_array   = $resource_summary;
        $progress        = 'References</th><th>Progress';
        $stats_width     = '55px';
    } else if ($all_languages_only_one_resource) {
        $report_text     = '<p>Restore <a href="?r=all" title="see all resources">all resources</a>.</p>';
        $count           = 'Together ' . count($otherLangs) . ' languages';
        $summary_text    = 'Summary for resource: ' . $one_resource;
        $eng_language    = array_shift($language_summary); // shift English for proper sorting
        $display_array   = $language_summary;
        $stats_width     = '60px';
        $progress        = 'References</th><th>Progress';
    } else { // all languages, all resources
        $report_text     = ''; // <p>Overview of all languages.</p>
        $count           = 'Together ' . count($otherLangs) . ' languages';
        $summary_text    = 'Summary for all ' . $num_of_enFiles . ' resources';
        $eng_language    = array_shift($language_summary); // shift English for proper sorting
        $display_array   = $language_summary;
        $sum_for_stat    = $total_num_of_strings;
        $stats_width     = '70px';
        $references      = '';
        $progress        = 'Progress';
    }

    // build helper arrays
    foreach ($display_array as $key => $row) {
        if ($one_language_all_resources) {
            $first_helper[$key]  = $row['num_of_translated_strings'] / $row['num_of_all_strings'];
            $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $row['num_of_all_strings'];
            $third_helper[$key]  = $row['resource_filename'];
        } else if ($all_languages_only_one_resource) {
            $first_helper[$key]  = $row['num_of_translated_strings'] / $row['num_of_all_strings'];
            $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $row['num_of_all_strings'];
            $third_helper[$key]  = $row['language'];
        } else { // all languages, all resources
            $first_helper[$key]  = $row['num_of_translated_strings'] / $total_num_of_strings;
            $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $total_num_of_strings;
            $third_helper[$key]  = $row['language'];
        }
    }
    array_multisort($first_helper, SORT_DESC, $second_helper, $third_helper, $display_array); // , SORT_STRING
//    array_unshift($language_summary, $eng_language); // unshift English back
    $table_lines = array();
    $progress_width = 350;
    foreach ($display_array as $one_member) {
        $translation_status  =  'translated: ' . $one_member['num_of_translated_strings'];
        $translation_status .=  ', fuzzy or missing: ' .  $one_member['num_of_fuzzy_or_missing_strings'];
        if ($one_language_all_resources) {
            $first_clmn      = $one_member['resource_filename'];
            $link_one        = '<a href="?r=' . $first_clmn . '" title="%s">';
            if ($first_clmn == '../_nav/langs/en.pot') {
                $frst_clmn_t = '_nav/langs/en.pot';
            } else {
                $frst_clmn_t = str_replace('en/', '', $first_clmn);
            }
            $first_clm_text  = sprintf('<span class="bold">' . $link_one . '%s</a></span>', 'see this resource only', $frst_clmn_t);
            $single_stat     = $one_member['num_of_translated_strings'];
            $sum_for_stat    = $one_member['num_of_all_strings'];
            $references      = '<td>' . $one_member['references'] . '</td>';
        } else if ($all_languages_only_one_resource) {
            $first_clmn      = $one_member['language'];
            $link_one        = '<a href="?l=' . $first_clmn . '" title="%s">';
            $first_clm_text  = sprintf('<span class="bold">' . $link_one . '%s</a></span>, ', 'see this language only', $langs[$first_clmn]);
            $single_stat     = $one_member['num_of_translated_strings'];
            $sum_for_stat    = $one_member['num_of_all_strings'];
            $references      = '<td>' . $one_member['references'] . '</td>';
        } else { // all languages, all resources
            $first_clmn      = $one_member['language'];
            $link_one        = '<a href="?l=' . $first_clmn . '" title="%s">';
            $first_clm_text  = sprintf('<span class="bold">' . $link_one . '%s</a></span>, ', 'see this language only', $langs[$first_clmn]);
            $first_clm_text .= sprintf('<span class="minor">%s</span>', $first_clmn);
            $single_stat     = $one_member['num_of_translated_strings'];
        }
        $progress_tran_float = $one_member['num_of_translated_strings'] / $sum_for_stat;
        $progress_trans      = floor($progress_tran_float * 100);
        $progress_tran_round = floor($progress_tran_float * $progress_width);
        $progress_fom_float  = $one_member['num_of_fuzzy_or_missing_strings'] / $sum_for_stat;
        $progress_fom_round  = round($progress_fom_float * $progress_width);
        $progress_untrans    = $progress_width - $progress_tran_round - $progress_fom_round;


        $row                 = '<tr><td>' . $first_clm_text . '</td>';
        $row                .= $references;
        $row                .= '<td class="progress"><div class="percent">' . $progress_trans . ' %</div>';
        $row                .= '<div class="stat" style="width: ' . $stats_width . ';"> (' . $single_stat . ' / ' . $sum_for_stat . ')</div></td>';
        $row                .= sprintf('<td>' . $link_one, $translation_status);
        $row                .= '<div style="width: ' . $progress_tran_round . 'px; background-color: LightGreen;">&nbsp;</div>' . PHP_EOL;
        $row                .= '<div style="width: ' . $progress_fom_round . 'px; background-color: Orange;">&nbsp;</div>' . PHP_EOL;
        $row                .= '<div style="width: ' . $progress_untrans . 'px; background-color: OrangeRed;">&nbsp;</div>' . PHP_EOL;
        $row                .= '</a></td></tr>' . PHP_EOL;
        $table_lines[]       = $row;
    }
    $table_rows = implode('', $table_lines);

    echo $report_text;

    echo <<<S
<table>
<thead><tr>
    <th>{$count}</th>
    <th>{$progress}</th>
    <th>{$summary_text}</th>
</tr></thead>
<tbody>
{$table_rows}
</tbody>
</table>

<hr>
S;

/* START OF DEBUG LINES */
$times[] = time_debug('end_time');

$sum = 0;
$read_license_from_vcs_ = array();
$_diff_ = array();
foreach ($times as $time) {
    if($time[1] >= 0.01) {
        $snails[] = array($time[0], $time[1]);
        $sum += $time[1];
        $pos = strpos($time[0], 'read_license_from_vcs');
        if ($pos !== FALSE) {
            $read_license_from_vcs_[] = array($time[0], $time[1]);
        }
        $pos = strpos($time[0], '_diff');
        if ($pos !== FALSE) {
            $_diff_[] = array($time[0], $time[1]);
        }
    }
    if ($time[0] == 'end_time') {
        $end = $time[2];
    }
}

$snails_time = 0;
$read_license_from_vcs_time = array();
$mognas_f_time = array();
$_diff_time = array();
foreach ($read_license_from_vcs_ as $part) {
    $read_license_from_vcs_time[] = $part[1];
}
$snails_time += $read_license_from_vcs_time_sum = array_sum($read_license_from_vcs_time);

foreach ($_diff_ as $part) {
    $_diff_time[] = $part[1];
}
$snails_time += $_diff_time_sum = array_sum($_diff_time);

if (FALSE) {
    // read_license_from_vcs, mognas_f, _diff

    //var_export($read_license_from_vcs_) . '</br>' . PHP_EOL;
    //var_export($_diff_) . '</br>' . PHP_EOL;
    echo '<pre>' . PHP_EOL;

    echo  '</br>' .'$one_language_all_resources: ';
    var_export($one_language_all_resources) . '</br>' . PHP_EOL;

    echo  '</br>' .'$all_languages_only_one_resource: ';
    var_export($all_languages_only_one_resource) . '</br>' . PHP_EOL;

    echo  '</br>' .'$report: ';
    var_export($report) . '</br>' . PHP_EOL;

    echo  '</br>' .'$total_num_of_strings: ';
    var_export($total_num_of_strings) . '</br>' . PHP_EOL;

    echo  '</br>' .'$language_summary: ';
    var_export($language_summary) . '</br>' . PHP_EOL;

    echo  '</br>' .'$resource_summary: ';
    var_export($resource_summary) . '</br>' . PHP_EOL;

    echo  '</br>' .'rlv: ';
    var_export($read_license_from_vcs_time_sum) . '</br>' . PHP_EOL;
    echo  '</br>' .'dif: ';
    var_export($_diff_time_sum) . '</br>' . PHP_EOL;
    echo  '</br>' .'Sst: ';
    var_export($snails_time) . '</br>' . PHP_EOL;
    echo  '</br>' .'sum: ';
    var_export($sum) . '</br>' . PHP_EOL;
    echo  '</br>' .'end: ';
    var_export($end) . '</br>' . PHP_EOL;
    echo  '</br>' .'rel: ' . number_format(100 * $sum/$end, 1) . ' %</br>' . PHP_EOL;
    /*echo  '</br>' .'snails: ' . PHP_EOL;
    var_export($snails) . PHP_EOL;
    echo 'times: ' . PHP_EOL;
    var_export($times) . PHP_EOL; /**/
    echo '</pre>' . PHP_EOL;
/* END OF DEBUG LINES */
}
?>
    </div>
    <script src="/_nav/js/source.js"></script>
</body>
</html><?php

// regenerating cache
// TODO move it to the cron
require_once('../en/about/license/license.php');
foreach ($otherLangs as $lang) {
    load_license_numbers($lang);
}