function dom_select_rules()
{
+ GLOBAL $G_lang;
+
$ret = "<select id='select_rules'>\n";
foreach (rules_keys() as $key) {
- $value = rules_id2descr($key);
+ $value = rules_id2descr($key, $G_lang);
$ret .= sprintf("<option value='%d'>%s</option>\n", $key, $value);
}
$ret .= "</select>\n";
function spawn(&$from)
{
+ GLOBAL $G_lang;
if (($thiz =& new Bin5_table()) == FALSE)
return (FALSE);
function rules_change(&$bri, $user, $rules_id_s)
{
+ GLOBAL $G_lang;
+
//
// Rules: update version following loaded tcode
//
if ($i < BIN5_PLAYERS_N) {
// FIXME_LANG
$msg = sprintf("<b>L'utente <i>%s</i> voleva giĆ usare le %s.</b>",
- xcape($user_cur->name), xcape(rules_id2descr($user_cur->rules_get())));
+ xcape($user_cur->name), xcape(rules_id2descr($user_cur->rules_get(), $G_lang)));
break;
}
if ($rules_tot < BIN5_PLAYERS_N) {
// FIXME_LANG
$msg = sprintf("<b>L'utente <i>%s</i> vorrebbe usare le %s.</b>",
- xcape($user->name), xcape(rules_id2descr($rules_id)));
+ xcape($user->name), xcape(rules_id2descr($rules_id, $G_lang)));
break;
}
// TAG: POINTS_MANAGEMENT
$pnt_min = $table->points_n - MAX_POINTS < 0 ? 0 : $table->points_n - MAX_POINTS;
- $noty = sprintf('<p>%s.</p>\n', xcape(ucfirst(rules_id2descr($table->rules->id_get()))));
+ $noty = sprintf('<p>%s.</p>\n', xcape(ucfirst(rules_id2descr($table->rules->id_get(), $G_lang))));
$noty .= sprintf('<table class=\"points\"><tr><th></th>');
// Names.
return 'Rules_unknown';
}
-function rules_id2descr($id)
+function rules_id2descr($id, $lang)
{
if ($id == 1)
- return 'regole vecchie con pareggio';
+ return 'regole vecchie (con pareggio)';
else if ($id == 2)
- return 'regole nuove senza pareggio';
+ return 'regole nuove (senza pareggio)';
else if ($id == 4)
return 'regole del torneo "insieme per gioco"';
// SYNC WITH bin5_tournaments table
$mlang_stat_day = array(
- 'old rules: with draw'=> array( 'it' => 'Partite vecchie (con il pareggio)',
- 'en' => 'Old matches (with draw)' ),
-
- 'new rules: without draw' => array( 'it' => 'Partite nuove (senza pareggio)',
- 'en' => 'New matches (without draw)'),
-
- 'special match' => array( 'it' => 'Partite speciali',
- 'en' => 'Special matches'),
-
'info_total'=> array( 'it' => 'totali',
'en' => 'En totali')
);
if ($tmt_n == 0)
continue;
- if (!isset($mlang_stat_day[$trn_obj->name][$G_lang])) {
- log_crit("stat-day: tournament name not found in array");
- break;
- }
- printf("[Tournament [%s]], number of matches: %d\n", $mlang_stat_day[$trn_obj->name][$G_lang], $tmt_n);
- fprintf($fpexp, "<h2 style=\"padding: 8px; background-color: pink;\">%s</h2>", $mlang_stat_day[$trn_obj->name][$G_lang]);
+ printf("[Tournament [%s]], number of matches: %d\n", rules_id2descr($trn_obj->code, $G_lang), $tmt_n);
+ fprintf($fpexp, "<h2 style=\"padding: 8px; background-color: pink;\">%s</h2>", xcape(ucfirst(rules_id2descr($trn_obj->code, $G_lang))));
// loop on matches
for ($m = 0 ; $m < $tmt_n ; $m++) {