commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Event / Badge / Logo.php
1 <?php
2
3 /**
4 * Class CRM_Event_Badge_Logo
5 */
6 class CRM_Event_Badge_Logo extends CRM_Event_Badge {
7 /**
8 */
9 public function __construct() {
10 parent::__construct();
11 // A4
12 $pw = 210;
13 $ph = 297;
14 $h = 50;
15 $w = 75;
16 $this->format = array(
17 'name' => 'Sigel 3C',
18 'paper-size' => 'A4',
19 'metric' => 'mm',
20 'lMargin' => ($pw - $w * 2) / 2,
21 'tMargin' => ($ph - $h * 5) / 2,
22 'NX' => 2,
23 'NY' => 5,
24 'SpaceX' => 0,
25 'SpaceY' => 0,
26 'width' => $w,
27 'height' => $h,
28 'font-size' => 12,
29 );
30 $this->lMarginLogo = 20;
31 $this->tMarginName = 20;
32 // $this->setDebug ();
33 }
34
35 /**
36 * @param $participant
37 */
38 public function generateLabel($participant) {
39 $x = $this->pdf->GetAbsX();
40 $y = $this->pdf->GetY();
41 $this->printBackground(TRUE);
42 $this->pdf->SetLineStyle(array(
43 'width' => 0.1,
44 'cap' => 'round',
45 'join' => 'round',
46 'dash' => '2,2',
47 'color' => array(0, 0, 200),
48 ));
49
50 $this->pdf->SetFontSize(8);
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(15);
58 $this->pdf->MultiCell($this->pdf->width, 10, $participant['display_name'], $this->border, "C", 0, 1, $x, $y + $this->tMarginName);
59 $this->pdf->SetFontSize(10);
60 $this->pdf->MultiCell($this->pdf->width, 0, $participant['current_employer'], $this->border, "C", 0, 1, $x, $this->pdf->getY());
61 }
62
63 }