From 52b034984246ce0f89148e4167bd531f672bca5a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 17 Aug 2015 17:39:43 -0700 Subject: [PATCH] CRM_Admin_Form_Setting - Use Setting.getoptions --- CRM/Admin/Form/Setting.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CRM/Admin/Form/Setting.php b/CRM/Admin/Form/Setting.php index b5cd289c7e..56116fdf0b 100644 --- a/CRM/Admin/Form/Setting.php +++ b/CRM/Admin/Form/Setting.php @@ -144,6 +144,12 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { $props['html_type'] == 'select' ? CRM_Utils_Array::value('html_attributes', $props) : NULL ); } + elseif ($add == 'addSelect') { + $options = civicrm_api3('Setting', 'getoptions', array( + 'field' => $setting, + )); + $this->addElement('select', $setting, ts($props['title']), $options['values'], CRM_Utils_Array::value('html_attributes', $props)); + } else { $this->$add($setting, ts($props['title'])); } @@ -161,6 +167,10 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { } } + public function getDefaultEntity() { + return 'Setting'; + } + /** * Process the form submission. */ -- 2.25.1