removed temp. development settings, increased constraints for 'change rules', managem...
[brisk.git] / web / briskin5 / Obj / rules.phh
1 <?php
2 /*
3  *  brisk - rules.phh
4  *
5  *  Copyright (C) 2017 Matteo Nastasi
6  *                          mailto: nastasi@alternativeoutput.it
7  *                                  matteo.nastasi@milug.org
8  *                          web: http://www.alternativeoutput.it
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details. You should have received a
19  * copy of the GNU General Public License along with this program; if
20  * not, write to the Free Software Foundation, Inc, 59 Temple Place -
21  * Suite 330, Boston, MA 02111-1307, USA.
22  *
23  */
24
25 define('BIN5_TOURNAMENT_OLDRULES', 1);
26 define('BIN5_TOURNAMENT_NO_DRAW',  2);
27 define('BIN5_TOURNAMENT_TOGETHER17',  4);
28
29 define('BIN5_RULES_OLDSCHEMA', -1);
30 define('BIN5_RULES_FINISH',     0);
31 define('BIN5_RULES_ABANDON',    1);
32 define('BIN5_RULES_ALLPASS',    2);
33 define('BIN5_RULES_ASTA',       3);
34 define('BIN5_RULES_NEXTAUCT',   4);
35 define('BIN5_RULES_CHECKCHOOSE',5);
36
37 require_once("rules_base.phh");
38 require_once("rules_old_rules.phh");
39 require_once("rules_no_draw.phh");
40 require_once("rules_together17.phh");
41
42 // FIXME - DYNAMIC WITH CACHE AND RELOAD FROM DB
43 function rules_keys()
44 {
45     return array(1,2,4);
46 }
47
48 function rules_id2name($id)
49 {
50     if ($id == 1)
51         return 'Rules_old_rules';
52     else if ($id == 2)
53         return 'Rules_no_draw';
54     else if ($id == 4)
55         return 'Rules_together17';
56
57     return 'Rules_unknown';
58 }
59
60 function rules_id2descr($id)
61 {
62     if ($id == 1)
63         return 'regole vecchie con pareggio';
64     else if ($id == 2)
65         return 'regole nuove senza pareggio';
66     else if ($id == 4)
67         return 'regole del torneo "insieme per gioco"';
68
69     return 'Regole sconosciute';
70 }
71
72 ?>