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

@ -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
*