// set defaults for blocks ( custom data, address, communication preference, notes, tags and groups )
foreach ($this->_editOptions as $name => $label) {
- if (!in_array($name, array(
- 'Address', 'Notes'))) {
- eval('CRM_Contact_Form_Edit_' . $name . '::setDefaultValues( $this, $defaults );');
+ if (!in_array($name, array('Address', 'Notes'))) {
+ $className = 'CRM_Contact_Form_Edit_' . $name;
+ $className::setDefaultValues($this, $defaults);
}
}
public function buildQuickForm() {
//load form for child blocks
if ($this->_addBlockName) {
- $class = 'CRM_Contact_Form_Edit_' . $this->_addBlockName;
- return $class::buildQuickForm($this);
+ $className = 'CRM_Contact_Form_Edit_' . $this->_addBlockName;
+ return $className::buildQuickForm($this);
}
if ($this->_action == CRM_Core_Action::UPDATE) {
}
//build contact type specific fields
- eval('CRM_Contact_Form_Edit_' . $this->_contactType . '::buildQuickForm( $this );');
+ $className = 'CRM_Contact_Form_Edit_' . $this->_contactType;
+ $className::buildQuickForm($this);
// build Custom data if Custom data present in edit option
$buildCustomData = 'noCustomDataPresent';
$this->_blocks['Address'] = $this->_editOptions['Address'];
continue;
}
-
- eval('CRM_Contact_Form_Edit_' . $name . '::buildQuickForm( $this );');
+ $className = 'CRM_Contact_Form_Edit_' . $name;
+ $className::buildQuickForm($this);
}
// build location blocks.
* $Id$
*
*/
-class CRM_Contact_Form_Edit_TagsandGroups {
+class CRM_Contact_Form_Edit_TagsAndGroups {
/**
* constant to determine which forms we are generating
* @access public
*/
static function buildQuickForm(&$form,
- $contactId = 0,
- $type = CRM_Contact_Form_Edit_TagsandGroups::ALL,
+ $contactId = 0,
+ $type = self::ALL,
$visibility = FALSE,
$isRequired = NULL,
- $groupName = 'Group(s)',
- $tagName = 'Tag(s)',
- $fieldName = NULL
+ $groupName = 'Group(s)',
+ $tagName = 'Tag(s)',
+ $fieldName = NULL
) {
if (!isset($form->_tagGroup)) {
$form->_tagGroup = array();
$contactId = $form->_contactId;
}
- $type = (int ) $type;
- if ($type & CRM_Contact_Form_Edit_TagsandGroups::GROUP) {
+ $type = (int) $type;
+ if ($type & self::GROUP) {
$fName = 'group';
if ($fieldName) {
}
}
- if ($type & CRM_Contact_Form_Edit_TagsandGroups::TAG) {
+ if ($type & self::TAG) {
$fName = 'tag';
if ($fieldName) {
$fName = $fieldName;
* @access public
* @static
*/
- static function setDefaults($id, &$defaults, $type = CRM_Contact_Form_Edit_TagsandGroups::ALL, $fieldName = NULL) {
+ static function setDefaults($id, &$defaults, $type = self::ALL, $fieldName = NULL) {
$type = (int ) $type;
if ($type & self::GROUP) {
$fName = 'group';