typo fixed
[brisk.git] / web / briskin5 / Obj / briskin5.phh
index 72bd500..bae5ff0 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' */
@@ -1919,7 +1950,7 @@ function briscola_show($bri, $table, $user)
 
     $ret .= sprintf('$("caller").style.backgroundImage = \'url("img/brisk_caller_sand%d.png")\';',
                     $table->asta_win);
-    $ret .= sprintf('$("callerimg").src = "img/%02d.png";', $table->briscola);
+    $ret .= sprintf('$("callerimg").setAttribute("data-card-id", "%02d"); ', $table->briscola);
     $ret .= sprintf('$("caller").style.visibility = "visible";');
     $ret .= sprintf('$("chooseed").style.visibility = "hidden";');
     $ret .= sprintf('$("astalascio").style.visibility = "";');