mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-25 21:32:51 +09:00
Allow point reversion policies to be customized for each module
This commit is contained in:
parent
5f8586ec8f
commit
7a6400f39d
4 changed files with 43 additions and 13 deletions
|
|
@ -257,7 +257,7 @@ class PointAdminController extends Point
|
|||
}
|
||||
|
||||
$config = [];
|
||||
$keys = [
|
||||
$numeric_keys = [
|
||||
'insert_document',
|
||||
'insert_comment',
|
||||
'upload_file',
|
||||
|
|
@ -274,8 +274,13 @@ class PointAdminController extends Point
|
|||
'voted_comment',
|
||||
'blamed_comment'
|
||||
];
|
||||
$boolean_keys = [
|
||||
'insert_document_revert_on_delete',
|
||||
'insert_comment_revert_on_delete',
|
||||
'upload_file_revert_on_delete'
|
||||
];
|
||||
|
||||
foreach ($keys as $key)
|
||||
foreach ($numeric_keys as $key)
|
||||
{
|
||||
$value = trim(Context::get($key) ?? '');
|
||||
if ($value !== '')
|
||||
|
|
@ -283,6 +288,14 @@ class PointAdminController extends Point
|
|||
$config[$key] = (int)$value;
|
||||
}
|
||||
}
|
||||
foreach ($boolean_keys as $key)
|
||||
{
|
||||
$value = trim(Context::get($key) ?? '');
|
||||
if ($value !== '')
|
||||
{
|
||||
$config[$key] = ($value === 'Y');
|
||||
}
|
||||
}
|
||||
|
||||
$oModuleController->insertModulePartConfig('point', $srl, $config);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue