Merge pull request #4003 from civicrm/4.5
[civicrm-core.git] / CRM / Admin / Page / Options.php
index 7ef8bcd1abce438df5a9306fcee94216749e9424..efdba99f13c0bb76982a9ffd0613f4fa3a581c02 100644 (file)
@@ -72,6 +72,14 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    */
   static $_gId = NULL;
 
+  /**
+   * A boolean determining if you can add options to this group in the GUI
+   *
+   * @var boolean
+   * @static
+   */
+  static $_isLocked = FALSE;
+
   /**
    * Obtains the group name from url string or id from $_GET['gid'].
    * Sets the title.
@@ -88,6 +96,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
     elseif (!self::$_gName && !empty($_GET['gid'])) {
       self::$_gId = $_GET['gid'];
       self::$_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gId, 'name');
+      self::$_isLocked = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gId, 'is_locked');
       $breadCrumb = array(
         'title' => ts('Option Groups'),
         'url' => CRM_Utils_System::url('civicrm/admin/options', 'reset=1'),
@@ -134,7 +143,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
           'communication_style',
           'case_status', 'encounter_medium',
           'case_type', 'payment_instrument',
-          'soft_credit_type'
+          'soft_credit_type', 'website_type'
         )
       )) {
       $this->assign('showIsDefault', TRUE);
@@ -147,6 +156,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
     if (self::$_gName == 'participant_role') {
       $this->assign('showCounted', TRUE);
     }
+    $this->assign('isLocked', self::$_isLocked);
     $config = CRM_Core_Config::singleton();
     if (self::$_gName == 'activity_type') {
       $this->assign('showComponent', TRUE);
@@ -271,6 +281,8 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
   /**
    * Get user context.
    *
+   * @param null $mode
+   *
    * @return string user context.
    */
   function userContext($mode = NULL) {