X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FLabelFormat.php;h=b2fdccf6d7373cc3cc92651baf3c5e4724eb3719;hb=442df34b5f4c02d27af8d51f657deff0e00f240c;hp=3b16781c2aa0cac49513d45904db8c271ebd80dd;hpb=8741f15f03d46d888c0ff2ac675d122b0372cb3b;p=civicrm-core.git diff --git a/CRM/Core/BAO/LabelFormat.php b/CRM/Core/BAO/LabelFormat.php index 3b16781c2a..b2fdccf6d7 100644 --- a/CRM/Core/BAO/LabelFormat.php +++ b/CRM/Core/BAO/LabelFormat.php @@ -1,7 +1,7 @@ ts('6 pt'), - 7 => ts('7 pt'), - 8 => ts('8 pt'), - 9 => ts('9 pt'), - 10 => ts('10 pt'), - 11 => ts('11 pt'), - 12 => ts('12 pt'), - 13 => ts('13 pt'), - 14 => ts('14 pt'), - 15 => ts('15 pt'), - ); + $fontSizes = array(); + for ($i = 6; $i <= 60; $i++) { + $fontSizes[$i] = ts('%1 pt', array(1 => $i)); + } + + return $fontSizes; } /** @@ -239,7 +233,24 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { return array( 'R' => ts('Right'), 'L' => ts('Left'), - 'J' => ts('Justify'), + 'C' => ts('Center'), + ); + } + + /** + * Get text alignment recognized by the TCPDF package used to create PDF labels. + * + * @param void + * + * @return array array of alignments + * @access public + * @static + */ + public static function getFontStyles() { + return array( + '' => ts('Normal'), + 'B' => ts('Bold'), + 'I' => ts('Italic'), ); } @@ -502,6 +513,9 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { // serialize label format fields into a single string to store in the 'value' column of the Option Value table $v = json_decode($this->value, TRUE); foreach (self::$optionValueFields as $name => $field) { + if (!isset($v[$name])) { + $v[$name] = NULL; + } $v[$name] = self::getValue($name, $values, $v[$name]); } $this->value = json_encode($v);