From b063e5df09c75d32f88d9c61590f0060037ff43b Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 29 Jan 2018 23:45:36 +0100 Subject: Adding some structure to the protocol table rows, prepending table header even if the layout is hidden --- tdd-bootstrap.php | 9 +++++---- 1 file 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 = "

Stół $table – Rozdanie {$deal->deal_num}

"; // 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 = "

Stół $table – Rozdanie {$deal->deal_num}

" . $deal->html(); + $insert .= $deal->html(); $modified = 1; } else { - $insert = '

...

'; + $insert .= '

...

'; } - $tr->outertext = '' . $insert . '' . $tr->outertext; + $tr->outertext = '' . $insert . '' . $tr->outertext; } $tr = @$tr->next_sibling(); } -- cgit v1.2.3