From 2d996334f5ebc05a4d460d9e803f55f2114f4a42 Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Mon, 15 Jan 2024 14:41:30 +0000 Subject: [PATCH] suppress 'Post Review to Slack' option if Slack is not configured --- ui/Reviews.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/Reviews.php b/ui/Reviews.php index c0ce23bd..fb492198 100644 --- a/ui/Reviews.php +++ b/ui/Reviews.php @@ -3,7 +3,7 @@ * Zookeeper Online * * @author Jim Mason - * @copyright Copyright (C) 1997-2023 Jim Mason + * @copyright Copyright (C) 1997-2024 Jim Mason * @link https://zookeeper.ibinx.com/ * @license GPL-3.0 * @@ -443,6 +443,9 @@ public function editReview() { $airnames[] = $row['airname']; $airnames[] = $self; + $slack = Engine::param('slack'); + $export = $slack && $slack['token'] && $slack['review_channel']; + $this->template = "review.edit.html"; $this->addVar("id", $id ?? 0); $this->addVar("album", $albums[0]); @@ -452,7 +455,7 @@ public function editReview() { $this->addVar("self", $self); $this->addVar("review", $review); $this->addVar("private", $_REQUEST["private"] ?? 0); - $this->addVar("exported", isset($exportid)); + $this->addVar("exported", !$export || isset($exportid)); $this->addVar("MAX_AIRNAME_LENGTH", IDJ::MAX_AIRNAME_LENGTH); $this->addVar("MAX_REVIEW_LENGTH", IReview::MAX_REVIEW_LENGTH); }