Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-02-02-18-36-16
[civicrm-core.git] / CRM / Event / Badge / Logo5395.php
CommitLineData
6a488035 1<?php
0cf587a7
EM
2
3/**
4 * Class CRM_Event_Badge_Logo5395
5 */
6a488035 6class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge {
0cf587a7 7 /**
0cf587a7 8 */
00be9182 9 public function __construct() {
6a488035
TO
10 parent::__construct();
11 // A4
353ffa53
TO
12 $pw = 210;
13 $ph = 297;
14 $h = 59.2;
15 $w = 85.7;
6a488035 16 $this->format = array(
0479b4c8 17 'name' => 'Avery 5395',
353ffa53
TO
18 'paper-size' => 'A4',
19 'metric' => 'mm',
20 'lMargin' => 13.5,
0479b4c8 21 'tMargin' => 3,
353ffa53
TO
22 'NX' => 2,
23 'NY' => 4,
24 'SpaceX' => 15,
25 'SpaceY' => 8.5,
0479b4c8 26 'width' => $w,
353ffa53
TO
27 'height' => $h,
28 'font-size' => 12,
6a488035
TO
29 );
30 $this->lMarginLogo = 20;
31 $this->tMarginName = 20;
32 // $this->setDebug ();
33 }
34
0cf587a7
EM
35 /**
36 * @param $participant
37 */
6a488035
TO
38 public function generateLabel($participant) {
39 $x = $this->pdf->GetAbsX();
40 $y = $this->pdf->GetY();
41 $this->printBackground(TRUE);
353ffa53
TO
42 $this->pdf->SetLineStyle(array(
43 'width' => 0.1,
44 'cap' => 'round',
45 'join' => 'round',
46 'dash' => '2,2',
acb1052e 47 'color' => array(0, 0, 200),
353ffa53 48 ));
6a488035
TO
49
50 $this->pdf->SetFontSize(9);
51 $this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y);
52
53 $this->pdf->SetXY($x, $y + $this->pdf->height - 5);
54 $date = CRM_Utils_Date::customFormat($participant['event_start_date'], "%e %b");
55 $this->pdf->Cell($this->pdf->width, 0, $date, $this->border, 2, "R");
56
57 $this->pdf->SetFontSize(20);
58 $this->pdf->MultiCell($this->pdf->width, 10, $participant['display_name'], $this->border, "C", 0, 1, $x, $y + $this->tMarginName);
59 $this->pdf->SetFontSize(15);
60 $this->pdf->MultiCell($this->pdf->width, 0, $participant['current_employer'], $this->border, "C", 0, 1, $x, $this->pdf->getY());
61 }
96025800 62
6a488035 63}