<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
| Copyright (C) 2011 Marty Wright |
| Licensed to CiviCRM under the Academic Free License version 3.0. |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* @return array array of page orientations
* @access public
*/
- function getPageOrientations() {
+ public static function getPageOrientations() {
return array(
'portrait' => ts('Portrait'),
'landscape' => ts('Landscape'),
* @return array array of measurement units
* @access public
*/
- function getUnits() {
+ public static function getUnits() {
return array(
'in' => ts('Inches'),
'cm' => ts('Centimeters'),
* @return int Group ID (null if Group ID doesn't exist)
* @access private
*/
- private function _getGid() {
+ private static function _getGid() {
if (!self::$_gid) {
self::$_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'pdf_format', 'id', 'name');
if (!self::$_gid) {
/**
* Get PDF Page Format field from associative array
*
- * @param string $field name of a PDF Page Format field
- * @param array (reference) $values associative array of name/value pairs containing
+ * @param string $field name of a PDF Page Format field
+ * @param array (reference) $values associative array of name/value pairs containing
* PDF Page Format field selections
*
+ * @param null $default
+ *
* @return value
* @access public
* @static
// serialize PDF Page 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) {
- $v[$name] = self::getValue($name, $values, $v[$name]);
+ $v[$name] = self::getValue($name, $values, CRM_Utils_Array::value($name, $v));
}
$this->value = json_encode($v);