From 81eb6ccb6efc1ea5039c5240607712dd3d21ab90 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 22 Mar 2023 14:35:52 -0600 Subject: [PATCH] Notifications: Update [human] chain list to use correct option format --- notifications/inc/class.notifications.inc.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/notifications/inc/class.notifications.inc.php b/notifications/inc/class.notifications.inc.php index 5d6c6344fd..bd031dad63 100644 --- a/notifications/inc/class.notifications.inc.php +++ b/notifications/inc/class.notifications.inc.php @@ -780,18 +780,22 @@ class notifications { foreach($chain_groups as $name => $arr_name) { ${$arr_name.$suffix} = array(); foreach(array_keys(${$arr_name}) as $key) { - if($arr_name == 'disabled_chains') { - ${$arr_name.$suffix}[$key] = '('.lang('Disabled').') '.lang($this->chains_descriptions[$key]); - } else { - ${$arr_name.$suffix}[$key] = lang($this->chains_descriptions[$key]); - } + ${$arr_name . $suffix}[] = [ + 'value' => $key, + 'label' => lang($this->chains_descriptions[$key]), + 'disabled' => $arr_name == 'disabled_chains' + ]; } } // summarize all groups with minimum one chain to the final array $chains_final = array(); foreach($chain_groups as $name => $arr_name) { - if(is_array(${$arr_name.$suffix}) && count(${$arr_name.$suffix}) > 0) { - $chains_final[$name] = ${$arr_name.$suffix}; + if(is_array(${$arr_name.$suffix}) && count(${$arr_name.$suffix}) > 0) + { + $chains_final[] = array( + 'label' => $name, + 'value' => ${$arr_name . $suffix} + ); } } return $chains_final;