Cleanup
authorColeman Watts <coleman@civicrm.org>
Wed, 27 Mar 2013 21:42:30 +0000 (14:42 -0700)
committerColeman Watts <coleman@civicrm.org>
Thu, 28 Mar 2013 15:49:00 +0000 (08:49 -0700)
CRM/Contact/Form/Contact.php
CRM/Contact/Form/Edit/TagsAndGroups.php
CRM/Core/Resources.php

index 50a5b2415b12288d634e9660c5589536824e0f96..d9d09ee02714de969ef3f26a24dc9d62f832ef23 100644 (file)
@@ -435,9 +435,9 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
 
     // 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);
       }
     }
 
@@ -744,8 +744,8 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
   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) {
@@ -770,7 +770,8 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
     }
 
     //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';
@@ -798,8 +799,8 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         $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.
index 26767cccf28c40627c3da102f88ca4c5f08584e9..a7bb9d466c31d40606b900cf322916edb990015b 100644 (file)
@@ -32,7 +32,7 @@
  * $Id$
  *
  */
-class CRM_Contact_Form_Edit_TagsandGroups {
+class CRM_Contact_Form_Edit_TagsAndGroups {
 
   /**
    * constant to determine which forms we are generating
@@ -57,13 +57,13 @@ class CRM_Contact_Form_Edit_TagsandGroups {
    * @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();
@@ -74,8 +74,8 @@ class CRM_Contact_Form_Edit_TagsandGroups {
       $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) {
@@ -122,7 +122,7 @@ class CRM_Contact_Form_Edit_TagsandGroups {
       }
     }
 
-    if ($type & CRM_Contact_Form_Edit_TagsandGroups::TAG) {
+    if ($type & self::TAG) {
       $fName = 'tag';
       if ($fieldName) {
         $fName = $fieldName;
@@ -163,7 +163,7 @@ class CRM_Contact_Form_Edit_TagsandGroups {
    * @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';
index 629f0c3df0fcffa7ad7355c15bf5191df0b6333a..e527546644ee725c55c013d829f81db4f9efa357 100644 (file)
@@ -131,7 +131,7 @@ class CRM_Core_Resources {
     if ($cacheCodeKey !== NULL) {
       $this->cacheCode = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, $cacheCodeKey);
     }
-    if (! $this->cacheCode) {
+    if (!$this->cacheCode) {
       $this->resetCacheCode();
     }
   }