/** 
	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');
}
Exemplo n.º 2
0
    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'");
    }
Exemplo n.º 3
0
 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));
     }
     //Set up default style args
     $this->args["MARKUPNAME"] = $baseName;
     $this->args["MARKERCOLOR"] = DefaultStyle::MARKER_COLOR;
     $this->args["MARKERTYPE"] = DefaultStyle::MARKER_TYPE;
     $this->args["MARKERSIZEUNITS"] = DefaultStyle::MARKER_SIZE_UNITS;
     $this->args["MARKERSIZE"] = DefaultStyle::MARKER_SIZE;
     $this->args["LINECOLOR"] = DefaultStyle::LINE_COLOR;
     $this->args["LINEPATTERN"] = DefaultStyle::LINE_PATTERN;
     $this->args["LINESIZEUNITS"] = DefaultStyle::LINE_SIZE_UNITS;
     $this->args["LINETHICKNESS"] = DefaultStyle::LINE_THICKNESS;
     $this->args["FILLPATTERN"] = DefaultStyle::FILL_PATTERN;
     $this->args["FILLTRANSPARENCY"] = DefaultStyle::FILL_TRANSPARENCY;
     $this->args["FILLFORECOLOR"] = DefaultStyle::FILL_FORE_COLOR;
     $this->args["FILLBACKCOLOR"] = DefaultStyle::FILL_BACK_COLOR;
     $this->args["FILLBACKTRANS"] = DefaultStyle::FILL_BACK_TRANS;
     $this->args["BORDERPATTERN"] = DefaultStyle::BORDER_PATTERN;
     $this->args["BORDERSIZEUNITS"] = DefaultStyle::BORDER_SIZE_UNITS;
     $this->args["BORDERCOLOR"] = DefaultStyle::BORDER_COLOR;
     $this->args["BORDERTHICKNESS"] = DefaultStyle::BORDER_THICKNESS;
     $this->args["LABELSIZEUNITS"] = DefaultStyle::LABEL_SIZE_UNITS;
     $this->args["LABELFONTSIZE"] = DefaultStyle::LABEL_FONT_SIZE;
     //Omission is considered false, which is the default. If you ever change
     //the default style values, uncomment the matching "true" values
     //$this->args["LABELBOLD"] = DefaultStyle::LABEL_BOLD;
     //$this->args["LABELITALIC"] = DefaultStyle::LABEL_ITALIC;
     //$this->args["LABELUNDERLINE"] = DefaultStyle::LABEL_UNDERLINE;
     $this->args["LABELFORECOLOR"] = DefaultStyle::LABEL_FORE_COLOR;
     $this->args["LABELBACKCOLOR"] = DefaultStyle::LABEL_BACK_COLOR;
     $this->args["LABELBACKSTYLE"] = DefaultStyle::LABEL_BACK_STYLE;
     $markupLayerDefinition = $this->CreateMarkupLayerDefinitionContent($markupFsId->ToString(), $className);
     $layerBs = new MgByteSource($markupLayerDefinition, strlen($markupLayerDefinition));
     //Save to new resource or overwrite existing
     $resourceService->SetResource($markupLayerResId, $layerBs->GetReader(), null);
     //Add to markup registry
     $cmds = new MgFeatureCommandCollection();
     $props = new MgPropertyCollection();
     $props->Add(new MgStringProperty("ResourceId", $markupFsId->ToString()));
     $props->Add(new MgStringProperty("LayerDefinition", $markupLayerResId->ToString()));
     $props->Add(new MgStringProperty("Name", $markupLayerResId->GetName()));
     $props->Add(new MgStringProperty("FdoProvider", $fdoProvider));
     $props->Add(new MgInt32Property("GeometryTypes", $geomTypes));
     $insertCmd = new MgInsertFeatures("Default:MarkupRegistry", $props);
     $cmds->Add($insertCmd);
     $res = $featureService->UpdateFeatures($this->markupRegistryId, $cmds, false);
     MarkupManager::CleanupReaders($res);
     //Add to map
     $this->args["MARKUPLAYER"] = $markupLayerResId->ToString();
     $this->OpenMarkup();
 }
Exemplo n.º 4
0
$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;
Exemplo n.º 5
0
$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;
?>
Exemplo n.º 6
0
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;
}
Exemplo n.º 7
0
<?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");
Exemplo n.º 8
0
    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">
Exemplo n.º 9
0
    $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'));
Exemplo n.º 10
0
                            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')\">&nbsp;%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
Exemplo n.º 11
0
 $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);
Exemplo n.º 12
0
$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;
Exemplo n.º 13
0
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);
}
Exemplo n.º 14
0
$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;
/**
	@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');
    }
}
Exemplo n.º 16
0
function requestAuthentication()
{
    global $product, $locale;
    header('WWW-Authenticate: Basic realm="' . $product . '"');
    header('HTTP/1.1 401 Unauthorized');
    header('Content-Type: text/html; charset=utf-8');
    header("Status: 401 " . GetLocalizedString("ACCESSDENIED", $locale));
    echo GetLocalizedString("NEEDLOGIN", $locale);
}
Exemplo n.º 17
0
     $digitizeLocal = GetLocalizedString('REDLINEDIGITIZE', $locale );
     $pointLocal = GetLocalizedString('REDLINEOBJECTPOINT', $locale );
     $circleLocal = GetLocalizedString('REDLINEOBJECTCIRCLE', $locale );
     $lineLocal = GetLocalizedString('REDLINEOBJECTLINE', $locale );
     $lineStringLocal = GetLocalizedString('REDLINEOBJECTLINESTRING', $locale );
     $rectangleLocal = GetLocalizedString('REDLINEOBJECTRECTANGLE', $locale );
     $polygonLocal = GetLocalizedString('REDLINEOBJECTPOLYGON', $locale );
     $modifyLocal = GetLocalizedString('REDLINEMODIFY', $locale );
     $selectLocal = GetLocalizedString('REDLINESELECTOBJECT', $locale );
     $deleteLocal = GetLocalizedString('REDLINEDELETEOBJECT', $locale );
     $updateLocal = GetLocalizedString('REDLINEUPDATETEXT', $locale );
     $closeLocal = GetLocalizedString('REDLINEEDITCLOSE', $locale );
     $promptLabelLocal = GetLocalizedString('REDLINEPROMPTLABEL', $locale);
     $promptRedlineLabelsLocal = GetLocalizedString('REDLINEPROMPTFORLABELS', $locale);
     $noTextLocal = GetLocalizedString('REDLINENOTEXT', $locale);
     $multiHelpLocal = GetLocalizedString('REDLINEMULTISELECTHELP', $locale);
     
     if (array_key_exists("REDLINEPROMPT", $args) && strcmp($args["REDLINEPROMPT"], "on") == 0) {
         $checkState = " checked='checked'";
     }
 }
 catch (MgException $e)
 {
     $errorMsg = $e->GetExceptionMessage();
     $errorDetail = $e->GetDetails();
 }
 catch (Exception $e)
 {
     $errorMsg = $e->getMessage();
     $errorDetail = $e->__toString();
 }
Exemplo n.º 18
0
    $circleHelpLocal = GetLocalizedString('REDLINEEDITCIRCLEHELP', $locale);
    $addLocal = GetLocalizedString('REDLINEADD', $locale);
    $digitizeLocal = GetLocalizedString('REDLINEDIGITIZE', $locale);
    $pointLocal = GetLocalizedString('REDLINEOBJECTPOINT', $locale);
    $circleLocal = GetLocalizedString('REDLINEOBJECTCIRCLE', $locale);
    $lineLocal = GetLocalizedString('REDLINEOBJECTLINE', $locale);
    $lineStringLocal = GetLocalizedString('REDLINEOBJECTLINESTRING', $locale);
    $rectangleLocal = GetLocalizedString('REDLINEOBJECTRECTANGLE', $locale);
    $polygonLocal = GetLocalizedString('REDLINEOBJECTPOLYGON', $locale);
    $modifyLocal = GetLocalizedString('REDLINEMODIFY', $locale);
    $selectLocal = GetLocalizedString('REDLINESELECTOBJECT', $locale);
    $deleteLocal = GetLocalizedString('REDLINEDELETEOBJECT', $locale);
    $updateLocal = GetLocalizedString('REDLINEUPDATETEXT', $locale);
    $closeLocal = GetLocalizedString('REDLINEEDITCLOSE', $locale);
    $promptLabelLocal = GetLocalizedString('REDLINEPROMPTLABEL', $locale);
    $promptRedlineLabelsLocal = GetLocalizedString('REDLINEPROMPTFORLABELS', $locale);
    if (array_key_exists("REDLINEPROMPT", $args) && strcmp($args["REDLINEPROMPT"], "on") == 0) {
        $checkState = " checked='checked'";
    }
} catch (MgException $e) {
    $errorMsg = $e->GetExceptionMessage();
    $errorDetail = $e->GetDetails();
} catch (Exception $e) {
    $errorMsg = $e->getMessage();
    $errorDetail = $e->__toString();
}
?>
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<?php 
Exemplo n.º 19
0
        $query = $tokens[1];
        $baseUrl = $tokens[0];
    }
    //If there is a query component to the initial url, append it to the end of the full url string
    if (strlen($query) == 0) {
        $url = sprintf("%s?SESSION=%s&MAPNAME=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", $baseUrl, $sessionId, $mapName, urlencode($webLayoutId), $dwf, $locale);
    } else {
        $url = sprintf("%s?SESSION=%s&MAPNAME=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s&%s", $baseUrl, $sessionId, $mapName, urlencode($webLayoutId), $dwf, $locale, $query);
    }
    $templ = file_get_contents("../viewerfiles/taskframe.templ");
    print sprintf($templ, $vpath . "tasklist.php", $locale, $url);
} catch (MgException $e) {
    OnError(GetLocalizedString("TASKS", $locale), $e->GetDetails());
    return;
} catch (Exception $ne) {
    OnError(GetLocalizedString("TASKS", $locale), $ne->getMessage());
    return;
}
function GetParameters($params)
{
    global $taskPane, $sessionId, $webLayoutId, $dwf, $locale, $mapName;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $webLayoutId = ValidateResourceId(GetParameter($params, 'WEBLAYOUT'));
    $dwf = GetIntParameter($params, 'DWF');
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
}
function GetRequestParameters()
{
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
        GetParameters($_POST);
Exemplo n.º 20
0
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */
$fusionMGpath = '../../MapGuide/php/';
include $fusionMGpath . 'Common.php';
SetLocalizedFilesPath(GetLocalizationPath());
if (isset($_REQUEST['locale'])) {
    $locale = $_REQUEST['locale'];
} else {
    $locale = GetDefaultLocale();
}
$title = GetLocalizedString("MEASURETITLE", $locale);
$total = GetLocalizedString("TOTAL", $locale);
$segment = GetLocalizedString("SEGMENT", $locale);
$length = GetLocalizedString("LENGTH", $locale);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title><?php 
echo $title;
?>
</title>
    <style type="text/css" media="screen">
        @import url(Measure.css);
    </style>
</head>
Exemplo n.º 21
0
    $addEditLocal = GetLocalizedString('REDLINEEDIT', $locale);
    $removeFromMapLocal = GetLocalizedString('REDLINEREMOVEFROMMAP', $locale);
    $downloadLocal = GetLocalizedString('REDLINEDOWNLOAD', $locale);
    $downloadNativeLocal = GetLocalizedString('REDLINEDOWNLOADNATIVE', $locale);
    $uploadLocal = GetLocalizedString('REDLINEUPLOAD', $locale);
    $editStyleLocal = GetLocalizedString('REDLINEEDITSTYLE', $locale);
    $redlineCreateFailureLocal = GetLocalizedString('REDLINECREATEFAILURE', $locale);
    $redlineLayerNameLocal = GetLocalizedString('REDLINENAME', $locale);
    $newRedlineLayerLocal = GetLocalizedString("REDLINECREATENEW", $locale);
    $pointLocal = GetLocalizedString("REDLINEPOINT", $locale);
    $lineLocal = GetLocalizedString("REDLINELINE", $locale);
    $polyLocal = GetLocalizedString("REDLINEPOLY", $locale);
    $otherOptionsLocal = GetLocalizedString("REDLINEOTHEROPTIONS", $locale);
    $downloadOptionsLocal = GetLocalizedString("REDLINEDOWNLOADOPTIONS", $locale);
    $downloadKmlLocal = GetLocalizedString("REDLINEDOWNLOADKML", $locale);
    $downloadKmzLocal = GetLocalizedString("REDLINEDOWNLOADKMZ", $locale);
} catch (MgException $mge) {
    $errorMsg = $mge->GetExceptionMessage();
    $errorDetail = $mge->GetDetails();
    //die("MG ERROR: " . $errorMsg.$errorDetail."\n".$mge->GetStackTrace());
} catch (Exception $e) {
    $errorMsg = $e->GetMessage();
    //die("PHP ERROR: " . $errorMsg);
}
?>
<html>
<head>
    <title>Manage Markups</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<?php 
if ($errorMsg == null) {
Exemplo n.º 22
0
        break;
    case 2:
        $title = GetLocalizedString('MEASUREAREATITLE', $locale);
        $totalLength = '';
        $totalArea = GetLocalizedString('TOTALAREA', $locale);
        break;
    case 3:
        $title = GetLocalizedString('MEASUREBOTHTITLE', $locale);
        $totalLength = GetLocalizedString('TOTALLENGTH', $locale);
        $totalArea = GetLocalizedString('TOTALAREA', $locale);
        break;
}
$segment = GetLocalizedString("SEGMENT", $locale);
$length = GetLocalizedString("LENGTH", $locale);
$measureStop = GetLocalizedString("MEASURESTOP", $locale);
$measureStart = GetLocalizedString("MEASURESTART", $locale);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title><?php 
echo $title;
?>
</title>
    <style type="text/css" media="screen">
        @import url(Measure.css);
    </style>
    <script type="text/javascript">
Exemplo n.º 23
0
        $geomProp = new MgGeometryProperty("GEOM", $geomReader);
        $measureProps->Add($geomProp);
        $cmd = new MgInsertFeatures($featureName, $measureProps);
        $commands = new MgFeatureCommandCollection();
        $commands->Add($cmd);
        ReleaseReader($featureSrvc->UpdateFeatures($dataSourceId, $commands, false));
    }
    if ($layer != null) {
        $layer->ForceRefresh();
    }
    $map->Save($resourceSrvc);
} catch (MgException $e) {
    OnError(GetLocalizedString("MEASUREERROR", $locale), $e->GetDetails());
    return;
} catch (Exception $ne) {
    OnError(GetLocalizedString("MEASUREERROR", $locale), $ne->getMessage());
    return;
}
$templ = file_get_contents("../viewerfiles/measureui.templ");
$templ = Localize($templ, $locale, GetClientOS());
$vpath = GetSurroundVirtualPath();
print sprintf($templ, $locale, $target, $popup, $mapName, $sessionId, $total, $distance, 1, $units, $vpath . "measure.php", $vpath . "measure.php");
function OnError($title, $msg)
{
    global $target, $popup;
    $templ = Localize(file_get_contents("../viewerfiles/errorpage.templ"), $locale, GetClientOS());
    print sprintf($templ, $popup, $title, $msg);
}
function DataSourceExists($resourceSrvc, $dataSourceId)
{
    return $resourceSrvc->ResourceExists($dataSourceId);