diff --git a/VKAPI/Handlers/Groups.php b/VKAPI/Handlers/Groups.php index ffa4fedd..f83079ec 100644 --- a/VKAPI/Handlers/Groups.php +++ b/VKAPI/Handlers/Groups.php @@ -347,7 +347,10 @@ final class Groups extends VKAPIRequestHandler !empty($topics) ? $club->setEveryone_Can_Create_Topics($topics) : NULL; !empty($adminlist) ? $club->setAdministrators_List_Display($adminlist) : NULL; !empty($topicsAboveWall) ? $club->setDisplay_Topics_Above_Wall($topicsAboveWall) : NULL; - !empty($hideFromGlobalFeed) ? $club->setHide_From_Global_Feed($hideFromGlobalFeed) : NULL; + + if (!$club->isHidingFromGlobalFeedEnforced()) { + !empty($hideFromGlobalFeed) ? $club->setHide_From_Global_Feed($hideFromGlobalFeed) : NULL; + } in_array($audio, [0, 1]) ? $club->setEveryone_can_upload_audios($audio) : NULL; diff --git a/Web/Models/Entities/Club.php b/Web/Models/Entities/Club.php index a46eb573..dc1c356e 100644 --- a/Web/Models/Entities/Club.php +++ b/Web/Models/Entities/Club.php @@ -152,6 +152,11 @@ class Club extends RowModel return (bool) $this->getRecord()->hide_from_global_feed; } + function isHidingFromGlobalFeedEnforced(): bool + { + return (bool) $this->getRecord()->enforce_hiding_from_global_feed; + } + function getType(): int { return $this->getRecord()->type; diff --git a/Web/Presenters/AdminPresenter.php b/Web/Presenters/AdminPresenter.php index cf68cd84..b8f480ca 100644 --- a/Web/Presenters/AdminPresenter.php +++ b/Web/Presenters/AdminPresenter.php @@ -161,6 +161,7 @@ final class AdminPresenter extends OpenVKPresenter $club->setShortCode($this->postParam("shortcode")); $club->setVerified(empty($this->postParam("verify") ? 0 : 1)); $club->setHide_From_Global_Feed(empty($this->postParam("hide_from_global_feed") ? 0 : 1)); + $club->setEnforce_Hiding_From_Global_Feed(empty($this->postParam("enforce_hiding_from_global_feed") ? 0 : 1)); $club->save(); break; case "ban": diff --git a/Web/Presenters/GroupPresenter.php b/Web/Presenters/GroupPresenter.php index beeede13..5e8919b4 100644 --- a/Web/Presenters/GroupPresenter.php +++ b/Web/Presenters/GroupPresenter.php @@ -233,7 +233,10 @@ final class GroupPresenter extends OpenVKPresenter $club->setEveryone_Can_Create_Topics(empty($this->postParam("everyone_can_create_topics")) ? 0 : 1); $club->setDisplay_Topics_Above_Wall(empty($this->postParam("display_topics_above_wall")) ? 0 : 1); $club->setEveryone_can_upload_audios(empty($this->postParam("upload_audios")) ? 0 : 1); - $club->setHide_From_Global_Feed(empty($this->postParam("hide_from_global_feed")) ? 0 : 1); + + if (!$club->isHidingFromGlobalFeedEnforced()) { + $club->setHide_From_Global_Feed(empty($this->postParam("hide_from_global_feed") ? 0 : 1)); + } $website = $this->postParam("website") ?? ""; if(empty($website)) diff --git a/Web/Presenters/templates/Admin/Club.xml b/Web/Presenters/templates/Admin/Club.xml index a8f3ad50..47a2fb00 100644 --- a/Web/Presenters/templates/Admin/Club.xml +++ b/Web/Presenters/templates/Admin/Club.xml @@ -65,6 +65,10 @@ isHideFromGlobalFeedEnabled()} checked {/if} /> +