proper use of 'remove' and 'erase' map

- added auth level for 'erase' actions
This commit is contained in:
steeffeen
2014-07-05 12:19:38 +02:00
parent d5cfa925b2
commit 2cca641d2e
4 changed files with 69 additions and 41 deletions

View File

@ -170,7 +170,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
$pageFrame->add($mapFrame);
$mapFrame->setY($posY);
if ($index % 2 !== 0) {
if ($index % 2 === 0) {
// Striped background line
$lineQuad = new Quad_BgsPlayerCard();
$mapFrame->add($lineQuad);
@ -195,9 +195,8 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
$nameLabel->setAction($folderAction);
} else {
// File
if ($this->maniaControl->authenticationManager->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP)) {
// Add file button
// 'Add' button
$addButton = new Label_Button();
$mapFrame->add($addButton);
$addButton->setPosition($width / 2 - 9, 0, 0.2)
@ -207,8 +206,8 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
->setAction(self::ACTION_ADD_FILE);
}
if ($this->maniaControl->authenticationManager->checkPermission($player, MapManager::SETTING_PERMISSION_REMOVE_MAP)) {
// Erase file button
if ($this->maniaControl->authenticationManager->checkPermission($player, MapManager::SETTING_PERMISSION_ERASE_MAP)) {
// 'Erase' button
$eraseButton = new Label_Button();
$mapFrame->add($eraseButton);
$eraseButton->setPosition($width / 2 - 9, 0, 0.2)