PluginProbe
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin / 1.7.1
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin v1.7.1
trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 All 71 releases
← All changes | mpdf/classes/tocontents.php +10 -51 1.9.0 → 1.7.1 View file →
@@ -26,11 +26,8 @@
26 26 var $TOC_even_header_value;
27 27 var $TOC_odd_footer_value;
28 28 var $TOC_even_footer_value;
29 29 var $TOC_page_selector;
30 -var $TOC_resetpagenum; // mPDF 6
31 -var $TOC_pagenumstyle; // mPDF 6
32 -var $TOC_suppress; // mPDF 6
33 30 var $m_TOC;
34 31
35 32 function tocontents(&$mpdf) {
36 33 $this->mpdf = $mpdf;
@@ -38,9 +35,9 @@
38 35 $this->TOCmark = 0;
39 36 $this->m_TOC=array();
40 37 }
41 38
42 -function TOCpagebreak($tocfont='', $tocfontsize='', $tocindent='', $TOCusePaging=true, $TOCuseLinking='', $toc_orientation='', $toc_mgl='',$toc_mgr='',$toc_mgt='',$toc_mgb='',$toc_mgh='',$toc_mgf='',$toc_ohname='',$toc_ehname='',$toc_ofname='',$toc_efname='',$toc_ohvalue=0,$toc_ehvalue=0,$toc_ofvalue=0, $toc_efvalue=0, $toc_preHTML='', $toc_postHTML='', $toc_bookmarkText='', $resetpagenum='', $pagenumstyle='', $suppress='', $orientation='', $mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf='',$ohname='',$ehname='',$ofname='',$efname='',$ohvalue=0,$ehvalue=0,$ofvalue=0,$efvalue=0, $toc_id=0, $pagesel='', $toc_pagesel='', $sheetsize='', $toc_sheetsize='', $tocoutdent='', $toc_resetpagenum='', $toc_pagenumstyle='', $toc_suppress='') { // mPDF 5.6.19 // mPDF 6
39 +function TOCpagebreak($tocfont='', $tocfontsize='', $tocindent='', $TOCusePaging=true, $TOCuseLinking='', $toc_orientation='', $toc_mgl='',$toc_mgr='',$toc_mgt='',$toc_mgb='',$toc_mgh='',$toc_mgf='',$toc_ohname='',$toc_ehname='',$toc_ofname='',$toc_efname='',$toc_ohvalue=0,$toc_ehvalue=0,$toc_ofvalue=0, $toc_efvalue=0, $toc_preHTML='', $toc_postHTML='', $toc_bookmarkText='', $resetpagenum='', $pagenumstyle='', $suppress='', $orientation='', $mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf='',$ohname='',$ehname='',$ofname='',$efname='',$ohvalue=0,$ehvalue=0,$ofvalue=0,$efvalue=0, $toc_id=0, $pagesel='', $toc_pagesel='', $sheetsize='', $toc_sheetsize='', $tocoutdent='') { // mPDF 5.6.19
43 40 if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
44 41 else if (!$toc_id) { $toc_id = 0; }
45 42 else { $toc_id = strtolower($toc_id); }
46 43
@@ -72,11 +69,8 @@
72 69 $this->m_TOC[$toc_id]['TOC_even_header_value'] = $toc_ehvalue;
73 70 $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = $toc_ofvalue;
74 71 $this->m_TOC[$toc_id]['TOC_even_footer_value'] = $toc_efvalue;
75 72 $this->m_TOC[$toc_id]['TOC_page_selector'] = $toc_pagesel;
76 - $this->m_TOC[$toc_id]['TOC_resetpagenum'] = $toc_resetpagenum; // mPDF 6
77 - $this->m_TOC[$toc_id]['TOC_pagenumstyle'] = $toc_pagenumstyle; // mPDF 6
78 - $this->m_TOC[$toc_id]['TOC_suppress'] = $toc_suppress; // mPDF 6
79 73 $this->m_TOC[$toc_id]['TOCsheetsize'] = $toc_sheetsize;
80 74 }
81 75 else {
82 76 $this->TOCmark = $this->mpdf->page;
@@ -103,17 +97,14 @@
103 97 $this->TOC_even_header_value = $toc_ehvalue;
104 98 $this->TOC_odd_footer_value = $toc_ofvalue;
105 99 $this->TOC_even_footer_value = $toc_efvalue;
106 100 $this->TOC_page_selector = $toc_pagesel;
107 - $this->TOC_resetpagenum = $toc_resetpagenum; // mPDF 6
108 - $this->TOC_pagenumstyle = $toc_pagenumstyle; // mPDF 6
109 - $this->TOC_suppress = $toc_suppress; // mPDF 6
110 101 $this->TOCsheetsize = $toc_sheetsize;
111 102 }
112 103 }
113 104
114 105 // Initiate, and Mark a place for the Table of Contents to be inserted
115 -function TOC($tocfont='', $tocfontsize=0, $tocindent=0, $resetpagenum='', $pagenumstyle='', $suppress='', $toc_orientation='', $TOCusePaging=true, $TOCuseLinking=false, $toc_id=0, $tocoutdent='', $toc_resetpagenum='', $toc_pagenumstyle='', $toc_suppress='') { // mPDF 5.6.19 // mPDF 6
106 +function TOC($tocfont='', $tocfontsize=0, $tocindent=0, $resetpagenum='', $pagenumstyle='', $suppress='', $toc_orientation='', $TOCusePaging=true, $TOCuseLinking=false, $toc_id=0, $tocoutdent='') { // mPDF 5.6.19) {
116 107 if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
117 108 else if (!$toc_id) { $toc_id = 0; }
118 109 else { $toc_id = strtolower($toc_id); }
119 110 // To use odd and even pages
@@ -132,11 +123,8 @@
132 123 $this->m_TOC[$toc_id]['TOCoutdent'] = $tocoutdent;
133 124 $this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
134 125 $this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
135 126 $this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
136 - $this->m_TOC[$toc_id]['TOC_resetpagenum'] = $toc_resetpagenum; // mPDF 6
137 - $this->m_TOC[$toc_id]['TOC_pagenumstyle'] = $toc_pagenumstyle; // mPDF 6
138 - $this->m_TOC[$toc_id]['TOC_suppress'] = $toc_suppress; // mPDF 6
139 127 }
140 128 else {
141 129 $this->TOCmark = $this->mpdf->page;
142 130 $this->TOCoutdent = $tocoutdent;
@@ -142,11 +130,8 @@
142 130 $this->TOCoutdent = $tocoutdent;
143 131 $this->TOCorientation = $toc_orientation;
144 132 $this->TOCuseLinking = $TOCuseLinking;
145 133 $this->TOCusePaging = $TOCusePaging;
146 - $this->TOC_resetpagenum = $toc_resetpagenum; // mPDF 6
147 - $this->TOC_pagenumstyle = $toc_pagenumstyle; // mPDF 6
148 - $this->TOC_suppress = $toc_suppress; // mPDF 6
149 134 }
150 135 }
151 136
152 137
@@ -192,12 +177,9 @@
192 177 $toc_ehvalue = $this->TOC_even_header_value;
193 178 $toc_ofvalue = $this->TOC_odd_footer_value;
194 179 $toc_efvalue = $this->TOC_even_footer_value;
195 180 $toc_page_selector = $this->TOC_page_selector;
196 - $toc_resetpagenum = $this->TOC_resetpagenum; // mPDF 6
197 - $toc_pagenumstyle = $this->TOC_pagenumstyle; // mPDF 6
198 - $toc_suppress = $this->TOC_suppress; // mPDF 6
199 - $toc_sheet_size = (isset($this->TOCsheetsize) ? $this->TOCsheetsize : '');
181 + $toc_sheet_size = $this->TOCsheetsize;
200 182 }
201 183 else {
202 184 $arr = current($this->m_TOC);
203 185
@@ -227,32 +209,21 @@
227 209 $toc_ehvalue = $this->m_TOC[$toc_id]['TOC_even_header_value'];
228 210 $toc_ofvalue = $this->m_TOC[$toc_id]['TOC_odd_footer_value'];
229 211 $toc_efvalue = $this->m_TOC[$toc_id]['TOC_even_footer_value'];
230 212 $toc_page_selector = $this->m_TOC[$toc_id]['TOC_page_selector'];
231 - $toc_resetpagenum = $this->m_TOC[$toc_id]['TOC_resetpagenum']; // mPDF 6
232 - $toc_pagenumstyle = $this->m_TOC[$toc_id]['TOC_pagenumstyle']; // mPDF 6
233 - $toc_suppress = $this->m_TOC[$toc_id]['TOC_suppress']; // mPDF 6
234 - $toc_sheet_size = (isset($this->m_TOC[$toc_id]['TOCsheetsize']) ? $this->m_TOC[$toc_id]['TOCsheetsize'] : '');
213 + $toc_sheet_size = $this->m_TOC[$toc_id]['TOCsheetsize'];
235 214 next($this->m_TOC);
236 215 }
237 216
238 217 // mPDF 5.6.31
218 +
239 219 if (!$toc_orientation) { $toc_orientation= $this->mpdf->DefOrientation; }
220 + $this->mpdf->AddPage($toc_orientation, '', '', '', "on", $toc_mgl, $toc_mgr, $toc_mgt, $toc_mgb, $toc_mgh, $toc_mgf, $toc_ohname, $toc_ehname, $toc_ofname, $toc_efname, $toc_ohvalue, $toc_ehvalue, $toc_ofvalue, $toc_efvalue, $toc_page_selector, $toc_sheet_size );
240 221
241 - // mPDF 6 number style and suppress now picked up from section preceding ToC
242 - list($tp_pagenumstyle, $tp_suppress, $tp_reset) = $this->mpdf->docPageSettings($toc_page-1);
243 -
244 - if ($toc_resetpagenum) $tp_reset = $toc_resetpagenum; // mPDF 6
245 - if ($toc_pagenumstyle) $tp_pagenumstyle = $toc_pagenumstyle; // mPDF 6
246 - if ($toc_suppress || $toc_suppress==='0') $tp_suppress = $toc_suppress; // mPDF 6
247 -
248 - $this->mpdf->AddPage($toc_orientation, '', $tp_reset, $tp_pagenumstyle, $tp_suppress, $toc_mgl, $toc_mgr, $toc_mgt, $toc_mgb, $toc_mgh, $toc_mgf, $toc_ohname, $toc_ehname, $toc_ofname, $toc_efname, $toc_ohvalue, $toc_ehvalue, $toc_ofvalue, $toc_efvalue, $toc_page_selector, $toc_sheet_size ); // mPDF 6
249 -
250 -
251 222 $this->mpdf->writingToC = true; // mPDF 5.6.38
252 223 // mPDF 5.6.31
253 224 $tocstart=count($this->mpdf->pages);
254 - if (isset($toc_preHTML) && $toc_preHTML) { $this->mpdf->WriteHTML($toc_preHTML); }
225 + if ($toc_preHTML) { $this->mpdf->WriteHTML($toc_preHTML); }
255 226
256 227
257 228 // mPDF 5.6.19
258 229 $html ='<div class="mpdf_toc" id="mpdf_toc_'.$toc_id.'">';
@@ -273,9 +244,9 @@
273 244 }
274 245 $html .= '</div>';
275 246 $this->mpdf->WriteHTML($html);
276 247
277 - if (isset($toc_postHTML) && $toc_postHTML) { $this->mpdf->WriteHTML($toc_postHTML); }
248 + if ($toc_postHTML) { $this->mpdf->WriteHTML($toc_postHTML); }
278 249 $this->mpdf->writingToC = false; // mPDF 5.6.38
279 250 $this->mpdf->AddPage($toc_orientation,'E');
280 251
281 252 $n_toc = $this->mpdf->page - $tocstart + 1;
@@ -296,9 +267,9 @@
296 267
297 268 $s .= $this->mpdf->PrintBodyBackgrounds();
298 269
299 270 $s .= $this->mpdf->PrintPageBackgrounds();
300 - $this->mpdf->pages[$this->mpdf->page] = preg_replace('/(___BACKGROUND___PATTERNS'.$this->mpdf->uniqstr.')/', "\n".$s."\n".'\\1', $this->mpdf->pages[$this->mpdf->page]);
271 + $this->mpdf->pages[$this->mpdf->page] = preg_replace('/(___BACKGROUND___PATTERNS'.date('jY').')/', "\n".$s."\n".'\\1', $this->mpdf->pages[$this->mpdf->page]);
301 272 $this->mpdf->pageBackgrounds = array();
302 273
303 274 //Page footer
304 275 $this->mpdf->InFooter=true;
@@ -385,9 +356,9 @@
385 356 else { $paging = true; }
386 357 if (isset($attr['LINKS']) && (strtoupper($attr['LINKS'])=='ON' || $attr['LINKS']==1)) { $links = true; }
387 358 else { $links = false; }
388 359 if (isset($attr['NAME']) && $attr['NAME']) { $toc_id = strtolower($attr['NAME']); } else { $toc_id = 0; }
389 - $this->TOC('',0,0,$resetpagenum, $pagenumstyle, $suppress, $toc_orientation, $paging, $links, $toc_id, $tocoutdent); // mPDF 5.6.19 5.6.31
360 + $this->TOC('',0,0,$resetpagenum, $pagenumstyle, $suppress, $toc_orientation, $paging, $links, $toc_id, $tocoutdent); // mPDF 5.6.19 5.6.31
390 361 }
391 362
392 363
393 364 function openTagTOCPAGEBREAK($attr) {
@@ -420,14 +391,8 @@
420 391 if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='ON')) { $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = 1; }
421 392 else if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='OFF')) { $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = -1; }
422 393 if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='ON')) { $this->m_TOC[$toc_id]['TOC_even_footer_value'] = 1; }
423 394 else if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='OFF')) { $this->m_TOC[$toc_id]['TOC_even_footer_value'] = -1; }
424 - if (isset($attr['TOC-RESETPAGENUM']) && $attr['TOC-RESETPAGENUM']) { $this->m_TOC[$toc_id]['TOC_resetpagenum'] = $attr['TOC-RESETPAGENUM']; }
425 - else { $this->m_TOC[$toc_id]['TOC_resetpagenum'] = ''; } // mPDF 6
426 - if (isset($attr['TOC-PAGENUMSTYLE']) && $attr['TOC-PAGENUMSTYLE']) { $this->m_TOC[$toc_id]['TOC_pagenumstyle'] = $attr['TOC-PAGENUMSTYLE']; }
427 - else { $this->m_TOC[$toc_id]['TOC_pagenumstyle'] = ''; } // mPDF 6
428 - if (isset($attr['TOC-SUPPRESS']) && ($attr['TOC-SUPPRESS'] || $attr['TOC-SUPPRESS']==='0')) { $this->m_TOC[$toc_id]['TOC_suppress'] = $attr['TOC-SUPPRESS']; }
429 - else { $this->m_TOC[$toc_id]['TOC_suppress'] = ''; } // mPDF 6
430 395 if (isset($attr['TOC-PAGE-SELECTOR']) && $attr['TOC-PAGE-SELECTOR']) { $this->m_TOC[$toc_id]['TOC_page_selector'] = $attr['TOC-PAGE-SELECTOR']; }
431 396 else { $this->m_TOC[$toc_id]['TOC_page_selector'] = ''; }
432 397 if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) { $this->m_TOC[$toc_id]['TOCsheetsize'] = $attr['TOC-SHEET-SIZE']; } else { $this->m_TOC[$toc_id]['TOCsheetsize'] = ''; }
433 398
@@ -468,14 +433,8 @@
468 433 if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='ON')) { $this->TOC_even_footer_value = 1; }
469 434 else if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='OFF')) { $this->TOC_even_footer_value = -1; }
470 435 if (isset($attr['TOC-PAGE-SELECTOR']) && $attr['TOC-PAGE-SELECTOR']) { $this->TOC_page_selector = $attr['TOC-PAGE-SELECTOR']; }
471 436 else { $this->TOC_page_selector = ''; }
472 - if (isset($attr['TOC-RESETPAGENUM']) && $attr['TOC-RESETPAGENUM']) { $this->TOC_resetpagenum = $attr['TOC-RESETPAGENUM']; }
473 - else { $this->TOC_resetpagenum = ''; } // mPDF 6
474 - if (isset($attr['TOC-PAGENUMSTYLE']) && $attr['TOC-PAGENUMSTYLE']) { $this->TOC_pagenumstyle = $attr['TOC-PAGENUMSTYLE']; }
475 - else { $this->TOC_pagenumstyle = ''; } // mPDF 6
476 - if (isset($attr['TOC-SUPPRESS']) && ($attr['TOC-SUPPRESS'] || $attr['TOC-SUPPRESS']==='0')) { $this->TOC_suppress = $attr['TOC-SUPPRESS']; }
477 - else { $this->TOC_suppress = ''; } // mPDF 6
478 437 if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) { $this->TOCsheetsize = $attr['TOC-SHEET-SIZE']; } else { $this->TOCsheetsize = ''; }
479 438
480 439 if (isset($attr['TOC-PREHTML']) && $attr['TOC-PREHTML']) { $this->TOCpreHTML = htmlspecialchars_decode($attr['TOC-PREHTML'],ENT_QUOTES); }
481 440 if (isset($attr['TOC-POSTHTML']) && $attr['TOC-POSTHTML']) { $this->TOCpostHTML = htmlspecialchars_decode($attr['TOC-POSTHTML'],ENT_QUOTES); }