performed code formatting

This commit is contained in:
Steffen Schröder
2014-08-05 02:17:41 +02:00
parent 98b5f132dc
commit 28d2c08936
66 changed files with 4054 additions and 1901 deletions

View File

@ -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);
}
}