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} + + +
-