diff --git a/hwe/func_template.php b/hwe/func_template.php index 5ef56848..09e6eece 100644 --- a/hwe/func_template.php +++ b/hwe/func_template.php @@ -167,6 +167,20 @@ function commandButton(array $opts = []) $templates = new \League\Plates\Engine(__DIR__ . '/templates'); $showSecret = false; $permission = checkSecretPermission($me); + $btnClassForTournament = $opts['btnClass']; + if ($opts['isTournamentActive']) { + if ($btnClassForTournament != 'dropdown-item') { + $btnClassForTournament = 'toolbarButton2'; + } + } + + $btnClassForBetting = $opts['btnClass']; + if ($opts['isBettingActive']) { + if ($btnClassForTournament != 'dropdown-item') { + $btnClassForBetting = 'toolbarButton2'; + } + } + if ($permission >= 1) { $showSecret = true; } else if ($me['officer_level'] == 0) { @@ -180,6 +194,8 @@ function commandButton(array $opts = []) 'nationLevel' => $nation['level'], 'showSecret' => $showSecret, 'permission' => $permission, + 'btnClassForTournament' => $btnClassForTournament, + 'btnClassForBetting' => $btnClassForBetting, ], $opts)); } diff --git a/hwe/index.php b/hwe/index.php index 186eee71..ad0f8374 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -88,6 +88,8 @@ $serverName = UniqueConst::$serverName; $serverCnt = $gameStor->server_cnt; $auctionCount = $db->queryFirstField('SELECT count(`no`) FROM auction'); +$isTournamentActive = $gameStor->tournament > 0; +$isBettingActive = $gameStor->tournament == 6; $myNationStatic = getNationStaticInfo($generalObj->getNationID()); $nationColorType = substr($myNationStatic['color'] ?? '#000000', 1); @@ -134,6 +136,8 @@ if (!$otherTextInfo) { 'baseColor2' => GameConst::$basecolor2, 'lastExecuted' => $gameStor->turntime, 'isLocked' => $plock, + 'isTournamentActive' => $isTournamentActive, + 'isBettingActive' => $isBettingActive ]) ?> @@ -169,16 +173,12 @@ if (!$otherTextInfo) {