1<?php
2
3namespace Mpdf\Tag;
4
5// TODO: Extend THEAD instead?
6
7class TFoot extends Tag
8{
9
10	public function open($attr, &$ahtml, &$ihtml)
11	{
12		$this->mpdf->lastoptionaltag = 'TFOOT'; // Save current HTML specified optional endtag
13		$this->cssManager->tbCSSlvl++;
14		$this->mpdf->tabletfoot = 1;
15		$this->mpdf->tablethead = 0;
16		$properties = $this->cssManager->MergeCSS('TABLE', 'TFOOT', $attr);
17		if (isset($properties['FONT-WEIGHT'])) {
18			$this->mpdf->tfoot_font_weight = '';
19			if (strtoupper($properties['FONT-WEIGHT']) === 'BOLD') {
20				$this->mpdf->tfoot_font_weight = 'B';
21			}
22		}
23
24		if (isset($properties['FONT-STYLE'])) {
25			$this->mpdf->tfoot_font_style = '';
26			if (strtoupper($properties['FONT-STYLE']) === 'ITALIC') {
27				$this->mpdf->tfoot_font_style = 'I';
28			}
29		}
30		if (isset($properties['FONT-VARIANT'])) {
31			$this->mpdf->tfoot_font_smCaps = '';
32			if (strtoupper($properties['FONT-VARIANT']) === 'SMALL-CAPS') {
33				$this->mpdf->tfoot_font_smCaps = 'S';
34			}
35		}
36
37		if (isset($properties['VERTICAL-ALIGN'])) {
38			$this->mpdf->tfoot_valign_default = $properties['VERTICAL-ALIGN'];
39		}
40		if (isset($properties['TEXT-ALIGN'])) {
41			$this->mpdf->tfoot_textalign_default = $properties['TEXT-ALIGN'];
42		}
43	}
44
45	public function close(&$ahtml, &$ihtml)
46	{
47		$this->mpdf->lastoptionaltag = '';
48		unset($this->cssManager->tablecascadeCSS[$this->cssManager->tbCSSlvl]);
49		$this->cssManager->tbCSSlvl--;
50		$this->mpdf->tabletfoot = 0;
51		$this->mpdf->ResetStyles();
52		$this->mpdf->tfoot_font_weight = '';
53		$this->mpdf->tfoot_font_style = '';
54		$this->mpdf->tfoot_font_smCaps = '';
55
56		$this->mpdf->tfoot_valign_default = '';
57		$this->mpdf->tfoot_textalign_default = '';
58	}
59}
60