Hide vote/blame log if respective setting is disabled #2523

This commit is contained in:
Kijin Sung 2025-03-14 01:37:51 +09:00
parent bb3ea5c9aa
commit 3f553d4d9c
2 changed files with 24 additions and 4 deletions

View file

@ -61,8 +61,10 @@ class Features
// Document features
$features->document->vote_up = ($document_config->use_vote_up ?? 'Y') !== 'N';
$features->document->vote_up_log = ($document_config->use_vote_up ?? 'Y') === 'S';
$features->document->vote_down = ($document_config->use_vote_down ?? 'Y') !== 'N';
$features->document->vote_log = ($document_config->use_vote_up ?? 'Y') === 'S' || ($document_config->use_vote_down ?? 'Y') === 'S';
$features->document->vote_down_log = ($document_config->use_vote_down ?? 'Y') === 'S';
$features->document->vote_log = $features->document->vote_up_log || $features->document->vote_down_log;
if (isset($document_config->allow_vote_cancel))
{
$features->document->cancel_vote = $document_config->allow_vote_cancel === 'Y';
@ -92,8 +94,10 @@ class Features
// Comment features
$features->comment->vote_up = ($comment_config->use_vote_up ?? 'Y') !== 'N';
$features->comment->vote_up_log = ($comment_config->use_vote_up ?? 'Y') === 'S';
$features->comment->vote_down = ($comment_config->use_vote_down ?? 'Y') !== 'N';
$features->comment->vote_log = ($comment_config->use_vote_up ?? 'Y') === 'S' || ($comment_config->use_vote_down ?? 'Y') === 'S';
$features->comment->vote_down_log = ($comment_config->use_vote_down ?? 'Y') === 'S';
$features->comment->vote_log = $features->comment->vote_up_log || $features->comment->vote_down_log;
if (isset($comment_config->allow_vote_cancel))
{
$features->comment->cancel_vote = $comment_config->allow_vote_cancel === 'Y';