X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FBadge.php;h=5efaba68d63f5d5e80f53b31839fb679b9510b22;hb=a946aa64b981cfd2738fa06fa9ce34dd5b76f5f7;hp=104bcff1740dbf2b4764c28f5c3d41dd8425a3f3;hpb=e913987d303f2c51e60be23820fc8d1031e7eadd;p=civicrm-core.git diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index 104bcff174..5efaba68d6 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -1,7 +1,7 @@ style = array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200)); $this->format = '5160'; $this->imgExtension = 'png'; @@ -58,7 +58,7 @@ class CRM_Event_Badge { /** * @param bool $debug */ - function setDebug($debug = TRUE) { + public function setDebug($debug = TRUE) { if (!$debug) { $this->debug = FALSE; $this->border = 0; @@ -70,13 +70,12 @@ class CRM_Event_Badge { } /** - * function to 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 @@ -89,7 +88,7 @@ class CRM_Event_Badge { } /** - * @param $eventID + * @param int $eventID * * @return CRM_Event_BAO_Event|null */ @@ -102,12 +101,12 @@ class CRM_Event_Badge { } /** - * @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) { @@ -120,15 +119,16 @@ class CRM_Event_Badge { // 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??'; } @@ -139,7 +139,7 @@ class CRM_Event_Badge { /** * @param bool $img */ - function printBackground($img = FALSE) { + public function printBackground($img = FALSE) { $x = $this->pdf->GetAbsX(); $y = $this->pdf->GetY(); if ($this->debug) { @@ -158,7 +158,7 @@ class CRM_Event_Badge { } /** - * this is supposed to be overrided + * This is supposed to be overrided **/ public function generateLabel($participant) { $txt = "{$this->event['title']} @@ -168,20 +168,17 @@ class CRM_Event_Badge { $this->pdf->MultiCell($this->pdf->width, $this->pdf->lineHeight, $txt); } - function pdfExtraFormat() {} + public function pdfExtraFormat() { + } /** - * function to create labels (pdf) + * Create labels (pdf) * - * @param $participants - * - * @internal param array $contactRows assciated array of contact data - * @internal param string $format format in which labels needs to be printed + * @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(); @@ -199,4 +196,3 @@ class CRM_Event_Badge { $this->pdf->Output($this->event->title . '.pdf', 'D'); } } -