encapsulate icon URL in a function

This commit is contained in:
Sarah Hoffmann
2020-05-17 16:45:46 +02:00
parent 859347523f
commit 3a2ddbe2e0
5 changed files with 24 additions and 8 deletions

View File

@@ -236,6 +236,20 @@ function getIcon($aPlace)
return $aIcons[$sClassPlace] ?? null;
}
/**
* Get an icon for the given object with its full URL.
*/
function getIconFile($aPlace)
{
$sIcon = getIcon($aPlace);
if (!isset($sIcon)) {
return null;
}
return CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.p.20.png';
}
/**
* Return a class importance value for the given place.
*