From f58464a1e3cdab9a84f263285c77ae99e91270af Mon Sep 17 00:00:00 2001 From: 0x7d5 <86822737+VladimirLapskiy@users.noreply.github.com> Date: Mon, 13 Sep 2021 18:47:10 +0500 Subject: [PATCH] Admin: Added tabs in section club --- Web/Presenters/AdminPresenter.php | 12 ++- Web/Presenters/templates/Admin/Club.xml | 127 ++++++++++++++++++++++-- 2 files changed, 126 insertions(+), 13 deletions(-) diff --git a/Web/Presenters/AdminPresenter.php b/Web/Presenters/AdminPresenter.php index 9b8db0e6..64620704 100644 --- a/Web/Presenters/AdminPresenter.php +++ b/Web/Presenters/AdminPresenter.php @@ -80,23 +80,29 @@ final class AdminPresenter extends OpenVKPresenter if(!$club) $this->notFound(); + $this->template->mode = in_array($this->queryParam("act"), ["main", "ban", "followers"]) ? $this->queryParam("act") : "main"; + $this->template->club = $club; + $this->template->followers = $this->template->club->getFollowers((int) ($this->queryParam("p") ?? 1)); + if($_SERVER["REQUEST_METHOD"] !== "POST") return; - switch($_POST["act"] ?? "info") { + switch($this->queryParam("act")) { default: - case "info": + case "main": $club->setOwner($this->postParam("id_owner")); $club->setName($this->postParam("name")); $club->setAbout($this->postParam("about")); $club->setShortCode($this->postParam("shortcode")); $club->setVerified(empty($this->postParam("verify") ? 0 : 1)); + $club->save(); + break; + case "ban": $club->setBlock_reason($this->postParam("ban_reason")); $club->save(); break; - } } diff --git a/Web/Presenters/templates/Admin/Club.xml b/Web/Presenters/templates/Admin/Club.xml index 0c9619de..80ef85f7 100644 --- a/Web/Presenters/templates/Admin/Club.xml +++ b/Web/Presenters/templates/Admin/Club.xml @@ -10,8 +10,27 @@ {block content} + +{var isMain = $mode === 'main'} +{var isBan = $mode === 'ban'} +{var isFollowers = $mode === 'followers'} + +{if $isMain} + + +
-