ml manager small improve

This commit is contained in:
kremsy 2014-01-16 20:58:39 +01:00 committed by Steffen Schröder
parent b2491ac829
commit 5852e57392

View File

@ -199,11 +199,13 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
} }
/** /**
* Closes the Manialink Widget and enables the Alt Menu * Closes a Manialink Widget
* *
* @param Player $player * @param Player $player
* @param bool $widgetId
*/ */
public function closeWidget(Player $player) { public function closeWidget(Player $player, $widgetId = false) {
if(!$widgetId) {
$emptyManialink = new ManiaLink(self::MAIN_MLID); $emptyManialink = new ManiaLink(self::MAIN_MLID);
$manialinkText = $emptyManialink->render()->saveXML(); $manialinkText = $emptyManialink->render()->saveXML();
$this->maniaControl->manialinkManager->sendManialink($manialinkText, $player->login); $this->maniaControl->manialinkManager->sendManialink($manialinkText, $player->login);
@ -211,6 +213,11 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
// Trigger callback // Trigger callback
$this->maniaControl->callbackManager->triggerCallback(self::CB_MAIN_WINDOW_CLOSED, array(self::CB_MAIN_WINDOW_CLOSED, $player)); $this->maniaControl->callbackManager->triggerCallback(self::CB_MAIN_WINDOW_CLOSED, array(self::CB_MAIN_WINDOW_CLOSED, $player));
} else {
$emptyManialink = new ManiaLink($widgetId);
$manialinkText = $emptyManialink->render()->saveXML();
$this->maniaControl->manialinkManager->sendManialink($manialinkText, $player->login);
}
} }
/** /**