modifies the option to check the form

This commit is contained in:
BJRambo 2016-03-27 03:11:25 +09:00
parent 24ea1e2b7b
commit 945a693773
3 changed files with 18 additions and 32 deletions

View file

@ -26,9 +26,12 @@ class ncenterliteAdminController extends ncenterlite
'document_read',
'layout_srl',
'mlayout_srl',
'voted_format',
'document_notify'
);
if(!$obj->use && $obj->disp_act == 'dispNcenterliteAdminConfig')
{
$config->use = array();
}
foreach($config_vars as $val)
{
@ -40,7 +43,6 @@ class ncenterliteAdminController extends ncenterlite
{
$config->{$val} = $obj->{$val};
}
if($obj->disp_act == 'dispNcenterliteAdminSeletedmid' && !$obj->hide_module_srls)
{
$config->hide_module_srls = array();
@ -50,15 +52,15 @@ class ncenterliteAdminController extends ncenterlite
$config->admin_comment_module_srls = array();
}
}
debugPrint($config);
if(!$config->document_notify)
$output = $oModuleController->updateModuleConfig('ncenterlite', $config);
if(!$output->toBool())
{
$config->document_notify = 'direct-comment';
return new Object(-1, 'message');
}
$this->setMessage('success_updated');
$oModuleController->updateModuleConfig('ncenterlite', $config);
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
{
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', $obj->disp_act);

View file

@ -11,7 +11,10 @@ class ncenterliteModel extends ncenterlite
{
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('ncenterlite');
if(!$config->use) $config->use = 'Y';
if(!$config->use)
{
$config->use = array();
}
if(!$config->display_use) $config->display_use = 'Y';
if(!$config->mention_names) $config->mention_names = 'nick_name';

View file

@ -11,16 +11,11 @@
<div class="x_control-group">
<label class="x_control-label"><span class="x_label x_label-important">{$lang->ncenterlite_warning}</span> {$lang->ncenterlite_io}</label>
<div class="x_controls">
<label class="x_inline">
<input type="radio" id="use_y" name="use" value="Y" checked="checked"|cond="$config->use == 'Y'" /> {$lang->ncenterlite_on}
</label>
<label class="x_inline">
<input type="radio" id="use_message" name="use" value="message" checked="checked"|cond="$config->use == 'message'" /> {$lang->ncenterlite_only_message}
</label>
<label class="x_inline">
<input type="radio" id="use_n" name="use" value="N" checked="checked"|cond="$config->use == 'N'" /> {$lang->ncenterlite_off}
</label>
<p class="x_help-block"><span class="x_label x_label-important">{$lang->ncenterlite_warning}</span> {$lang->ncenterlite_io_about}</p>
<label for="notify_mention" class="x_inline"><input type="checkbox" name="use[mention]" id="notify_mention" value="1" checked="checked"|cond="isset($config->use[mention])" /> mention</label>
<label for="notify_comment" class="x_inline"><input type="checkbox" name="use[comment]" id="notify_comment" value="1" checked="checked"|cond="isset($config->use[comment])" /> comment</label>
<label for="notify_comment_comment" class="x_inline"><input type="checkbox" name="use[comment_comment]" id="notify_comment_comment" value="1" checked="checked"|cond="isset($config->use[comment_comment])" /> comment_comment</label>
<label for="notify_vote" class="x_inline"><input type="checkbox" name="use[vote]" id="notify_vote" value="1" checked="checked"|cond="isset($config->use[vote])" /> vote</label>
<label for="notify_message" class="x_inline"><input type="checkbox" name="use[message]" id="notify_message" value="1" checked="checked"|cond="isset($config->use[message])" /> message</label>
</div>
</div>
<div class="x_control-group">
@ -84,14 +79,6 @@
<p class="x_help-block">회원정보보기에서 메뉴 목록에 회원알림센터 설정 및 회원알림목록을 접근할 수잇는 페이지를 노출하거나 노출 시키지 않을 수 있습니다.</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->ncenterlite_document_event_vote}</label>
<div class="x_controls">
<label class="x_inline"><input type="radio" name="voted_format" value="Y" checked="checked"|cond="$config->voted_format == 'Y'" /> {$lang->ncenterlite_activate}</label>
<label class="x_inline"><input type="radio" name="voted_format" value="N" checked="checked"|cond="$config->voted_format == 'N'" /> {$lang->ncenterlite_inactivate}</label>
<p>{$lang->ncenterlite_document_event_vote_about}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->ncenterlite_document_event_read}</label>
<div class="x_controls">
@ -100,13 +87,7 @@
<p>{$lang->ncenterlite_document_event_read_about}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->ncenterlite_commnet_event}</label>
<div class="x_controls">
<label class="x_inline"><input type="radio" name="document_notify" value="all-comment" checked="checked"|cond="$config->document_notify == 'all-comment'" /> {$lang->ncenterlite_commnet_event_noti_all}</label>
<label class="x_inline"><input type="radio" name="document_notify" value="direct-comment" checked="checked"|cond="$config->document_notify == 'direct-comment'" /> {$lang->ncenterlite_commnet_event_noti_some}</label>
</div>
</div>
</section>
<div class="x_clearfix btnArea">