From 484f5c18185cadea86e057a374719a73facd1f4f Mon Sep 17 00:00:00 2001 From: otrok7 Date: Sat, 17 Aug 2019 10:14:57 +0200 Subject: [PATCH] Small fix --- bmlt-meeting-list.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bmlt-meeting-list.php b/bmlt-meeting-list.php index a4b72b0..4d6e51f 100644 --- a/bmlt-meeting-list.php +++ b/bmlt-meeting-list.php @@ -468,8 +468,11 @@ function sortBySubkey(&$array, $subkey, $sortType = SORT_ASC) { function upgrade_settings() { if (!isset($this->options['cont_header_shown']) && isset($this->options['page_height_fix'])) { - $fix = intval($this->options['page_height_fix']); - if ($fix <= 0) { + $fix = floatval($this->options['page_height_fix']); + // say, the height of 2 lines + $x = floatval($this->options['content_font_size']) * + floatval($this->options['content_line_height']) * 2.0 * 0.35; // pt to mm + if ($fix < $x) { $this->options['cont_header_shown'] = true; } else { $this->options['cont_header_shown'] = false; @@ -1052,6 +1055,7 @@ function bmlt_meeting_list($atts = null, $content = null) { foreach ($headerMeetings[$this_heading] as $meeting_value) { $area_name = $this->get_area_name($meeting_value); $header = ''; + $has_major_header = false; if ( $groupByLevels == 2 ) { if ( $newMajorHeading === true ) { $xtraMargin = ''; @@ -1060,6 +1064,7 @@ function bmlt_meeting_list($atts = null, $content = null) { } $header .= '
'.$header_string."
"; $newMajorHeading = false; + $has_major_header = true; } if ($newVal && $this->options['sub_header_shown']==1) { $header .= "

".$subheader."

"; @@ -1071,6 +1076,7 @@ function bmlt_meeting_list($atts = null, $content = null) { } if ( $newVal ) { $header .= "
".$header_string."
"; + $has_major_header = true; } } if ($this->options['suppress_heading']==1) { @@ -1087,8 +1093,8 @@ function bmlt_meeting_list($atts = null, $content = null) { $y_diff = $test_pages->y - $y_startpos; if ($y_diff >= $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height) { $this->writeBreak($this->mpdf); - if (!$newVal && $this->options['cont_header_shown']) { - $header .= "
".$header_string." " . $cont . "
"; + if (!$has_major_header && $this->options['cont_header_shown']) { + $header = "
".$header_string." " . $cont . "
"; $data = $header.$data; } }