projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
INFRA-132 - Change "else if" to "elseif"
[civicrm-core.git]
/
CRM
/
Utils
/
PDF
/
Label.php
diff --git
a/CRM/Utils/PDF/Label.php
b/CRM/Utils/PDF/Label.php
index b16272acfd5bf2c0c50e6f3280d9d573104d004a..8893b2a29da717ecdb68ee6f0ef71ec297872235 100644
(file)
--- a/
CRM/Utils/PDF/Label.php
+++ b/
CRM/Utils/PDF/Label.php
@@
-1,7
+1,7
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
5
|
+ | CiviCRM version 4.
6
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
@@
-35,6
+35,10
@@
*/
require_once 'tcpdf/tcpdf.php';
*/
require_once 'tcpdf/tcpdf.php';
+
+/**
+ * Class CRM_Utils_PDF_Label
+ */
class CRM_Utils_PDF_Label extends TCPDF {
// make these properties public due to
class CRM_Utils_PDF_Label extends TCPDF {
// make these properties public due to
@@
-89,13
+93,13
@@
class CRM_Utils_PDF_Label extends TCPDF {
/**
* Constructor
*
/**
* Constructor
*
- * @param $format Either the name of a Label Format in the Option Value table
+ * @param $format
+ * Either the name of a Label Format in the Option Value table.
* or an array of Label Format values.
* or an array of Label Format values.
- * @param
$unit
Unit of measure for the PDF document
+ * @param
string|\Unit $unit
Unit of measure for the PDF document
*
*
- * @access public
*/
*/
- function __construct($format, $unit = 'mm') {
+
public
function __construct($format, $unit = 'mm') {
if (is_array($format)) {
// Custom format
$tFormat = $format;
if (is_array($format)) {
// Custom format
$tFormat = $format;
@@
-116,12
+120,22
@@
class CRM_Utils_PDF_Label extends TCPDF {
$this->setPrintFooter(FALSE);
}
$this->setPrintFooter(FALSE);
}
- function SetGenerator($objectinstance, $methodname = 'generateLabel') {
+ /**
+ * @param $objectinstance
+ * @param string $methodname
+ */
+ public function SetGenerator($objectinstance, $methodname = 'generateLabel') {
$this->generatorMethod = $methodname;
$this->generatorObject = $objectinstance;
}
$this->generatorMethod = $methodname;
$this->generatorObject = $objectinstance;
}
- function getFormatValue($name, $convert = FALSE) {
+ /**
+ * @param string $name
+ * @param bool $convert
+ *
+ * @return float|int|mixed
+ */
+ public function getFormatValue($name, $convert = FALSE) {
if (isset($this->format[$name])) {
$value = $this->format[$name];
$metric = $this->format['metric'];
if (isset($this->format[$name])) {
$value = $this->format[$name];
$metric = $this->format['metric'];
@@
-137,9
+151,13
@@
class CRM_Utils_PDF_Label extends TCPDF {
}
/*
}
/*
- *
Function to
initialize label format settings
+ * initialize label format settings
*/
*/
- function LabelSetFormat(&$format, $unit) {
+ /**
+ * @param $format
+ * @param $unit
+ */
+ public function LabelSetFormat(&$format, $unit) {
$this->defaults = CRM_Core_BAO_LabelFormat::getDefaultValues();
$this->format = &$format;
$this->formatName = $this->getFormatValue('name');
$this->defaults = CRM_Core_BAO_LabelFormat::getDefaultValues();
$this->format = &$format;
$this->formatName = $this->getFormatValue('name');
@@
-166,9
+184,12
@@
class CRM_Utils_PDF_Label extends TCPDF {
}
/*
}
/*
- * function to Generate the pdf of one label (can be modified using SetGenerator)
+ * Generate the pdf of one label (can be modified using SetGenerator)
+ */
+ /**
+ * @param $text
*/
*/
- function generateLabel($text) {
+
public
function generateLabel($text) {
$args = array(
'w' => $this->width,
'h' => 0,
$args = array(
'w' => $this->width,
'h' => 0,
@@
-210,9
+231,12
@@
class CRM_Utils_PDF_Label extends TCPDF {
}
/*
}
/*
- *
function to
Print a label
+ * Print a label
*/
*/
- function AddPdfLabel($texte) {
+ /**
+ * @param $texte
+ */
+ public function AddPdfLabel($texte) {
if ($this->countX == $this->xNumber) {
// Page full, we start a new one
$this->AddPage();
if ($this->countX == $this->xNumber) {
// Page full, we start a new one
$this->AddPage();
@@
-238,7
+262,7
@@
class CRM_Utils_PDF_Label extends TCPDF {
}
}
}
}
- function getFontNames() {
+
public
function getFontNames() {
// Define labels for TCPDF core fonts
$fontLabel = array(
'courier' => ts('Courier'),
// Define labels for TCPDF core fonts
$fontLabel = array(
'courier' => ts('Courier'),
@@
-247,7
+271,6
@@
class CRM_Utils_PDF_Label extends TCPDF {
'dejavusans' => ts('Deja Vu Sans (UTF-8)'),
);
'dejavusans' => ts('Deja Vu Sans (UTF-8)'),
);
-
// Check to see if we have any additional fonts to add. You can specify more fonts in
// civicrm.settings.php via: $config['CiviCRM Preferences']['additional_fonts']
// CRM-13307
// Check to see if we have any additional fonts to add. You can specify more fonts in
// civicrm.settings.php via: $config['CiviCRM Preferences']['additional_fonts']
// CRM-13307
@@
-266,4
+289,3
@@
class CRM_Utils_PDF_Label extends TCPDF {
return $list;
}
}
return $list;
}
}
-