當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Utils_PDF_Utils::convertMetric方法代碼示例

本文整理匯總了PHP中CRM_Utils_PDF_Utils::convertMetric方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Utils_PDF_Utils::convertMetric方法的具體用法?PHP CRM_Utils_PDF_Utils::convertMetric怎麽用?PHP CRM_Utils_PDF_Utils::convertMetric使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Utils_PDF_Utils的用法示例。


在下文中一共展示了CRM_Utils_PDF_Utils::convertMetric方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: LabelSetFormat

 /**
  * initialize label format settings.
  *
  * @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->paperSize = $this->getFormatValue('paper-size');
     $this->orientation = $this->getFormatValue('orientation');
     $this->fontName = $this->getFormatValue('font-name');
     $this->charSize = $this->getFormatValue('font-size');
     $this->fontStyle = $this->getFormatValue('font-style');
     $this->xNumber = $this->getFormatValue('NX');
     $this->yNumber = $this->getFormatValue('NY');
     $this->metricDoc = $unit;
     $this->marginLeft = $this->getFormatValue('lMargin', TRUE);
     $this->marginTop = $this->getFormatValue('tMargin', TRUE);
     $this->xSpace = $this->getFormatValue('SpaceX', TRUE);
     $this->ySpace = $this->getFormatValue('SpaceY', TRUE);
     $this->width = $this->getFormatValue('width', TRUE);
     $this->height = $this->getFormatValue('height', TRUE);
     $this->paddingLeft = $this->getFormatValue('lPadding', TRUE);
     $this->paddingTop = $this->getFormatValue('tPadding', TRUE);
     $paperSize = CRM_Core_BAO_PaperSize::getByName($this->paperSize);
     $w = CRM_Utils_PDF_Utils::convertMetric($paperSize['width'], $paperSize['metric'], $this->metricDoc);
     $h = CRM_Utils_PDF_Utils::convertMetric($paperSize['height'], $paperSize['metric'], $this->metricDoc);
     $this->paper_dimensions = array($w, $h);
 }
開發者ID:nganivet,項目名稱:civicrm-core,代碼行數:32,代碼來源:Label.php

示例2: retrieve

 /**
  * Retrieve DB object based on input parameters.
  *
  * It also stores all the retrieved values in the default array.
  *
  * @param array $params
  *   (reference ) an assoc array of name/value pairs.
  * @param array $values
  *   (reference ) an assoc array to hold the flattened values.
  *
  * @return CRM_Core_DAO_OptionValue
  */
 public static function retrieve(&$params, &$values)
 {
     $optionValue = new CRM_Core_DAO_OptionValue();
     $optionValue->copyValues($params);
     $optionValue->option_group_id = self::_getGid();
     if ($optionValue->find(TRUE)) {
         // Extract fields that have been serialized in the 'value' column of the Option Value table.
         $values = json_decode($optionValue->value, TRUE);
         // Add any new fields that don't yet exist in the saved values.
         foreach (self::$optionValueFields as $name => $field) {
             if (!isset($values[$name])) {
                 $values[$name] = $field['default'];
                 if (isset($field['metric']) && $field['metric']) {
                     $values[$name] = CRM_Utils_PDF_Utils::convertMetric($field['default'], self::$optionValueFields['metric']['default'], $values['metric'], 3);
                 }
             }
         }
         // Add fields from the OptionValue base class
         CRM_Core_DAO::storeValues($optionValue, $values);
         return $optionValue;
     }
     return NULL;
 }
開發者ID:kidaa30,項目名稱:yes,代碼行數:35,代碼來源:PdfFormat.php

示例3: toTwip

 /**
  * @param $value
  * @param $metric
  * @return int
  */
 public static function toTwip($value, $metric)
 {
     $point = CRM_Utils_PDF_Utils::convertMetric($value, $metric, 'pt');
     return \PhpOffice\PhpWord\Shared\Converter::pointToTwip($point);
 }
開發者ID:nielosz,項目名稱:civicrm-core,代碼行數:10,代碼來源:Document.php


注:本文中的CRM_Utils_PDF_Utils::convertMetric方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。