Code for CiviCRM 4.3.x