$location->setText(implode(', ', $address));
$location->draw($page->getCanvas(), self::PDF_LFT_COL_X, $pdfY);
$pdfY -= self::LINE_HEIGHT * $lineCount;
+ }
- // check for phone, url or email to output
- $contactInfo = array();
- if ( $event['locations']['phone'] ) {
- $contactInfo[] = $event['locations']['phone'];
- }
- if ( $event['locations']['email'] ) {
- $contactInfo[] = $event['locations']['email'];
- }
- if ( $event['locations']['url'] ) {
- $contactInfo[] = $event['locations']['url'];
- }
- if ( !empty($contactInfo) ) {
- $contact = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE );
- $contact->setText( implode( ' - ', $contactInfo ) );
- $contact->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY );
- $pdfY -= self::LINE_HEIGHT * $lineCount;
- }
+ // check for phone, url or email to output
+ $contactInfo = array();
+ if ( $event['contact_phone'] ) {
+ $contactInfo[] = $event['contact_phone'];
+ }
+ if ( $event['contact_email'] ) {
+ $contactInfo[] = $event['contact_email'];
}
-
if ( $event['url'] ) {
- $url = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE );
- $website = ( strpos('http://', $event['url']) )
- ? $event['url']
- : 'http://' . $event['url'];
- $url->setText( $website );
- $url->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY );
- $pdfY -= self::LINE_HEIGHT;
+ $contactInfo[] = $event['url'];
+ }
+ if ( !empty($contactInfo) ) {
+ $contact = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE );
+ $contact->setText( implode( ' - ', $contactInfo ) );
+ $contact->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY );
+ $pdfY -= self::LINE_HEIGHT * $lineCount;
}
- if ( $event['cost'] ) {
+
+ if ( $event['cost'] && !$event['free'] ) {
$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;
+ } else if ( $event['free'] ) {
+ $cost = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE );
+ $cost->setText( 'FREE' );
+ $cost->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY );
+ $pdfY -= self::LINE_HEIGHT;
}
$pdfY -= self::LINE_HEIGHT * 2;