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