refac: 기존 commandButton.php 삭제
- 이젠 MainControlBar로 대체됨
This commit is contained in:
@@ -148,63 +148,6 @@ function allButton(bool $seizeNPCMode, array $opts = [])
|
|||||||
], $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
|
function formatWounded(int $value, int $wound): string
|
||||||
{
|
{
|
||||||
if ($wound == 0) {
|
if ($wound == 0) {
|
||||||
|
|||||||
@@ -285,19 +285,6 @@ if ($lastVoteID) {
|
|||||||
<div id="general-position"><?php generalInfo($generalObj); ?></div>
|
<div id="general-position"><?php generalInfo($generalObj); ?></div>
|
||||||
<div id="generalCommandButton" class="row gx-0">
|
<div id="generalCommandButton" class="row gx-0">
|
||||||
<div class="buttonPlate bg2">
|
<div class="buttonPlate bg2">
|
||||||
<?= commandButton([
|
|
||||||
'splitBtnBegin' => '<div class="btn-group">',
|
|
||||||
'splitBtnEnd' => '</div>',
|
|
||||||
'splitZoneSign' => '<button type="button" class="btn btn-sammo-nation dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false"><span class="visually-hidden">Toggle Dropdown</span></button>',
|
|
||||||
'splitZoneBegin' => '<ul class="dropdown-menu dropdown-menu-end">',
|
|
||||||
'splitZoneEnd' => '</ul>',
|
|
||||||
'splitSubBtnBegin' => '<li>',
|
|
||||||
'splitSubBtnEnd' => '</li>',
|
|
||||||
'btnClass' => 'btn btn-sammo-nation',
|
|
||||||
'btnSplitClass' => 'dropdown-item',
|
|
||||||
'isTournamentApplicationOpen' => $isTournamentApplicationOpen,
|
|
||||||
'isBettingActive' => $isBettingActive
|
|
||||||
])
|
|
||||||
?></div>
|
?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -398,18 +385,6 @@ if ($lastVoteID) {
|
|||||||
국가 메뉴
|
국가 메뉴
|
||||||
</div>
|
</div>
|
||||||
<ul class="dropdown-menu" aria-labelledby="navbarNation" id="navbarNationItems">
|
<ul class="dropdown-menu" aria-labelledby="navbarNation" id="navbarNationItems">
|
||||||
<?= commandButton([
|
|
||||||
'btnBegin' => '<li>',
|
|
||||||
'btnEnd' => '</li>',
|
|
||||||
'splitMainBegin' => '<div class="d-none">',
|
|
||||||
'splitMainEnd' => '</div>',
|
|
||||||
'splitSubBtnBegin' => '<li>',
|
|
||||||
'splitSubBtnEnd' => '</li>',
|
|
||||||
'btnClass' => 'dropdown-item',
|
|
||||||
'btnSplitClass' => 'dropdown-item',
|
|
||||||
'isTournamentApplicationOpen' => $isTournamentApplicationOpen,
|
|
||||||
'isBettingActive' => $isBettingActive
|
|
||||||
]) ?>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item dropup">
|
<li class="nav-item dropup">
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
<?=$btnBegin??''?><a href='v_board.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>회 의 실</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_board.php?isSecret=true' class='commandButton <?= $permission >= 2 ? '' : 'disabled' ?> <?=$btnClass??""?>'>기 밀 실</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_troop.php' class='commandButton <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?> <?=$btnClass??""?>'>부대 편성</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='t_diplomacy.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>외 교 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myBossInfo.php' class='commandButton <?= $meLevel >= 1 ? '' : 'disabled' ?> <?=$btnClass??""?>'>인 사 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_nationStratFinan.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>내 무 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_chiefCenter.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>사 령 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_NPCControl.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>NPC 정책</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_genList.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>암 행 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_tournament.php' target='_blank' class='open-window <?=$btnClassForTournament??""?>'>토 너 먼 트</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myKingdomInfo.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 정보</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myCityInfo.php' class='commandButton <?=$btnClass??""?> <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?>'>세력 도시</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_nationGeneral.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 장수</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_globalDiplomacy.php' class='commandButton <?=$btnClass??""?>'>중원 정보</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_currentCity.php' class='commandButton <?=$btnClass??""?>'>현재 도시</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_inheritPoint.php' class='commandButton <?=$btnClass??""?>'>유산 관리</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myPage.php' class='commandButton <?=$btnClass??""?>'>내 정보&설정</a><?=$btnEnd??''?>
|
|
||||||
<?=$splitBtnBegin??''?>
|
|
||||||
<?=$splitMainBegin??''?><a href='v_auction.php' target='_blank' class='open-window commandButton <?=$btnClass??""?>'>경 매 장</a><?=$splitMainEnd??''?>
|
|
||||||
<?=$splitZoneSign??''?>
|
|
||||||
<?=$splitZoneBegin??''?>
|
|
||||||
<?=$splitSubBtnBegin??''?><a href='v_auction.php' target='_blank' class='open-window commandButton <?=$btnSplitClass??''?>'>금/쌀 경매장</a><?=$splitSubBtnEnd??''?>
|
|
||||||
<?=$splitSubBtnBegin??''?><a href='v_auction.php?type=unique' target='_blank' class='open-window commandButton <?=$btnSplitClass??''?>'>유니크 경매장</a><?=$splitSubBtnEnd??''?>
|
|
||||||
<?=$splitZoneEnd??''?>
|
|
||||||
<?=$splitBtnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_betting.php' target='_blank' class='open-window <?=$btnClassForBetting??""?>'>베 팅 장</a><?=$btnEnd??''?>
|
|
||||||
Reference in New Issue
Block a user