summaryrefslogtreecommitdiffstats
path: root/include/output.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2010-09-21 20:27:12 -0700
committerArun Persaud <arun@nubati.net>2010-09-21 20:32:39 -0700
commitf94dd2d6d58f37306d1da0f6bb12f5276883cd6b (patch)
tree434c01c1050581a3241690e5d72197009363cef0 /include/output.php
parent615fb7c0fec9ec6f187a3c568cf1e2e6c1572b1e (diff)
downloade-DoKo-f94dd2d6d58f37306d1da0f6bb12f5276883cd6b.tar.gz
e-DoKo-f94dd2d6d58f37306d1da0f6bb12f5276883cd6b.tar.bz2
e-DoKo-f94dd2d6d58f37306d1da0f6bb12f5276883cd6b.zip
NEW FEATURE: pre select card to play if there is only one option
Diffstat (limited to 'include/output.php')
-rw-r--r--include/output.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/output.php b/include/output.php
index 3ad0552..0c2ff96 100644
--- a/include/output.php
+++ b/include/output.php
@@ -202,12 +202,15 @@ function display_card($card,$dir="english")
return;
}
-function display_link_card($card,$dir="english",$type="card")
+function display_link_card($card,$dir="english",$type="card", $selected=0)
{
+ if($selected)
+ $selected = 'selected="selected"';
+
if( $card/2 - (int)($card/2) == 0.5)
- echo "<div class=\"cardinput\"><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" /><img src=\"cards/".$dir."/".$card.".png\" alt=\"".DB_get_card_name($card)."\" /></div>\n";
+ echo "<div class=\"cardinput\"><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" $selected /><img src=\"cards/".$dir."/".$card.".png\" alt=\"".DB_get_card_name($card)."\" /></div>\n";
else
- echo "<div class=\"cardinput\" ><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" /><img src=\"cards/".$dir."/".($card-1).".png\" alt=\"".DB_get_card_name($card-1)."\" /></div>\n";
+ echo "<div class=\"cardinput\" ><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" $selected /><img src=\"cards/".$dir."/".($card-1).".png\" alt=\"".DB_get_card_name($card-1)."\" /></div>\n";
return;
}