Merge pull request #3749 from civicrm/4.4
[civicrm-core.git] / CRM / Admin / Page / ContactType.php
index 3c191525f5eb8e6f6b7967f5672077f8069254ba..47010c6217f22aac027a6992f328a682e5c114d2 100644 (file)
@@ -1,9 +1,9 @@
 <?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.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -73,19 +75,13 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
         CRM_Core_Action::DISABLE =>
         array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' .
-          'CRM_Contact_BAO_ContactType' . '\',\'' . 'enable-disable' .
-          '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Contact Type'),
         ),
         CRM_Core_Action::ENABLE =>
         array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' .
-          'CRM_Contact_BAO_ContactType' . '\',\'' . 'disable-enable' .
-          '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Contact Type'),
         ),
         CRM_Core_Action::DELETE =>
@@ -114,12 +110,12 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
     $rows = CRM_Contact_BAO_ContactType::contactTypeInfo(TRUE);
     foreach ($rows as $key => $value) {
       $mask = NULL;
-      if (CRM_Utils_Array::value('is_reserved', $value)) {
+      if (!empty($value['is_reserved'])) {
         $mask = CRM_Core_Action::UPDATE;
       }
       else {
         $mask -= CRM_Core_Action::DELETE - 2;
-        if (CRM_Utils_Array::value('is_active', $value)) {
+        if (!empty($value['is_active'])) {
           $mask -= CRM_Core_Action::ENABLE;
         }
         else {
@@ -159,6 +155,8 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
   /**
    * Get user context.
    *
+   * @param null $mode
+   *
    * @return string user context.
    */
   function userContext($mode = NULL) {