performed code formatting
This commit is contained in:
@ -43,7 +43,8 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
|
||||
$this->maniaControl = $maniaControl;
|
||||
|
||||
// Permissions
|
||||
$this->maniaControl->getAuthenticationManager()->definePermissionLevel(self::SETTING_PERMISSION_CHANGE_VOTE_RATIOS, AuthenticationManager::AUTH_LEVEL_ADMIN);
|
||||
$this->maniaControl->getAuthenticationManager()
|
||||
->definePermissionLevel(self::SETTING_PERMISSION_CHANGE_VOTE_RATIOS, AuthenticationManager::AUTH_LEVEL_ADMIN);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -63,7 +64,8 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
|
||||
$index = 0;
|
||||
|
||||
$voteRatioCommands = $this->getVoteCommands();
|
||||
$voteRatios = $this->maniaControl->getClient()->getCallVoteRatios();
|
||||
$voteRatios = $this->maniaControl->getClient()
|
||||
->getCallVoteRatios();
|
||||
foreach ($voteRatioCommands as $voteRatioCommand => $voteRatioDescription) {
|
||||
$voteRatioFrame = new Frame();
|
||||
$frame->add($voteRatioFrame);
|
||||
@ -130,8 +132,11 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
|
||||
* @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData()
|
||||
*/
|
||||
public function saveConfigData(array $configData, Player $player) {
|
||||
if (!$this->maniaControl->getAuthenticationManager()->checkPermission($player, self::SETTING_PERMISSION_CHANGE_VOTE_RATIOS)) {
|
||||
$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
|
||||
if (!$this->maniaControl->getAuthenticationManager()
|
||||
->checkPermission($player, self::SETTING_PERMISSION_CHANGE_VOTE_RATIOS)
|
||||
) {
|
||||
$this->maniaControl->getAuthenticationManager()
|
||||
->sendNotAllowed($player);
|
||||
return;
|
||||
}
|
||||
if (!$configData[3] || strpos($configData[3][0]['Name'], self::ACTION_PREFIX_VOTE_RATIO) !== 0) {
|
||||
@ -162,15 +167,19 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
|
||||
array_push($newVoteRatios, $voteRatio);
|
||||
}
|
||||
|
||||
$success = $this->maniaControl->getClient()->setCallVoteRatios($newVoteRatios);
|
||||
$success = $this->maniaControl->getClient()
|
||||
->setCallVoteRatios($newVoteRatios);
|
||||
if ($success) {
|
||||
$this->maniaControl->getChat()->sendSuccess('Vote Ratios saved!', $player);
|
||||
$this->maniaControl->getChat()
|
||||
->sendSuccess('Vote Ratios saved!', $player);
|
||||
} else {
|
||||
$this->maniaControl->getChat()->sendError('Vote Ratios saving failed!', $player);
|
||||
$this->maniaControl->getChat()
|
||||
->sendError('Vote Ratios saving failed!', $player);
|
||||
}
|
||||
|
||||
// Reopen the Menu
|
||||
$this->maniaControl->getConfigurator()->showMenu($player, $this);
|
||||
$this->maniaControl->getConfigurator()
|
||||
->showMenu($player, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -180,6 +189,7 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
|
||||
* @param string $commandName
|
||||
*/
|
||||
private function sendInvalidValueError(Player $player, $commandName) {
|
||||
$this->maniaControl->getChat()->sendError("Invalid Value given for '{$commandName}'!", $player);
|
||||
$this->maniaControl->getChat()
|
||||
->sendError("Invalid Value given for '{$commandName}'!", $player);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user