$this->border = "LTRB";
}
- $order = 1;
foreach ($participants as $participant) {
- CRM_Utils_Hook::alterBadge($order, $this, $layoutInfo, $participant);
$formattedRow = self::formatLabel($participant, $layoutInfo);
$this->pdf->AddPdfLabel($formattedRow);
- $order + 1;
}
$this->pdf->Output(CRM_Utils_String::munge($layoutInfo['title'], '_', 64) . '.pdf', 'D');
}
public function labelCreator(&$formattedRow, $cellspacing = 0) {
+ //call hook alterBadge
+ CRM_Utils_Hook::alterBadge($formattedRow['labelFormat'], $this, $formattedRow,$formattedRow['values']);
+
$this->lMarginLogo = 18;
$this->tMarginName = 20;
/**
* This hook is invoked when building a CiviCRM name badge.
*
+ * @param string $labelName string referencing name of badge format
* @param object $label reference to the label object
* @param array $format array of format data
* @param array $participant array of participant values
*
* @return null the return value is ignored
*/
- static function alterBadge($participant_number, &$label, &$format, &$participant) {
- return self::singleton()->invoke(4, $participant_number, $label, $format, $participant, self::$_nullObject, self::$_nullObject, 'civicrm_alterBadge');
+ static function alterBadge($labelName, &$label, &$format, &$participant) {
+ return self::singleton()->invoke(4, $labelName, $label, $format, $participant, self::$_nullObject, self::$_nullObject, 'civicrm_alterBadge');
}