<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
if ($element->getAttribute('data-api-entity') && $element->getAttribute('data-entity-value')) {
$this->renderFrozenEntityRef($el, $element);
}
- $el['html'] = '<div class="crm-frozen-field">' . $el['html'] . '</div>';
+ $el['html'] = '<span class="crm-frozen-field">' . $el['html'] . '</span>';
}
// Active form elements
else {
$this->addOptionsEditLink($el, $element);
}
- if ($element->getType() == 'group' && $element->getAttribute('unselectable')) {
+ if ($element->getType() == 'group' && $element->getAttribute('allowClear')) {
$this->appendUnselectButton($el, $element);
}
}
}
if ($val) {
$entity = $field->getAttribute('data-api-entity');
- $select = json_decode($field->getAttribute('data-select-params'), TRUE);
$api = json_decode($field->getAttribute('data-api-params'), TRUE);
$params = CRM_Utils_Array::value('params', $api, array());
// Support serialized values
$field->removeAttribute('class');
}
if (!empty($result['values'])) {
- // Simplify array for single selects - makes client-side code simpler (but feels somehow wrong)
- if (empty($select['multiple'])) {
- $result['values'] = $result['values'][0];
- }
$field->setAttribute('data-entity-value', json_encode($result['values']));
}
}
function renderFrozenEntityRef(&$el, $field) {
$entity = $field->getAttribute('data-api-entity');
$vals = json_decode($field->getAttribute('data-entity-value'), TRUE);
- // Hack for single-entity @see self::preProcessEntityRef
- if (isset($vals['id'])) {
- $vals = array($vals);
- }
$display = array();
foreach ($vals as $val) {
// Format contact as link