diff options
author | emkael <emkael@tlen.pl> | 2018-01-29 23:45:36 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-01-29 23:45:36 +0100 |
commit | b063e5df09c75d32f88d9c61590f0060037ff43b (patch) | |
tree | 0314a049fdbdc513ac6ae2871d0b4fd51535e0d9 /tdd-bootstrap.php | |
parent | 4031d439708b38d4e431242f3fbf5d18bbcbfa16 (diff) |
Adding some structure to the protocol table rows, prepending table header even if the layout is hidden
Diffstat (limited to 'tdd-bootstrap.php')
-rw-r--r-- | tdd-bootstrap.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tdd-bootstrap.php b/tdd-bootstrap.php index 2af5ac1..9d7998d 100644 --- a/tdd-bootstrap.php +++ b/tdd-bootstrap.php @@ -41,18 +41,19 @@ class Protocol { $contract2 = trim(str_replace(' ', '', $tr->next_sibling()->find('td[class="bdc"]', 0)->innertext)); $score2 = trim(str_replace(' ', '', end($tr->next_sibling()->find('td'))->innertext)); + $deal = $this->deals_by_tables[$table]; + $insert = "<a href=\"#table-$table\"><h4 id=\"table-$table\">Stół $table – Rozdanie {$deal->deal_num}</h4></a>"; // if is played on both tables of a match // note that the contract field for arbitral scores starts with 'A' (e.g. 'ARB' or 'AAA') if(($score1 !== '' || strpos($contract1, 'A') === 0) && ($score2 !== '' || strpos($contract2, 'A') === 0)) { - $deal = $this->deals_by_tables[$table]; - $insert = "<a href=\"#table-$table\"><h4 id=\"table-$table\">Stół $table – Rozdanie {$deal->deal_num}</h4></a>" . $deal->html(); + $insert .= $deal->html(); $modified = 1; } else { - $insert = '<p>...</p>'; + $insert .= '<p>...</p>'; } - $tr->outertext = '<tr><td colspan="7" style="border-bottom:1px solid #006;padding-top:30px;">' . $insert . '</td></tr>' . $tr->outertext; + $tr->outertext = '<tr class="tdd-header"><td colspan="7" style="border-bottom:1px solid #006;padding-top:30px;">' . $insert . '</td></tr>' . $tr->outertext; } $tr = @$tr->next_sibling(); } |