本文整理汇总了PHP中GetLocalizedString函数的典型用法代码示例。如果您正苦于以下问题:PHP GetLocalizedString函数的具体用法?PHP GetLocalizedString怎么用?PHP GetLocalizedString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetLocalizedString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DoSetup
/**
Run the actual setup process
*/
function DoSetup()
{
$lock_file_name = '../data/setup.lock';
//Check if the lock file already exists
if (!file_exists($lock_file_name)) {
echo GetLocalizedString('setup-creating-lock') . "\n";
//Warn if ignore_setup_lock is enabled
if (ReadConfigInt('ignore_setup_lock', '0')) {
echo GetLocalizedString('setup-lock-pointless') . "\n";
}
//Create the lock file
touch($lock_file_name);
} else {
//Ignore the lock file and blow away the db
if (ReadConfigInt('ignore_setup_lock', '0')) {
echo GetLocalizedString('setup-trampling') . "\n";
} else {
die(GetLocalizedString('setup-already-run')) . "\n";
}
}
//If we get to this point the lock either doesn't exist or has been ignored. Start the setup process.
//Run the setup queries
global $g_dbconn;
if (!$g_dbconn->multi_query(file_get_contents('../setup/setup.sql'))) {
die(DatabaseError());
}
while ($g_dbconn->more_results()) {
if (!$g_dbconn->next_result()) {
die(DatabaseError());
}
}
echo GetLocalizedString('setup-done');
}
示例2: __construct
function __construct($args)
{
$this->args = $args;
$this->site = new MgSiteConnection();
$this->site->Open(new MgUserInformation($args['SESSION']));
SetLocalizedFilesPath(GetLocalizationPath());
if(isset($_REQUEST['LOCALE'])) {
$locale = $_REQUEST['LOCALE'];
} else {
$locale = GetDefaultLocale();
}
$equalToLocal = GetLocalizedString('QUERYEQUALTO', $locale );
$notEqualToLocal = GetLocalizedString('QUERYNOTEQUALTO', $locale );
$greatThanLocal = GetLocalizedString('QUERYGREATTHAN', $locale );
$greatThanEqualLocal = GetLocalizedString('QUERYGREATTHANEQUAL', $locale );
$lessThanLocal = GetLocalizedString('QUERYLESSTHAN', $locale );
$lessThanEqualLocal = GetLocalizedString('QUERYLESSTHANEQUAL', $locale );
$beginLocal = GetLocalizedString('QUERYBEGIN', $locale );
$containsLocal = GetLocalizedString('QUERYCONTAINS', $locale );
$this->numOperators = array($equalToLocal, $notEqualToLocal, $greatThanLocal, $greatThanEqualLocal, $lessThanLocal, $lessThanEqualLocal);
$this->numExpressions = array(' = %s', ' != %s', ' > %s', ' >= %s', ' < %s', ' <= %s');
$this->strOperators = array($beginLocal, $containsLocal, $equalToLocal);
$this->strExpressions = array(" like '%s%%'", " like '%%%s%%'", " = '%s'");
}
示例3: UploadMarkup
function UploadMarkup()
{
$locale = "en";
if (array_key_exists("LOCALE", $this->args)) {
$locale = $this->args["LOCALE"];
}
$uploadFileParts = pathinfo($_FILES["UPLOADFILE"]["name"]);
$fdoProvider = $this->GetProviderFromExtension($uploadFileParts["extension"]);
if ($fdoProvider == null) {
throw new Exception(GetLocalizedString("REDLINEUPLOADUNKNOWNPROVIDER", $locale));
}
$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
$featureService = $this->site->CreateService(MgServiceType::FeatureService);
$bs = new MgByteSource($_FILES["UPLOADFILE"]["tmp_name"]);
$br = $bs->GetReader();
//Use file name to drive all parameters
$baseName = $uploadFileParts["filename"];
$this->UniqueMarkupName($baseName);
//Guard against potential duplicates
$ext = $uploadFileParts["extension"];
$markupLayerResId = new MgResourceIdentifier($this->GetResourceIdPrefix() . $baseName . ".LayerDefinition");
$markupFsId = new MgResourceIdentifier($this->GetResourceIdPrefix() . $baseName . '.FeatureSource');
//Set up feature source document
$dataName = $baseName . "." . $ext;
$fileParam = "File";
$shpFileParts = array();
if (strcmp($fdoProvider, "OSGeo.SHP") == 0) {
$dataName = null;
$fileParam = "DefaultFileLocation";
$zip = new ZipArchive();
if ($zip->open($_FILES["UPLOADFILE"]["tmp_name"]) === TRUE) {
for ($i = 0; $i < $zip->numFiles; $i++) {
$stat = $zip->statIndex($i);
$filePath = tempnam(sys_get_temp_dir(), "upload");
//Dump to temp file
file_put_contents($filePath, $zip->getFromIndex($i));
//Stash for later upload and cleanup
$entry = $stat["name"];
$shpFileParts[$entry] = $filePath;
if (substr($entry, strlen($entry) - strlen(".shp")) == ".shp") {
$dataName = $entry;
}
}
//Abort if we can't find a .shp file. This is not a valid zip file
if ($dataName == null) {
throw new Exception(GetLocalizedString("REDLINEUPLOADSHPZIPERROR", $locale));
}
} else {
throw new Exception(GetLocalizedString("REDLINEUPLOADSHPZIPERROR", $locale));
}
}
$extraXml = "";
if (strcmp($fdoProvider, "OSGeo.SDF") == 0) {
//Need to set ReadOnly = false for SDF
$extraXml = "<Parameter><Name>ReadOnly</Name><Value>FALSE</Value></Parameter>";
}
$fsXml = sprintf(file_get_contents("templates/markupfeaturesource.xml"), $fdoProvider, $fileParam, $dataName, $extraXml);
$bs2 = new MgByteSource($fsXml, strlen($fsXml));
$resourceService->SetResource($markupFsId, $bs2->GetReader(), null);
if (count($shpFileParts) > 0) {
foreach ($shpFileParts as $name => $path) {
$bs3 = new MgByteSource($path);
$resourceService->SetResourceData($markupFsId, $name, "File", $bs3->GetReader());
//Cleanup
unlink($path);
}
} else {
//Not a SHP file
$resourceService->SetResourceData($markupFsId, $dataName, "File", $bs->GetReader());
}
//Query the geometry types
$schemas = $featureService->DescribeSchema($markupFsId, "", null);
$schema = $schemas->GetItem(0);
$classes = $schema->GetClasses();
$klass = $classes->GetItem(0);
$geomProp = $klass->GetDefaultGeometryPropertyName();
$clsProps = $klass->GetProperties();
$className = $schema->GetName() . ":" . $klass->GetName();
$geomTypes = -1;
if ($clsProps->IndexOf($geomProp) >= 0) {
$geom = $clsProps->GetItem($geomProp);
$geomTypes = $geom->GetGeometryTypes();
//Since we're here. Validate the schema requirements. If this was created by this widget previously
//it will be valid
$idProps = $klass->GetIdentityProperties();
if ($idProps->GetCount() != 1) {
throw new Exception(GetLocalizedString("REDLINEUPLOADINVALIDSCHEMA", $locale));
} else {
//Must be auto-generated (implying numerical as well)
$keyProp = $idProps->GetItem(0);
if (!$keyProp->IsAutoGenerated()) {
throw new Exception(GetLocalizedString("REDLINEUPLOADINVALIDSCHEMA", $locale));
}
}
if ($clsProps->IndexOf("Text") < 0) {
throw new Exception(GetLocalizedString("REDLINEUPLOADINVALIDSCHEMA", $locale));
}
} else {
throw new Exception(GetLocalizedString("REDLINEUPLOADINVALIDSCHEMA", $locale));
}
//.........这里部分代码省略.........
示例4: GetLocalizedString
$fillTransparencyLocal = GetLocalizedString('REDLINEFILLTRANSPARENCY', $locale);
$foregroundLocal = GetLocalizedString('REDLINEFOREGROUND', $locale);
$backgroundLocal = GetLocalizedString('REDLINEBACKGROUND', $locale);
$borderPatternLocal = GetLocalizedString('REDLINEBORDERPATTERN', $locale);
$borderColorLocal = GetLocalizedString('REDLINEBORDERCOLOR', $locale);
$labelStyleLocal = GetLocalizedString('REDLINELABELSTYLE', $locale);
$labelSizeUnitsLocal = GetLocalizedString('REDLINELABELSIZEUNITS', $locale);
$borderThicknessLocal = GetLocalizedString('REDLINEBORDERTHICKNESS', $locale);
$fontSizeLocal = GetLocalizedString('REDLINELABELFONTSIZE', $locale);
$boldLocal = GetLocalizedString('REDLINEFONTBOLD', $locale);
$italicLocal = GetLocalizedString('REDLINEFONTITALIC', $locale);
$underlineLocal = GetLocalizedString('REDLINEFONTUNDERLINE', $locale);
$labelColorLocal = GetLocalizedString('REDLINELABELCOLOR', $locale);
$labelBackgroundStyleLocal = GetLocalizedString('REDLINELABELBACKGROUNDSTYLE', $locale);
$ghostedLocal = GetLocalizedString('REDLINELABELGHOSTED', $locale);
$opaqueLocal = GetLocalizedString('REDLINELABELOPAQUE', $locale);
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>New Markup Layer</title>
<link rel="stylesheet" href="Redline.css" type="text/css">
<script language="javascript">
var SET_MARKER_COLOR = 1;
var SET_LINE_COLOR = 2;
var SET_FILL_FORE_COLOR = 3;
var SET_FILL_BACK_COLOR = 4;
var SET_BORDER_COLOR = 5;
var SET_LABEL_FORE_COLOR = 6;
var SET_LABEL_BACK_COLOR = 7;
var setColor = 0;
示例5: GetLocalizedString
$rectangleLocal = GetLocalizedString('FEATUREINFORECTANGLE', $locale);
$polygonLocal = GetLocalizedString('FEATUREINFOPOLYGON', $locale);
$totalLocal = GetLocalizedString('FEATUREINFOTOTAL', $locale);
$noSelectedLocal = GetLocalizedString('FEATUREINFONOSELECTED', $locale);
$errorLocal = GetLocalizedString('FEATUREINFOERROR', $locale);
$fetchInfoLocal = GetLocalizedString('FEATUREINFOFETCHINFO', $locale);
$featureSelLocal = GetLocalizedString('FEATUREINFOFEATURESEL', $locale);
$areaLocal = GetLocalizedString('FEATUREINFOAREA', $locale);
$areaUndefinedLocal = GetLocalizedString('FEATUREINFOAREAUNDEFINE', $locale);
$noLayerInfoLocal = GetLocalizedString('FEATUREINFONOINFO', $locale);
$noFeatureInLocal = GetLocalizedString('FEATUREINFONOFEATUREIN', $locale);
$featureInfoExtraHelpLocal = GetLocalizedString('FEATUREINFOEXTRAHELP', $locale);
$drawPointLocal = GetLocalizedString("REDLINEEDITPOINTHELP", $locale);
$drawRectLocal = GetLocalizedString("REDLINEEDITRECTANGLEHELP", $locale);
$drawPolyLocal = GetLocalizedString("REDLINEEDITPOLYGONHELP", $locale);
$refreshLocal = GetLocalizedString("FEATUREINFOREFRESH", $locale);
try {
$featureInfo = new FeatureInfo($args);
$layerNames = $featureInfo->GetMapLayerNames();
} catch (MgException $mge) {
$errorMsg = $mge->GetExceptionMessage();
$errorDetail = $mge->GetDetails();
} catch (Exception $e) {
$errorMsg = $e->GetMessage();
}
?>
<html>
<head>
<title><?php
echo $titleLocal;
?>
示例6: GetDecimalFromLocalizedString
function GetDecimalFromLocalizedString($numberString, $locale)
{
if ($locale != null && $numberString != null) {
// Remove thousand separators
$thousandSeparator = GetLocalizedString("THOUSANDSEPARATOR", $locale);
if ($thousandSeparator != null && strlen($thousandSeparator) > 0) {
$numberString = str_replace($thousandSeparator, "", $numberString);
}
// Replace localized decimal separators with "."
$decimalSeparator = GetLocalizedString("DECIMALSEPARATOR", $locale);
if ($decimalSeparator != null && strlen($decimalSeparator) > 0 && $decimalSeparator != ".") {
$numberString = str_replace($decimalSeparator, ".", $numberString);
}
}
return $numberString;
}
示例7: DisplayInitializationErrorHTML
<?php
$fusionMGpath = '../../layers/MapGuide/php/';
include $fusionMGpath . 'Common.php';
if (InitializationErrorOccurred())
{
DisplayInitializationErrorHTML();
exit;
}
SetLocalizedFilesPath(GetLocalizationPath());
if (isset($_REQUEST['locale'])) {
$locale = $_REQUEST['locale'];
} else {
$locale = GetDefaultLocale();
}
$title = GetLocalizedString("COORDINATETRACKERTITLE", $locale);
?>
<html>
<head>
<title><?= $title ?></title>
<link rel="stylesheet" href="CoordinateTracker.css" />
<script type="text/javascript">
var bReady = false;
var oWidget = null;
function setWidget(widget) {
oWidget = widget;
var listEl = document.getElementById("ProjectionsList");
for (var code in oWidget.projections) {
var el = document.createElement("li");
示例8: SetLocalizedFilesPath
SetLocalizedFilesPath(GetLocalizationPath());
if(isset($_REQUEST['LOCALE'])) {
$locale = $_REQUEST['LOCALE'];
} else {
$locale = GetDefaultLocale();
}
try
{
$uploadTitleLocal = GetLocalizedString('REDLINEUPLOAD', $locale );
$uploadFileLocal = GetLocalizedString('REDLINEDATAFILE', $locale );
$uploadNoteLocal = GetLocalizedString('REDLINEUPLOADNOTE', $locale );
$uploadLocal = GetLocalizedString('REDLINEUPLOADTEXT', $locale );
$uploadFileRequiredLocal = GetLocalizedString('REDLINEUPLOADREQUIRED', $locale);
$closeLocal = GetLocalizedString('REDLINEUPLOADCLOSE', $locale );
}
catch (MgException $e)
{
$errorMsg = $e->GetMessage();
$errorDetail = $e->GetDetails();
}
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title><?=$uploadTitleLocal?></title>
<link rel="stylesheet" href="Redline.css" type="text/css">
<script language="javascript" src="../../layers/MapGuide/MapGuideViewerApi.js"></script>
<script language="javascript" src="../../common/browserdetect.js"></script>
<script language="javascript">
示例9: GetLocalizedString
$msg = $createdUpdatedStr . "<p><p>" . $featuresStr;
//add warning message, if necessary
if ($excludedLayers > 0) {
$warningFmt = $excludedLayers > 1 ? GetLocalizedString("BUFFERREPORTWARNINGPLURAL", $locale) : GetLocalizedString("BUFFERREPORTWARNINGSINGULAR", $locale);
$warningStr = sprintf($warningFmt, $excludedLayers);
$msg = $msg . "<p><p>" . $warningStr;
}
// return the report page
$templ = file_get_contents("../viewerfiles/bufferreport.templ");
$templ = Localize($templ, $locale, GetClientOS());
print sprintf($templ, $popup, $title, $msg);
} catch (MgException $e) {
OnError(GetLocalizedString("BUFFERREPORTERRORTITLE", $locale), $e->GetDetails());
return;
} catch (Exception $ne) {
OnError(GetLocalizedString("BUFFERREPORTERRORTITLE", $locale), $ne->getMessage());
return;
}
function OnError($title, $msg)
{
global $target, $popup;
$templ = Localize(file_get_contents("../viewerfiles/errorpage.templ"), $locale, GetClientOS());
print sprintf($templ, $popup, $title, $msg);
}
function GetParameters()
{
global $params, $selText, $locale;
global $mapName, $sessionId, $bufferName, $lcolor, $ffcolor, $fbcolor, $layersParam, $popup;
global $transparent, $distance, $units, $linestyle, $fillstyle, $thickness, $merge, $foretrans;
$sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
$locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
示例10: SearchError
break;
default:
throw new SearchError(FormatMessage("SEARCHTYYPENOTSUP", $locale, array($idPropType)), $searchError);
}
}
$sel->AddFeatureIds($layer, $featureClassName, $idProps);
$selText = EscapeForHtml($sel->ToXml(), true);
echo sprintf("<td class=\"%s\" id=\"%d:%d\" onmousemove=\"SelectRow(%d)\" onclick=\"CellClicked('%s')\"> %s</td>\n", !($row % 2) ? "Search" : "Search2", $row, $i, $row, $selText, $val);
}
echo "</tr>";
if (++$row == $matchLimit) {
break;
}
} while ($features->ReadNext());
} else {
throw new SearchError(GetLocalizedString("SEARCHNOMATCHES", $locale), GetLocalizedString("SEARCHREPORT", $locale));
}
} catch (MgException $ae) {
if ($features) {
// Close the feature reader
$features->Close();
}
OnError($searchError, $ae->GetDetails());
} catch (SearchError $e) {
if ($features) {
// Close the feature reader
$features->Close();
}
OnError($e->title, $e->getMessage());
}
//terminate the html document
示例11: MgSelection
$map->Create($resourceSrvc, $resId, $mapName);
//create an empty selection object and store it in the session repository
$sel = new MgSelection($map);
$sel->Save($resourceSrvc, $mapName);
//get the map extent and calculate the scale factor
//
$mapExtent = $map->GetMapExtent();
$srs = $map->GetMapSRS();
if ($srs != "") {
$csFactory = new MgCoordinateSystemFactory();
$cs = $csFactory->Create($srs);
$metersPerUnit = $cs->ConvertCoordinateSystemUnitsToMeters(1.0);
$unitsType = $cs->GetUnits();
} else {
$metersPerUnit = 1.0;
$unitsType = GetLocalizedString("DISTANCEMETERS", $locale);
}
$llExtent = $mapExtent->GetLowerLeftCoordinate();
$urExtent = $mapExtent->GetUpperRightCoordinate();
$bgColor = $map->GetBackgroundColor();
if (strlen($bgColor) == 8) {
$bgColor = '#' . substr($bgColor, 2);
} else {
$bgColor = "white";
}
$scaleCreationCode = "";
$scales = array();
for ($i = 0; $i < $map->GetFiniteDisplayScaleCount(); $i++) {
$scales[$i] = $map->GetFiniteDisplayScaleAt($i);
}
sort($scales);
示例12: GetLocalizedString
$distributionLocal = GetLocalizedString('THEMEDISTRIBUTION', $locale);
$ruleLocal = GetLocalizedString('THEMERULE', $locale);
$scaleRangeLocal = GetLocalizedString('THEMESCALERANGE', $locale);
$styleRampLocal = GetLocalizedString('THEMESTYLERAMP', $locale);
$fillTransparencyLocal = GetLocalizedString('THEMEFILLTRANS', $locale);
$fillColorLocal = GetLocalizedString('THEMEFILLCOLOR', $locale);
$fromLocal = GetLocalizedString('THEMEFROM', $locale);
$toLocal = GetLocalizedString('THEMETO', $locale);
$borderColorLocal = GetLocalizedString('THEMEBORDERCOLOR', $locale);
$applyLocal = GetLocalizedString('THEMEAPPLY', $locale);
$errorLocal = GetLocalizedString('THEMEERROR', $locale);
$individualLocal = GetLocalizedString('THEMEINDIVIDUAL', $locale);
$equalLocal = GetLocalizedString('THEMEEQUAL', $locale);
$standardDeviationLocal = GetLocalizedString('THEMESTANDARD', $locale);
$quantileLocal = GetLocalizedString('THEMEQUANTILE', $locale);
$jenksLocal = GetLocalizedString('THEMEJENKS', $locale);
try {
//MgInitializeWebTier($configFilePath);
$theme = new Theme($args);
$layerNames = $theme->GetMapLayerNames();
} catch (MgException $mge) {
$errorMsg = $mge->GetExceptionMessage();
$errorDetail = $mge->GetDetails();
} catch (Exception $e) {
$errorMsg = $e->GetMessage();
}
?>
<html>
<head>
<title><?php
echo $titleLocal;
示例13: OnError
function OnError($title, $msg)
{
global $target, $popup, $mapName, $locale;
$ok = GetLocalizedString("BUTTONOK", $locale);
$cancel = GetLocalizedString("BUTTONCANCEL", $locale);
$templ = file_get_contents("./ErrorPage.templ");
print sprintf($templ, $popup, $mapName, $title, $msg, $ok, $cancel);
}
示例14: GetLocalizedString
$spatialFilterLocal = GetLocalizedString('QUERYSPATIALFILTER', $locale);
$digitizeLocal = GetLocalizedString('QUERYDIGITIZE', $locale);
$rectangleLocal = GetLocalizedString('QUERYRECTANGLE', $locale);
$polygonLocal = GetLocalizedString('QUERYPOLYGON', $locale);
$clearLocal = GetLocalizedString('QUERYCLEAR', $locale);
$outputLocal = GetLocalizedString('QUERYOUTPUT', $locale);
$outputPropertyLocal = GetLocalizedString('QUERYOUTPUTPROPERTY', $locale);
$executeLocal = GetLocalizedString('QUERYEXECUTE', $locale);
$maxResultLocal = GetLocalizedString('QUERYMAXRESULT', $locale);
$resultsLocal = GetLocalizedString('QUERYRESULTS', $locale);
$scaleLocal = GetLocalizedString('QUERYSCALE', $locale);
$zoomLocal = GetLocalizedString('QUERYZOOM', $locale);
$selectLocal = GetLocalizedString('QUERYSELECT', $locale);
$errorLocal = GetLocalizedString('QUERYERROR', $locale);
$rectangleHelpLocal = GetLocalizedString('REDLINEEDITRECTANGLEHELP', $locale);
$polygonHelpLocal = GetLocalizedString('REDLINEEDITPOLYGONHELP', $locale);
try {
// MgInitializeWebTier($configFilePath);
$query = new Query($args);
$layerNames = $query->GetMapLayerNames();
} catch (MgException $mge) {
$errorMsg = $mge->GetExceptionMessage();
$errorDetail = $mge->GetDetails();
} catch (Exception $e) {
$errorMsg = $e->GetMessage();
}
?>
<html>
<head>
<title><?php
echo $titleLocal;
示例15: DatabaseError
/**
@brief Returns a database error string
*/
function DatabaseError()
{
global $g_dbconn;
if (ReadConfigInt('verbose_db_errors', 0)) {
if ($g_dbconn->connect_error) {
return GetLocalizedString('database-error') . $g_dbconn->connect_error;
} else {
return GetLocalizedString('database-error') . $g_dbconn->error;
}
} else {
return GetLocalizedString('generic-error');
}
}