From 8c8a16356173bab4a3e3efae64c82aa894edf8fe Mon Sep 17 00:00:00 2001 From: BJRambo Date: Wed, 3 Feb 2021 13:35:48 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A0=EC=A0=80=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=EA=B0=92=EC=9D=84=20view=EC=97=90=EC=84=9C=20=EB=AF=B8?= =?UTF-8?q?=EB=A6=AC=20=EC=B2=98=EB=A6=AC=ED=95=98=EC=97=AC=20=EC=A0=84?= =?UTF-8?q?=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../m.skins/default/userconfig.html | 17 ++------- modules/ncenterlite/ncenterlite.view.php | 26 ++++++++++++- .../ncenterlite/skins/default/userconfig.html | 35 +++++++----------- .../skins/default_bottom/userconfig.html | 37 ++++++++----------- 4 files changed, 56 insertions(+), 59 deletions(-) diff --git a/modules/ncenterlite/m.skins/default/userconfig.html b/modules/ncenterlite/m.skins/default/userconfig.html index 3375bc6a7..140b4e787 100644 --- a/modules/ncenterlite/m.skins/default/userconfig.html +++ b/modules/ncenterlite/m.skins/default/userconfig.html @@ -17,26 +17,17 @@

{$lang->ncenterlite_userconfig_about} ({$lang->ncenterlite_userconfig_about_warning})

- {@ $uc = get_object_vars($user_config)}
- {@ $available = isset($module_config->use[$notify_type]['web']) && $module_config->use[$notify_type]['web'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('web', $uc[$notify_type]))} - - {@ $available = isset($module_config->use[$notify_type]['mail']) && $module_config->use[$notify_type]['mail'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('mail', $uc[$notify_type]))} - + + - {@ $available = isset($module_config->use[$notify_type]['sms']) && $module_config->use[$notify_type]['sms'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('sms', $uc[$notify_type]))} - + - {@ $available = isset($module_config->use[$notify_type]['push']) && $module_config->use[$notify_type]['push'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('push', $uc[$notify_type]))} - +

{sprintf($lang->get('ncenterlite_' . $notify_type . '_noti_about'), $logged_info->nick_name)}

diff --git a/modules/ncenterlite/ncenterlite.view.php b/modules/ncenterlite/ncenterlite.view.php index 85bd44dcd..7309ec39c 100644 --- a/modules/ncenterlite/ncenterlite.view.php +++ b/modules/ncenterlite/ncenterlite.view.php @@ -70,13 +70,35 @@ class ncenterliteView extends ncenterlite $user_config = NcenterliteModel::getUserConfig($member_srl) ?: new stdClass; $notify_types = NcenterliteModel::getUserSetNotifyTypes(); - foreach ($notify_types as $type => $srl) + + $userConfigArray = get_object_vars($user_config); + + $otherNotifyType = [ + 'web', + 'mail', + 'sms', + 'push', + ]; + + $user_selected = []; + foreach($notify_types as $notify_type => $notify_srl) { - $user_config->{$type . '_notify'} = $user_config->{$type} ? 'Y' : 'N'; + $user_config->{$notify_type . '_notify'} = $user_config->{$notify_type} ? 'Y' : 'N'; + $user_selected[$notify_type] = []; + foreach ($otherNotifyType as $item) + { + $available = isset($config->use[$notify_type][$item]) && $config->use[$notify_type][$item] !== 'N'; + $selected = (is_array($userConfigArray[$notify_type]) && in_array($item, $userConfigArray[$notify_type])); + $user_selected[$notify_type][$item] = new stdClass(); + $user_selected[$notify_type][$item]->available = $available; + $user_selected[$notify_type][$item]->selected = $selected; + } } + Context::set('member_info', $member_info); Context::set('notify_types', $notify_types); Context::set('user_config', $user_config); + Context::set('user_selected', $user_selected); Context::set('module_config', NcenterliteModel::getConfig()); Context::set('sms_available', Rhymix\Framework\SMS::getDefaultDriver()->getName() !== 'Dummy'); Context::set('push_available', count(Rhymix\Framework\Config::get('push.types') ?? []) > 0); diff --git a/modules/ncenterlite/skins/default/userconfig.html b/modules/ncenterlite/skins/default/userconfig.html index db0c60a58..91cf2eb8a 100644 --- a/modules/ncenterlite/skins/default/userconfig.html +++ b/modules/ncenterlite/skins/default/userconfig.html @@ -19,30 +19,21 @@

{$lang->ncenterlite_userconfig_about} ({$lang->ncenterlite_userconfig_about_warning})

- {@ $uc = get_object_vars($user_config)} -
- -
- {@ $available = isset($module_config->use[$notify_type]['web']) && $module_config->use[$notify_type]['web'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('web', $uc[$notify_type]))} - - {@ $available = isset($module_config->use[$notify_type]['mail']) && $module_config->use[$notify_type]['mail'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('mail', $uc[$notify_type]))} - - - {@ $available = isset($module_config->use[$notify_type]['sms']) && $module_config->use[$notify_type]['sms'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('sms', $uc[$notify_type]))} - - - - {@ $available = isset($module_config->use[$notify_type]['push']) && $module_config->use[$notify_type]['push'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('push', $uc[$notify_type]))} - - -

{sprintf($lang->get('ncenterlite_' . $notify_type . '_noti_about'), $logged_info->nick_name)}

-
+
+ +
+ + + + + + + + +

{sprintf($lang->get('ncenterlite_' . $notify_type . '_noti_about'), $logged_info->nick_name)}

+
diff --git a/modules/ncenterlite/skins/default_bottom/userconfig.html b/modules/ncenterlite/skins/default_bottom/userconfig.html index db0c60a58..0039565b5 100644 --- a/modules/ncenterlite/skins/default_bottom/userconfig.html +++ b/modules/ncenterlite/skins/default_bottom/userconfig.html @@ -19,30 +19,21 @@

{$lang->ncenterlite_userconfig_about} ({$lang->ncenterlite_userconfig_about_warning})

- {@ $uc = get_object_vars($user_config)} -
- -
- {@ $available = isset($module_config->use[$notify_type]['web']) && $module_config->use[$notify_type]['web'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('web', $uc[$notify_type]))} - - {@ $available = isset($module_config->use[$notify_type]['mail']) && $module_config->use[$notify_type]['mail'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('mail', $uc[$notify_type]))} - - - {@ $available = isset($module_config->use[$notify_type]['sms']) && $module_config->use[$notify_type]['sms'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('sms', $uc[$notify_type]))} - - - - {@ $available = isset($module_config->use[$notify_type]['push']) && $module_config->use[$notify_type]['push'] !== 'N'} - {@ $selected = (is_array($uc[$notify_type]) && in_array('push', $uc[$notify_type]))} - - -

{sprintf($lang->get('ncenterlite_' . $notify_type . '_noti_about'), $logged_info->nick_name)}

-
+
+ +
+ + + + + + + + +

{sprintf($lang->get('ncenterlite_' . $notify_type . '_noti_about'), $logged_info->nick_name)}

+
@@ -53,3 +44,5 @@
+ +