<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
*/
- function __construct() {
+ public function __construct() {
$this->style = array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200));
$this->format = '5160';
$this->imgExtension = 'png';
/**
* @param bool $debug
*/
- function setDebug($debug = TRUE) {
+ public function setDebug($debug = TRUE) {
if (!$debug) {
$this->debug = FALSE;
$this->border = 0;
}
/**
- * create the labels (pdf)
+ * Create the labels (pdf)
* It assumes the participants are from the same event
*
- * @param array $participants
+ * @param array $participants
*
* @return null
- * @access public
*/
public function run(&$participants) {
// fetch the 1st participant, and take her event to retrieve its attributes
}
/**
- * @param $eventID
+ * @param int $eventID
*
* @return CRM_Event_BAO_Event|null
*/
}
/**
- * @param $eventID
+ * @param int $eventID
* @param bool $img
*
* @return string
*/
- function getImageFileName($eventID, $img = FALSE) {
+ public function getImageFileName($eventID, $img = FALSE) {
global $civicrm_root;
$path = "CRM/Event/Badge";
if ($img == FALSE) {
// CRM-13235 - leverage the Smarty path to get all templates directories
$template = CRM_Core_Smarty::singleton();
if (isset($template->template_dir) && $template->template_dir) {
- $dirs = is_array( $template->template_dir ) ? $template->template_dir : array($template->template_dir);
+ $dirs = is_array($template->template_dir) ? $template->template_dir : array($template->template_dir);
foreach ($dirs as $dir) {
- foreach (array( "$dir/$path/$eventID/$img", "$dir/$path/$img") as $imgFile) {
+ foreach (array("$dir/$path/$eventID/$img", "$dir/$path/$img") as $imgFile) {
if (file_exists($imgFile)) {
return $imgFile;
}
}
}
- } else {
+ }
+ else {
$imgFile = 'No template directories defined anywhere??';
}
/**
* @param bool $img
*/
- function printBackground($img = FALSE) {
+ public function printBackground($img = FALSE) {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
if ($this->debug) {
}
/**
- * this is supposed to be overrided
+ * This is supposed to be overrided
**/
public function generateLabel($participant) {
$txt = "{$this->event['title']}
$this->pdf->MultiCell($this->pdf->width, $this->pdf->lineHeight, $txt);
}
- function pdfExtraFormat() {}
+ public function pdfExtraFormat() {
+ }
/**
- * create labels (pdf)
+ * Create labels (pdf)
*
* @param array $participants
*
* @return null
- * @access public
*/
- function createLabels(&$participants) {
+ public function createLabels(&$participants) {
$this->pdf = new CRM_Utils_PDF_Label($this->format, 'mm');
$this->pdfExtraFormat();
$this->pdf->Output($this->event->title . '.pdf', 'D');
}
}
-