$eventTopY = $pdfY;
// dates
$dates = new SetaPDF_Core_Text_Block( $boldFont, self::PDF_FONT_SIZE );
- $dates->setText($event['dates']);
+ $eventDates = $event['dates'];
+ if ( !$event['ongoing'] && count( $event['times'] > 1) && isset( $event['recurrences'] ) ) {
+ if ( $event['recurrences'][0]['day_of_week']['names'] ) {
+ $eventDates .= ' (' . implode(', ', $event['recurrences'][0]['day_of_week']['names']) . ')';
+ }
+ }
+ $dates->setText($eventDates);
$lineCount = $dates->getLineCount();
- //echo '<pre>dates $lineCount: ' . print_r($lineCount, true) . '</pre>';
$dates->draw($page->getCanvas(), self::PDF_LFT_COL_X, $pdfY);
$pdfY -= self::LINE_HEIGHT * $lineCount;
- //echo '<pre>dates $pdfY: ' . print_r($pdfY, true) . '</pre>';
// title
$title = new SetaPDF_Core_Text_Block( $boldFont, self::PDF_FONT_SIZE );
$title->setText($event['name']);
$lineCount = $title->getLineCount();
- //echo '<pre>title $lineCount: ' . print_r($lineCount, true) . '</pre>';
$title->draw($page->getCanvas(), self::PDF_LFT_COL_X, $pdfY);
$pdfY -= self::LINE_HEIGHT * $lineCount;
- //echo '<pre>title $pdfY: ' . print_r($pdfY, true) . '</pre>';
if ( isset($event['categories']) && !empty($event['categories']) ) {
$categoryNames = array();
$url->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY );
$pdfY -= self::LINE_HEIGHT;
}
+ if ( $event['cost'] ) {
+ $cost = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE );
+ $cost->setText( $event['cost'] );
+ $cost->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY );
+ $pdfY -= self::LINE_HEIGHT;
+ }
$pdfY -= self::LINE_HEIGHT * 2;
$intro->setText($introText);
$intro->setWidth(self::PDF_WIDTH - 30);
$lineCount = $intro->getLineCount();
- //echo '<pre>intro $lineCount: ' . print_r($lineCount, true) . '</pre>';
$intro->draw($page->getCanvas(), self::PDF_LFT_COL_X, $pdfY);
$pdfY -= self::LINE_HEIGHT * $lineCount;
if ( $lineCount == 1 ) {
$pdfY -= self::LINE_HEIGHT;
}
- //echo '<pre>intro $pdfY: ' . print_r($pdfY, true) . '</pre>';
}
// line at the bottom of the event
++$index;
- //$pdfY -= self::LINE_HEIGHT;
- //echo '<pre>$pdfY: ' . print_r($pdfY, true) . '</pre>';
-
if ( $pdfY <= self::PDF_BOTTOM_Y && !( $totalEvents == $index ) ) {
$pdfY = self::PDF_TOP_Y;
$page = $pages->create(SetaPDF_Core_PageFormats::A4);