From a948dd57c1705f402c24443e444654a8cff6211e Mon Sep 17 00:00:00 2001 From: steeffeen Date: Sun, 29 Jun 2014 23:51:01 +0200 Subject: [PATCH] created directory browser class --- application/core/Maps/DirectoryBrowser.php | 42 ++++++++++++++++++++++ application/core/Maps/MapManager.php | 14 ++++---- 2 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 application/core/Maps/DirectoryBrowser.php diff --git a/application/core/Maps/DirectoryBrowser.php b/application/core/Maps/DirectoryBrowser.php new file mode 100644 index 00000000..12f53d0c --- /dev/null +++ b/application/core/Maps/DirectoryBrowser.php @@ -0,0 +1,42 @@ + + * @copyright 2014 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class DirectoryBrowser { + /* + * Private properties + */ + private $maniaControl = null; + + /** + * Create a new Directory Browser Instance + * + * @param ManiaControl $maniaControl + */ + public function __construct(ManiaControl $maniaControl) { + $this->maniaControl = $maniaControl; + } + + /** + * Build and show the Browser ManiaLink to the given Player + * + * @param Player $player + */ + public function showManiaLink(Player $player) { + $maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID); + + $this->maniaControl->manialinkManager->sendManialink($maniaLink, $player); + } +} diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 7bbb83dc..ceb927e4 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -58,6 +58,7 @@ class MapManager implements CallbackListener { public $mapQueue = null; public $mapCommands = null; public $mapList = null; + public $directoryBrowser = null; public $mxList = null; public $mxManager = null; public $mapActions = null; @@ -82,12 +83,13 @@ class MapManager implements CallbackListener { $this->initTables(); // Create map commands instance - $this->mxManager = new ManiaExchangeManager($this->maniaControl); - $this->mapList = new MapList($this->maniaControl); - $this->mxList = new ManiaExchangeList($this->maniaControl); - $this->mapCommands = new MapCommands($maniaControl); - $this->mapQueue = new MapQueue($this->maniaControl); - $this->mapActions = new MapActions($maniaControl); + $this->mxManager = new ManiaExchangeManager($this->maniaControl); + $this->mapList = new MapList($this->maniaControl); + $this->directoryBrowser = new DirectoryBrowser($this->maniaControl); + $this->mxList = new ManiaExchangeList($this->maniaControl); + $this->mapCommands = new MapCommands($maniaControl); + $this->mapQueue = new MapQueue($this->maniaControl); + $this->mapActions = new MapActions($maniaControl); // Register for callbacks $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');