enabled deck select at table preferences
[brisk.git] / web / briskin5 / Obj / briskin5.phh
index 72bd500..0bbd9d9 100644 (file)
@@ -68,6 +68,23 @@ $mlang_bin5_bin5 = array(
 $table_wellarr = Array( 'it' => Array ( 'Benvenuto al tavolo. Se almeno tre giocatori non sbloccano l\'uscita cliccando il lucchetto, chi esce non può risedersi a un qualunque tavolo per '.floor(BAN_TIME/60).' minuti.'),
                         'en' => Array ( 'EN Benvenuto al tavolo. Se almeno tre giocatori non sbloccano l\'uscita cliccando il lucchetto, chi esce non può risedersi a un qualunque tavolo per '.floor(BAN_TIME/60).' minuti.') );
 
+
+// FIXME - DYNAMIC WITH CACHE AND RELOAD FROM DB
+function deck_keys()
+{
+    return array('xx', 'yy');
+}
+
+function deck_id2descr($id, $lang)
+{
+    if ($id == 'xx')
+        return 'carte originali';
+    else if ($id == 'yy')
+        return 'carte strette';
+
+    return 'carte sconosciute';
+}
+
 function multoval($mult)
 {
     GLOBAL $G_lang;
@@ -96,6 +113,20 @@ function dom_select_rules()
     echo "$ret";
 }
 
+function dom_select_deck($cur_sel)
+{
+    GLOBAL $G_lang;
+
+    $ret = "<select id='select_deck'>\n";
+    foreach (deck_keys() as $key) {
+        $value = deck_id2descr($key, $G_lang);
+        $ret .= sprintf("<option value='%s'%s>%s</option>\n", $key, ($key == $cur_sel ? " selected='selected'" : ""), $value);
+    }
+    $ret .= "</select>\n";
+
+    echo "$ret";
+}
+
 class Card {
     var $value; /* 0 - 39 card value */
     var $stat;  /* 'bunch', 'hand', 'table', 'take' */