/** * get custom fields and their value * * @return array tag => field */ function getCustomfields() { if (empty($this->_customfields)) { $details =& $this->getEvent()->getData(); $db =& JFactory::getDBO(); $query = ' SELECT f.* ' . ' FROM #__redevent_fields AS f ' . ' WHERE f.published = 1 ' . ' AND CHAR_LENGTH(f.tag) > 0 '; $db->setQuery($query); $fields = $db->loadObjectList(); $replace = array(); foreach ((array) $fields as $field) { $prop = 'custom' . $field->id; if (isset($details->{$prop})) { $field->value = $details->{$prop}; } else { $field->value = null; } $obj = new stdclass(); $obj->text_name = $field->tag; $obj->text_field = redEVENTHelper::renderFieldValue($field); $replace[$field->tag] = $obj; } $this->_customfields = $replace; } return $this->_customfields; }