Begin of map search in map list

This commit is contained in:
Jocy 2017-04-11 15:03:45 +02:00
parent 5b87873aba
commit 750f605d96
2 changed files with 19 additions and 1 deletions

View File

@ -350,7 +350,6 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
if (strstr($actionId, self::ACTION_SHOW_AUTHOR)) { if (strstr($actionId, self::ACTION_SHOW_AUTHOR)) {
$login = str_replace(self::ACTION_SHOW_AUTHOR, '', $actionId); $login = str_replace(self::ACTION_SHOW_AUTHOR, '', $actionId);
$this->maniaControl->getMapManager()->getMapList()->playerCloseWidget($player);
$this->showMapListAuthor($login, $player); $this->showMapListAuthor($login, $player);
} }
} }

View File

@ -993,6 +993,25 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform
}); });
} }
/**
* Searches the ManiaControl maps database
*
* @param $searchString
* @return array
*/
public function searchMaps($searchString){
$result = array();
foreach($this->maps as $map){
if(strpos($map->name,$searchString) || strpos($map->authorLogin,$searchString));{
array_push($result,$map);
}
}
return $result;
}
/** /**
* Initialize necessary database tables * Initialize necessary database tables
* *