remove now unused settings related to website

There are two places where the website URL is still used:
for icons, replace the URL with a link to the icon repository
of the UI repo. The more URL now builds the link from the
server info.
This commit is contained in:
Sarah Hoffmann
2020-10-27 21:29:35 +01:00
parent d86cf6801f
commit b81894d3d5
4 changed files with 23 additions and 18 deletions

View File

@@ -252,13 +252,17 @@ function getIcon($aPlace)
*/
function getIconFile($aPlace)
{
if (CONST_MapIcon_URL === false) {
return null;
}
$sIcon = getIcon($aPlace);
if (!isset($sIcon)) {
return null;
}
return CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.p.20.png';
return CONST_MapIcon_URL.'/'.$sIcon.'.p.20.png';
}
/**

View File

@@ -713,13 +713,8 @@ class SetupFunctions
@define('CONST_BasePath', '".CONST_BasePath."');
if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SETTINGS'));
@define('CONST_Database_DSN', '".CONST_Database_DSN."'); // or add ;host=...;port=...;user=...;password=...
@define('CONST_Database_DSN', '".CONST_Database_DSN."');
@define('CONST_Default_Language', ".(CONST_Default_Language ? ("'".CONST_Default_Language."'") : 'false').");
@define('CONST_Default_Lat', ".CONST_Default_Lat.");
@define('CONST_Default_Lon', ".CONST_Default_Lon.");
@define('CONST_Default_Zoom', ".CONST_Default_Zoom.");
@define('CONST_Map_Tile_URL', '".CONST_Map_Tile_URL."');
@define('CONST_Map_Tile_Attribution', '".CONST_Map_Tile_Attribution."'); // Set if tile source isn't osm.org
@define('CONST_Log_DB', ".(CONST_Log_DB ? 'true' : 'false').");
@define('CONST_Log_File', ".(CONST_Log_File ? ("'".CONST_Log_File."'") : 'false').");
@define('CONST_Max_Word_Frequency', '".CONST_Max_Word_Frequency."');
@@ -733,7 +728,7 @@ if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SE
@define('CONST_Term_Normalization_Rules', \"".CONST_Term_Normalization_Rules."\");
@define('CONST_Use_Aux_Location_data', ".(CONST_Use_Aux_Location_data ? 'true' : 'false').");
@define('CONST_Use_US_Tiger_Data', ".(CONST_Use_US_Tiger_Data ? 'true' : 'false').");
@define('CONST_Website_BaseURL', '".CONST_Website_BaseURL."');
@define('CONST_MapIcon_URL', ".(CONST_MapIcon_URL ? ("'".CONST_MapIcon_URL."'") : 'false').");
");
info(CONST_InstallPath.'/settings/settings-frontend.php has been set up successfully');
}

View File

@@ -82,20 +82,16 @@ if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_Ins
// How long to sleep when no update could be found
@define('CONST_Replication_Recheck_Interval', '60');
// Website settings
// If true, send CORS headers to allow access
@define('CONST_NoAccessControl', true);
@define('CONST_Website_BaseURL', '/');
// Set this to the /mapicon directory of your nominatim-ui to enable returning
// icon URLs with the results.
@define('CONST_MapIcon_URL', false);
// Language to assume when none is supplied with the query.
// When set to false, the local language (i.e. the name tag without suffix)
// will be used.
@define('CONST_Default_Language', false);
// Appearance of the map in the debug interface.
@define('CONST_Default_Lat', 20.0);
@define('CONST_Default_Lon', 0.0);
@define('CONST_Default_Zoom', 2);
@define('CONST_Map_Tile_URL', 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
@define('CONST_Map_Tile_Attribution', ''); // Set if tile source isn't osm.org
@define('CONST_Search_AreaPolygons', true);
@@ -103,7 +99,7 @@ if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_Ins
@define('CONST_Search_NameOnlySearchFrequencyThreshold', 500);
// If set to true, then reverse order of queries will be tried by default.
// When set to false only selected languages alloow reverse search.
// When set to false only selected languages allow reverse search.
@define('CONST_Search_ReversePlanForAll', true);
// Maximum number of OSM ids that may be queried at once

View File

@@ -74,7 +74,17 @@ $aMoreParams['format'] = $sOutputFormat;
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$aMoreParams['accept-language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
$sMoreURL = CONST_Website_BaseURL.'search.php?'.http_build_query($aMoreParams);
if (isset($_SERVER['REQUEST_SCHEME'])
&& isset($_SERVER['SERVER_NAME'])
&& isset($_SERVER['DOCUMENT_URI'])
) {
$sMoreURL = $_SERVER['REQUEST_SCHEME'].'://'
.$_SERVER['SERVER_NAME'].$_SERVER['DOCUMENT_URI'].'/?'
.http_build_query($aMoreParams);
} else {
$sMoreURL = '/search.php'.http_build_query($aMoreParams);
}
if (CONST_Debug) exit;