<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Core_OptionGroup {
static $_values = array();
* This function retrieves all the values for the specific option group by name
* this is primarily used to create various html based form elements
* (radio, select, checkbox etc). OptionGroups for most cases have the
- * 'label' in the label colum and the 'id' or 'name' in the value column
+ * 'label' in the label column and the 'id' or 'name' in the value column
*
* @param string $name
* name of the option group.
* This function retrieves all the values for the specific option group by id.
* this is primarily used to create various html based form elements
* (radio, select, checkbox etc). OptionGroups for most cases have the
- * 'label' in the label colum and the 'id' or 'name' in the value column
+ * 'label' in the label column and the 'id' or 'name' in the value column
*
* @param int $id
* id of the option group.
*
*
* @param bool $flip
- *
- * @return void
- *
*/
public static function lookupValues(&$params, &$names, $flip = FALSE) {
foreach ($names as $postName => $value) {
'description',
) as $fld) {
$row[$fld] = $dao->$fld;
- }
- }
-
- if ($localize) {
- foreach (array('label', 'description') as $f) {
- $row[$f] = ts($row[$f]);
+ if ($localize && in_array($fld, array('label', 'description'))) {
+ $row[$fld] = ts($row[$fld]);
+ }
}
}