mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Improve compatibility with old ncenterlite skins
This commit is contained in:
parent
824d0c5ae9
commit
b5b74644e5
2 changed files with 31 additions and 6 deletions
|
|
@ -76,6 +76,15 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
$vars = Context::getRequestVars();
|
||||
$notify_types = NcenterliteModel::getNotifyTypes();
|
||||
$is_old_skin = false;
|
||||
foreach ($notify_types as $type => $srl)
|
||||
{
|
||||
if (isset($vars->{$type . '_notify'}))
|
||||
{
|
||||
$is_old_skin = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
|
|
@ -84,13 +93,23 @@ class ncenterliteController extends ncenterlite
|
|||
if ($type !== 'admin_content' && $type !== 'custom')
|
||||
{
|
||||
$disabled_list = array();
|
||||
foreach (['web', 'mail', 'sms', 'push'] as $method)
|
||||
if ($is_old_skin)
|
||||
{
|
||||
if (isset($config->use[$type][$method]) && $config->use[$type][$method])
|
||||
if (isset($vars->{$type . '_notify'}) && $vars->{$type . '_notify'} === 'N')
|
||||
{
|
||||
if (!isset($vars->use[$type][$method]) || !$vars->use[$type][$method])
|
||||
$disabled_list = ['!web', '!mail', '!sms', '!push'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (['web', 'mail', 'sms', 'push'] as $method)
|
||||
{
|
||||
if (isset($config->use[$type][$method]) && $config->use[$type][$method])
|
||||
{
|
||||
$disabled_list[] = '!' . $method;
|
||||
if (!isset($vars->use[$type][$method]) || !$vars->use[$type][$method])
|
||||
{
|
||||
$disabled_list[] = '!' . $method;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,10 +66,16 @@ class ncenterliteView extends ncenterlite
|
|||
}
|
||||
}
|
||||
|
||||
$user_config = NcenterliteModel::getUserConfig($member_srl);
|
||||
$notify_types = NcenterliteModel::getNotifyTypes();
|
||||
foreach ($notify_types as $type => $srl)
|
||||
{
|
||||
$user_config->{$type . '_notify'} = $user_config->{$type} ? 'Y' : 'N';
|
||||
}
|
||||
Context::set('member_info', $member_info);
|
||||
Context::set('user_config', NcenterliteModel::getUserConfig($member_srl));
|
||||
Context::set('notify_types', $notify_types);
|
||||
Context::set('user_config', $user_config);
|
||||
Context::set('module_config', NcenterliteModel::getConfig());
|
||||
Context::set('notify_types', NcenterliteModel::getNotifyTypes());
|
||||
Context::set('sms_available', Rhymix\Framework\SMS::getDefaultDriver()->getName() !== 'Dummy');
|
||||
Context::set('push_available', count(Rhymix\Framework\Config::get('push.types')) > 0);
|
||||
$this->setTemplateFile('userconfig');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue