composer package updates
[openemr.git] / vendor / mpdf / mpdf / src / Tag / A.php
blob6a6488b1d09b09d3aa141ea72ff2998a3d14359b
1 <?php
3 namespace Mpdf\Tag;
5 class A extends Tag
8 public function open($attr, &$ahtml, &$ihtml)
10 if (isset($attr['NAME']) && $attr['NAME'] != '') {
11 $e = '';
12 /* -- BOOKMARKS -- */
13 if ($this->mpdf->anchor2Bookmark) {
14 $objattr = [];
15 $objattr['CONTENT'] = htmlspecialchars_decode($attr['NAME'], ENT_QUOTES);
16 $objattr['type'] = 'bookmark';
17 if (!empty($attr['LEVEL'])) {
18 $objattr['bklevel'] = $attr['LEVEL'];
19 } else {
20 $objattr['bklevel'] = 0;
22 $e = "\xbb\xa4\xactype=bookmark,objattr=" . serialize($objattr) . "\xbb\xa4\xac";
24 /* -- END BOOKMARKS -- */
25 if ($this->mpdf->tableLevel) { // *TABLES*
26 $this->mpdf->_saveCellTextBuffer($e, '', $attr['NAME']); // *TABLES*
27 } // *TABLES*
28 else { // *TABLES*
29 $this->mpdf->_saveTextBuffer($e, '', $attr['NAME']); //an internal link (adds a space for recognition)
30 } // *TABLES*
32 if (isset($attr['HREF'])) {
33 $this->mpdf->InlineProperties['A'] = $this->mpdf->saveInlineProperties();
34 $properties = $this->cssManager->MergeCSS('INLINE', 'A', $attr);
35 if (!empty($properties)) {
36 $this->mpdf->setCSS($properties, 'INLINE');
38 $this->mpdf->HREF = $attr['HREF']; // mPDF 5.7.4 URLs
42 public function close(&$ahtml, &$ihtml)
44 $this->mpdf->HREF = '';
45 if (isset($this->mpdf->InlineProperties['A'])) {
46 $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties['A']);
48 unset($this->mpdf->InlineProperties['A']);