mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix max_input_vars error when there are too many levels
- max_input_vars 설정과 무관하게 레벨 수를 늘릴 수 있도록 조정 (레벨 관련 POST 변수들을 하나로 합쳐서 전송) - 허용되는 최대 레벨 수를 1000에서 10000으로 늘림 (단, 권장하는 최대 수는 여전히 1000임)
This commit is contained in:
parent
c34a9a9005
commit
125dea44b6
5 changed files with 26 additions and 15 deletions
|
|
@ -6,7 +6,7 @@ $lang->about_act_config = 'Each module like board/blog has its own actions such
|
|||
$lang->point_io = 'Point module On';
|
||||
$lang->about_point_io = 'Point module can be on or off. If you OFF this module, every triggers will be deleted from database and will not be called by Rhymix Core. Point record would be preserved.';
|
||||
$lang->max_level = 'Max Level';
|
||||
$lang->about_max_level = 'You may set the max level. Level icons should be considered and 1000 is the maximum value you can set.<br />The maximum possible value is also restricted by the max_input_vars setting of the server. The current maximum is around %d.';
|
||||
$lang->about_max_level = 'You may set the max level. Level icons should be considered, and it is strongly recommended that you keep this value below 1000.';
|
||||
$lang->level_icon = 'Level Icon';
|
||||
$lang->about_level_icon = 'Path of level icon is "./module/point/icons/[level].gif" and max level could be different with icon set. So please be careful';
|
||||
$lang->point_name = 'Point Name';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ $lang->about_act_config = '게시판, 블로그 등 각 페이지마다 글 작
|
|||
$lang->point_io = '포인트 모듈 켜기';
|
||||
$lang->about_point_io = '체크 하면 포인트 모듈 기능을 켤 수 있습니다. 포인트 모듈 기능을 끌 경우, 포인트 모듈의 모든 트리거가 삭제됩니다. 포인트 기록은 유지되지만 새로 기록 되지는 않습니다.';
|
||||
$lang->max_level = '최고 레벨';
|
||||
$lang->about_max_level = '최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두어야 하고 최고 레벨은 1000이 한계입니다.<br />서버의 max_input_vars 설정이 낮은 경우 최고 레벨에도 제한이 있을 수 있습니다. 이 서버에서는 %d까지 가능합니다.';
|
||||
$lang->about_max_level = '최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두어야 하고, 1000레벨 이상은 권장하지 않습니다.';
|
||||
$lang->level_icon = '레벨 아이콘';
|
||||
$lang->about_level_icon = '레벨 아이콘은 ./modules/point/icons/레벨.gif 로 지정되며 최고레벨과 아이콘셋이 다를 수 있으니 주의해주세요!';
|
||||
$lang->point_name = '포인트 이름';
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class pointAdminController extends point
|
|||
|
||||
// The highest level
|
||||
$config->max_level = $args->max_level;
|
||||
if($config->max_level>1000) $config->max_level = 1000;
|
||||
if($config->max_level>10000) $config->max_level = 10000;
|
||||
if($config->max_level<1) $config->max_level = 1;
|
||||
|
||||
// Set the level icon
|
||||
|
|
@ -141,13 +141,15 @@ class pointAdminController extends point
|
|||
|
||||
$config->group_reset = $args->group_reset;
|
||||
$config->group_ratchet = $args->group_ratchet;
|
||||
|
||||
// Per-level point configurations
|
||||
unset($config->level_step);
|
||||
$level_step = array_map('intval', explode(',', $args->level_step ?: '0'));
|
||||
$config->level_step = array();
|
||||
for($i=1;$i<=$config->max_level;$i++)
|
||||
{
|
||||
$key = "level_step_".$i;
|
||||
$config->level_step[$i] = (int)$args->{$key};
|
||||
$config->level_step[$i] = isset($level_step[$i - 1]) ? $level_step[$i - 1] : array_last($level_step);
|
||||
}
|
||||
|
||||
// A function to calculate per-level points
|
||||
$config->expression = $args->expression;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,13 +15,6 @@
|
|||
<span class="x_help-inline">{$lang->about_point_io}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="max_level" class="x_control-label">{$lang->max_level}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" max="{$system_max_level}" value="{$config->max_level}" name="max_level" id="max_level" />
|
||||
<p class="x_help-block">{sprintf($lang->about_max_level, $system_max_level)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="point_name" class="x_control-label">{$lang->point_name}</label>
|
||||
<div class="x_controls">
|
||||
|
|
@ -29,6 +22,13 @@
|
|||
<p class="x_help-block">{$lang->about_point_name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="max_level" class="x_control-label">{$lang->max_level}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" value="{$config->max_level}" name="max_level" id="max_level" />
|
||||
<p class="x_help-block">{$lang->about_max_level}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="level_icon" class="x_control-label">{$lang->level_icon}</label>
|
||||
<div class="x_controls">
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
<tr>
|
||||
<td>1</td>
|
||||
<td><img src="{getUrl()}modules/point/icons/{$config->level_icon}/1.gif" alt="1" /></td>
|
||||
<td><label for="level_step_1" style="margin:0"><input type="number" id="level_step_1" name="level_step_1" value="{$config->level_step[1]}" style="width:120px;text-align:right" /> {$config->point_name}</label></td>
|
||||
<td><label for="level_step_1" style="margin:0"><input type="number" id="level_step_1" class="level_step" value="{$config->level_step[1]}" style="width:120px;text-align:right" /> {$config->point_name}</label></td>
|
||||
{@$point_group_item = $point_group[1]}
|
||||
{@$title=array()}
|
||||
<!--@if($point_group_item)-->
|
||||
|
|
@ -220,12 +220,13 @@
|
|||
<tr class="row{(($i-1)%2+1)}">
|
||||
<td>{$i}</td>
|
||||
<td><img src="{getUrl()}modules/point/icons/{$config->level_icon}/{$i}.gif" alt="{$i}" /></td>
|
||||
<td><label for="level_step_{$i}" style="margin:0"><input type="number" id="level_step_{$i}" name="level_step_{$i}" value="{$config->level_step[$i]}" style="width:120px;text-align:right" /> {$config->point_name}</label></td>
|
||||
<td><label for="level_step_{$i}" style="margin:0"><input type="number" id="level_step_{$i}" class="level_step" value="{$config->level_step[$i]}" style="width:120px;text-align:right" /> {$config->point_name}</label></td>
|
||||
<td>{implode(', ', $title)}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</table>
|
||||
<div class="x_clearfix">
|
||||
<input id="level_step" name="level_step" type="hidden" value="{implode(',', $config->level_step)}" />
|
||||
<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@
|
|||
|
||||
jQuery(function($){
|
||||
|
||||
$('#point_module_config_form').on('submit', function() {
|
||||
var level_step = [];
|
||||
$(this).find('.level_step').each(function() {
|
||||
level_step.push(parseInt($(this).val(), 10));
|
||||
});
|
||||
$('#level_step').val(level_step.join(','));
|
||||
});
|
||||
|
||||
$('button.calc_point').click(function(){
|
||||
var $this, form, elems, reset, el, fn, i=0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue