1<?php
2
3namespace Mpdf\Tag;
4
5class TocEntry extends Tag
6{
7
8	public function open($attr, &$ahtml, &$ihtml)
9	{
10		if (!empty($attr['CONTENT'])) {
11			$objattr = [];
12			$objattr['CONTENT'] = htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES);
13			$objattr['type'] = 'toc';
14			$objattr['vertical-align'] = 'T';
15			if (!empty($attr['LEVEL'])) {
16				$objattr['toclevel'] = $attr['LEVEL'];
17			} else {
18				$objattr['toclevel'] = 0;
19			}
20			if (!empty($attr['NAME'])) {
21				$objattr['toc_id'] = $attr['NAME'];
22			} else {
23				$objattr['toc_id'] = 0;
24			}
25			$e = "\xbb\xa4\xactype=toc,objattr=" . serialize($objattr) . "\xbb\xa4\xac";
26			if ($this->mpdf->tableLevel) {
27				$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = [$e];
28			} // *TABLES*
29			else { // *TABLES*
30				$this->mpdf->textbuffer[] = [$e];
31			} // *TABLES*
32		}
33	}
34
35	public function close(&$ahtml, &$ihtml)
36	{
37	}
38}
39