summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-01-29 23:45:36 +0100
committeremkael <emkael@tlen.pl>2018-01-29 23:45:36 +0100
commitb063e5df09c75d32f88d9c61590f0060037ff43b (patch)
tree0314a049fdbdc513ac6ae2871d0b4fd51535e0d9
parent4031d439708b38d4e431242f3fbf5d18bbcbfa16 (diff)
Adding some structure to the protocol table rows, prepending table header even if the layout is hidden
-rw-r--r--tdd-bootstrap.php9
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('&nbsp;', '', $tr->next_sibling()->find('td[class="bdc"]', 0)->innertext));
$score2 = trim(str_replace('&nbsp;', '', end($tr->next_sibling()->find('td'))->innertext));
+ $deal = $this->deals_by_tables[$table];
+ $insert = "<a href=\"#table-$table\"><h4 id=\"table-$table\">Stół $table &ndash; 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 &ndash; 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();
}