mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Fix error while saving custom list of mention suffixes
This commit is contained in:
parent
97596e2e23
commit
ecda653e77
4 changed files with 25 additions and 83 deletions
|
|
@ -28,40 +28,47 @@ class ncenterliteAdminController extends ncenterlite
|
|||
'mlayout_srl',
|
||||
'document_notify'
|
||||
);
|
||||
if(!$obj->use && $obj->disp_act == 'dispNcenterliteAdminConfig')
|
||||
{
|
||||
$config->use = array();
|
||||
}
|
||||
|
||||
foreach($config_vars as $val)
|
||||
{
|
||||
if($obj->{$val})
|
||||
{
|
||||
$config->{$val} = $obj->{$val};
|
||||
}
|
||||
if($obj->disp_act == 'dispNcenterliteAdminConfig' && !$obj->anonymous_name)
|
||||
}
|
||||
|
||||
if ($obj->disp_act == 'dispNcenterliteAdminConfig')
|
||||
{
|
||||
if (!$obj->use)
|
||||
{
|
||||
$config->use = array();
|
||||
}
|
||||
if (!$config->anonymous_name)
|
||||
{
|
||||
$config->anonymous_name = null;
|
||||
}
|
||||
if($obj->disp_act == 'dispNcenterliteAdminConfig')
|
||||
if (!$config->mention_suffixes)
|
||||
{
|
||||
if ($obj->mention_suffixes)
|
||||
{
|
||||
$config->mention_suffixes = array_map('trim', implode(',', $obj->mention_suffixes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$config->mention_suffixes = array();
|
||||
}
|
||||
$config->mention_suffixes = array();
|
||||
}
|
||||
if($obj->disp_act == 'dispNcenterliteAdminSeletedmid' && !$obj->hide_module_srls)
|
||||
if (!is_array($config->mention_suffixes))
|
||||
{
|
||||
$config->mention_suffixes = array_map('trim', explode(',', $config->mention_suffixes));
|
||||
}
|
||||
}
|
||||
|
||||
if ($obj->disp_act == 'dispNcenterliteAdminSeletedmid')
|
||||
{
|
||||
if (!$config->hide_module_srls)
|
||||
{
|
||||
$config->hide_module_srls = array();
|
||||
}
|
||||
if($obj->disp_act == 'dispNcenterliteAdminSeletedmid' && !$obj->admin_notify_module_srls)
|
||||
if (!$config->admin_notify_module_srls)
|
||||
{
|
||||
$config->admin_notify_module_srls = array();
|
||||
}
|
||||
}
|
||||
|
||||
$output = $oModuleController->updateModuleConfig('ncenterlite', $config);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
<fields>
|
||||
<field name="use" />
|
||||
<field name="display_use" />
|
||||
<field name="display_use" />
|
||||
<field name="mention_suffixes" />
|
||||
<field name="mention_names" />
|
||||
<field name="document_notify" />
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->mention_suffixes}</label>
|
||||
<div class="x_controls mention_option">
|
||||
<div class="x_controls">
|
||||
<label class="x_inline">
|
||||
<input type="text" name="mention_suffixes" value="{escape(implode(', ', $config->mention_suffixes), false)}" />
|
||||
</label>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->mention_suffix_always_cut}</label>
|
||||
<div class="x_controls mention_option">
|
||||
<div class="x_controls">
|
||||
<label class="x_inline">
|
||||
<input type="radio" id="mention_suffix_always_cut_y" name="mention_suffix_always_cut" value="Y" checked="checked"|cond="$config->mention_suffix_always_cut == 'Y'" /> {$lang->mention_suffix_always_cut_y}
|
||||
</label>
|
||||
|
|
|
|||
|
|
@ -30,70 +30,6 @@ function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj)
|
|||
sel.selectedIndex = selected_index;
|
||||
}
|
||||
|
||||
(function($) {
|
||||
function debugPrint(msg){if(typeof console == 'object' && typeof console.log == 'function'){console.log(msg)}};
|
||||
|
||||
$(function(){
|
||||
var $mentionOption = $('.mention_option');
|
||||
var $checkbox = $('input:checkbox', $mentionOption);
|
||||
var $preview = $('ul.preview', $mentionOption);
|
||||
var $previewItem = $('li', $preview);
|
||||
var mentionRegx = /(^|\s)@([^\s]+)/ig;
|
||||
|
||||
$mentionOption.bind('prepare', function() {
|
||||
mentionRegx = ['(^|\\s)@([^\\s', '', ']+)'];
|
||||
var mentionSplit = [];
|
||||
$checkbox.each(function(){
|
||||
if($(this).is(':checked')) mentionSplit.push($(this).data('mention-split'));
|
||||
});
|
||||
mentionRegx[1] = mentionSplit.join('');
|
||||
mentionRegx = mentionRegx.join('');
|
||||
mentionRegx = new RegExp(mentionRegx, 'ig');
|
||||
});
|
||||
|
||||
$preview.bind('prepare', function() {
|
||||
$previewItem.each(function() {
|
||||
var $this = $(this);
|
||||
var $strong = $('strong', $this);
|
||||
var names = [];
|
||||
$strong.contents().each(function() {
|
||||
names.push(this.nodeValue.replace('@', ''));
|
||||
});
|
||||
$this.data('mention-target', names);
|
||||
});
|
||||
});
|
||||
$preview.triggerHandler('prepare');
|
||||
|
||||
$preview.bind('preview', function() {
|
||||
$mentionOption.triggerHandler('prepare');
|
||||
$previewItem.each(function() {
|
||||
var $this = $(this);
|
||||
var target = $this.data('mention-target');
|
||||
var defaultClass = $this.data('mention-default');
|
||||
var content = $this.text();
|
||||
var matched = content.match(mentionRegx);
|
||||
if(matched) $.map(matched, function(text, idx) { matched[idx] = $.trim(text.replace(['@'], ''))});
|
||||
$this.attr('class', (compare(target, matched)) ? 'enable' : (defaultClass && defaultClass == 'enable') ? 'disable' : '');
|
||||
});
|
||||
});
|
||||
$preview.triggerHandler('preview');
|
||||
$checkbox.click(function() {$preview.triggerHandler('preview');})
|
||||
|
||||
function compare(arrayA, arrayB) {
|
||||
if(!arrayA || !arrayB) return false;
|
||||
if(arrayA.length != arrayB.length) return false;
|
||||
var a = $.extend(true, [], arrayA);
|
||||
var b = $.extend(true, [], arrayB);
|
||||
for(var i = 0, l = a.length; i < l; i++) {
|
||||
if(a[i] !== b[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
}) (jQuery);
|
||||
|
||||
|
||||
function doDummyDataInsert()
|
||||
{
|
||||
jQuery.exec_json('ncenterlite.procNcenterliteAdminInsertDummyData', {}, function completeGetDummyInfo(ret_obj){alert(ret_obj.message)});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue