From c1f105226f07c1ddace921b3564b88c2af0dcedc Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 25 Dec 2023 08:25:37 +0000 Subject: [PATCH] =?UTF-8?q?refac:=20=EA=B8=B0=EC=A1=B4=20commandButton.php?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C=20-=20=EC=9D=B4=EC=A0=A0=20MainControlBar?= =?UTF-8?q?=EB=A1=9C=20=EB=8C=80=EC=B2=B4=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_template.php | 57 --------------------------------- hwe/old_index.php | 25 --------------- hwe/templates/commandButton.php | 27 ---------------- 3 files changed, 109 deletions(-) delete mode 100644 hwe/templates/commandButton.php diff --git a/hwe/func_template.php b/hwe/func_template.php index 9b0828dc..dcb3dacb 100644 --- a/hwe/func_template.php +++ b/hwe/func_template.php @@ -148,63 +148,6 @@ function allButton(bool $seizeNPCMode, array $opts = []) ], $opts)); } - -function commandButton(array $opts = []) -{ - $session = Session::getInstance(); - $userID = Session::getUserID(); - if (!$session->isGameLoggedIn()) { - return ''; - } - - $db = DB::db(); - $me = $db->queryFirstRow("select no,nation,officer_level,belong,permission,penalty from general where owner=%i", $userID); - - $nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i", $me['nation']) ?? [ - 'nation' => 0, - 'level' => 0, - 'secretlimit' => 99, - 'color' => '#000000' - ]; - - $bgColor = $nation['color'] ?? '#000000'; - $fgColor = newColor($bgColor); - - $templates = new \League\Plates\Engine(__DIR__ . '/templates'); - $showSecret = false; - $permission = checkSecretPermission($me); - $btnClassForTournament = $opts['btnClass']; - if ($opts['isTournamentApplicationOpen']) { - 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) { - $showSecret = false; - } - - return $templates->render('commandButton', array_merge([ - 'bgColor' => $bgColor, - 'fgColor' => $fgColor, - 'meLevel' => $me['officer_level'], - 'nationLevel' => $nation['level'], - 'showSecret' => $showSecret, - 'permission' => $permission, - 'btnClassForTournament' => $btnClassForTournament, - 'btnClassForBetting' => $btnClassForBetting, - ], $opts)); -} - function formatWounded(int $value, int $wound): string { if ($wound == 0) { diff --git a/hwe/old_index.php b/hwe/old_index.php index 901a775c..ff91e1aa 100644 --- a/hwe/old_index.php +++ b/hwe/old_index.php @@ -285,19 +285,6 @@ if ($lastVoteID) {
- '
', - 'splitBtnEnd' => '
', - 'splitZoneSign' => '', - 'splitZoneBegin' => '', - 'splitSubBtnBegin' => '
  • ', - 'splitSubBtnEnd' => '
  • ', - 'btnClass' => 'btn btn-sammo-nation', - 'btnSplitClass' => 'dropdown-item', - 'isTournamentApplicationOpen' => $isTournamentApplicationOpen, - 'isBettingActive' => $isBettingActive - ]) ?>
    @@ -398,18 +385,6 @@ if ($lastVoteID) { 국가 메뉴