[mapguide-commits] r5230 - trunk/MgDev/Web/src/mapviewerphp
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sat Oct 2 02:04:47 EDT 2010
Author: waltweltonlair
Date: 2010-10-02 06:04:47 +0000 (Sat, 02 Oct 2010)
New Revision: 5230
Modified:
trunk/MgDev/Web/src/mapviewerphp/buffer.php
trunk/MgDev/Web/src/mapviewerphp/common.php
trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php
trunk/MgDev/Web/src/mapviewerphp/mainframe.php
trunk/MgDev/Web/src/mapviewerphp/mapframe.php
trunk/MgDev/Web/src/mapviewerphp/measureui.php
trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php
trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php
trunk/MgDev/Web/src/mapviewerphp/selectwithin.php
trunk/MgDev/Web/src/mapviewerphp/taskframe.php
Log:
Just run my regular tab/cleanup script...
Modified: trunk/MgDev/Web/src/mapviewerphp/buffer.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/buffer.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/buffer.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -377,7 +377,7 @@
$foretrans = GetDoubleParameter($params, 'FORETRANS');
$thickness = GetDoubleParameter($params, 'THICKNESS');
$bufferName = GetParameter($params, 'BUFFER');
-
+
$layersParam = GetParameter($params, 'LAYERS');
$units = GetParameter($params, 'UNITS');
$linestyle = GetParameter($params, 'LINESTYLE');
Modified: trunk/MgDev/Web/src/mapviewerphp/common.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/common.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/common.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -252,33 +252,33 @@
function GetParameter($params, $paramName)
{
- $paramValue = "";
+ $paramValue = "";
- if(isset($params[$paramName]))
- {
- $paramValue = $params[$paramName];
- }
- return $paramValue;
+ if(isset($params[$paramName]))
+ {
+ $paramValue = $params[$paramName];
+ }
+ return $paramValue;
}
function GetIntParameter($params, $paramName)
{
- $paramValue = 0;
- if(isset($params[$paramName]) && is_numeric($params[$paramName]))
- {
- $paramValue = intval($params[$paramName]);
- }
- return $paramValue;
+ $paramValue = 0;
+ if(isset($params[$paramName]) && is_numeric($params[$paramName]))
+ {
+ $paramValue = intval($params[$paramName]);
+ }
+ return $paramValue;
}
function GetDoubleParameter($params, $paramName)
{
- $paramValue = 0.0;
- if(isset($params[$paramName]) && is_numeric($params[$paramName]))
- {
- $paramValue = doubleval($params[$paramName]);
- }
- return $paramValue;
+ $paramValue = 0.0;
+ if(isset($params[$paramName]) && is_numeric($params[$paramName]))
+ {
+ $paramValue = doubleval($params[$paramName]);
+ }
+ return $paramValue;
}
?>
Modified: trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -4,9 +4,9 @@
TODO:
-- Use the property mapping. This will have to be old-fashioned parsing the <PropertyMapping> elements
+- Use the property mapping. This will have to be old-fashioned parsing the <PropertyMapping> elements
of the layer definition. I really wanted to use MgSelection::GetSelectedFeatures(layer, class, true) but realised
-that unless the geometry is mapped, you're not going to see it in the Feature Reader (ie. No zoom point). Right now
+that unless the geometry is mapped, you're not going to see it in the Feature Reader (ie. No zoom point). Right now
it is returning all properties.
- I know of a few features in the Sheboygan Dataset that trip up the JSON response. Need to find out of addslashes() fixes this.
@@ -24,31 +24,31 @@
class SelectionSet
{
private $layers;
-
+
public function __construct()
{
$this->layers = array();
}
-
+
public function AddFeature($feat)
{
$layerName = $feat->layerName;
if(!array_key_exists($layerName, $this->layers))
$this->layers[$layerName] = array();
-
+
array_push($this->layers[$layerName], $feat);
}
-
+
public function GetLayers()
{
return array_keys($this->layers);
}
-
+
public function GetFeatures($layerName)
{
if(array_key_exists($layerName, $this->layers))
return $this->layers[$layerName];
-
+
return null;
}
}
@@ -75,27 +75,27 @@
{
public $layerName;
public $zoom;
-
+
private $properties;
-
+
public function __construct($layerName)
{
$this->layerName = $layerName;
$this->properties = array();
}
-
+
public function AddProperty($prop)
{
$this->properties[$prop->name] = $prop;
}
-
+
public function GetProperties()
{
return $this->properties;
}
}
- include 'common.php';
+ include 'common.php';
include 'constants.php';
$mapName = "";
@@ -103,17 +103,17 @@
$locale = "";
GetRequestParameters();
-
+
if (null == $locale || strlen($locale) == 0)
$locale = GetDefaultLocale();
-
+
setlocale(LC_ALL, $locale);
-
- try
- {
- InitializeWebTier();
-
- $cred = new MgUserInformation($sessionId);
+
+ try
+ {
+ InitializeWebTier();
+
+ $cred = new MgUserInformation($sessionId);
$cred->SetClientIp(GetClientIp());
$cred->SetClientAgent(GetClientAgent());
@@ -127,30 +127,30 @@
//
$map = new MgMap($site);
$map->Open($mapName);
-
- // Create the selection set
+
+ // Create the selection set
$selection = new MgSelection($map);
$selection->Open($resourceSrvc, $mapName);
-
- $layers = $selection->GetLayers();
+
+ $layers = $selection->GetLayers();
if($layers != null)
{
$nLayers = $layers->GetCount();
$agfRW = new MgAgfReaderWriter();
-
+
$selectionSet = new SelectionSet();
-
+
for ($i = 0; $i < $nLayers; $i++) {
$lyr = $layers->GetItem($i);
$layerName = $lyr->GetName();
-
+
//FB::log("Layer Name: " . $lyr->GetName());
-
+
$featResId = new MgResourceIdentifier($lyr->GetFeatureSourceId());
$class = $lyr->GetFeatureClassName();
-
+
$queryOptions = new MgFeatureQueryOptions();
-
+
$mappings = GetLayerPropertyMappings($resourceSrvc, $lyr);
//FB::log("Property Mappings for Layer: $layerName");
foreach($mappings as $name => $value) {
@@ -159,27 +159,27 @@
}
$geomName = $lyr->GetFeatureGeometryName();
$queryOptions->AddFeatureProperty($geomName);
-
+
$filter = $selection->GenerateFilter($lyr, $class);
$queryOptions->SetFilter($filter);
$fr = $lyr->SelectFeatures($queryOptions);
-
+
$clsDef = $fr->GetClassDefinition();
$props = $clsDef->GetProperties();
-
+
//FB::log("Geometry: $geomName");
-
+
while($fr->ReadNext())
{
$feat = new Feature($layerName);
$zoom = null;
-
+
for ($k = 0; $k < $props->GetCount(); $k++)
{
$prop = $props->GetItem($k);
$propName = $prop->GetName();
$propType = $fr->GetPropertyType($propName);
-
+
//We only care about mapped properties or geometry properties
if (array_key_exists($propName, $mappings) || $propType == MgPropertyType::Geometry)
{
@@ -192,11 +192,11 @@
$agf = $fr->GetGeometry($propName);
$geom = $agfRW->Read($agf);
$pt = $geom->GetCentroid()->GetCoordinate();
-
+
$zoom = new ZoomPoint();
$zoom->x = $pt->GetX();
$zoom->y = $pt->GetY();
-
+
$feat->zoom = $zoom;
//FB::log("zoom: (".$zoom->x.",".$zoom->y.")");
}
@@ -205,28 +205,28 @@
$value = GetPropertyValueFromFeatureReader($fr, $agfRW, $propType, $propName);
}
}
-
+
if (array_key_exists($propName, $mappings))
{
$fp = new FeatureProperty();
$fp->name = $mappings[$propName];
$fp->value = $value;
-
+
$feat->AddProperty($fp);
}
}
}
-
+
$c = count($feat->GetProperties());
//FB::log("Selected feature processed ($c)");
-
+
$selectionSet->AddFeature($feat);
}
$fr->Close();
}
-
+
//Now output the selection set
-
+
header("Content-Type: application/json");
header("X-JSON: true");
echo GetJson($selectionSet);
@@ -238,7 +238,7 @@
header("X-JSON: true");
echo JsonifyError($e->getMessage(), $e->getTraceAsString());
}
- catch(MgException $e)
+ catch(MgException $e)
{
header("Content-Type: application/json");
header("X-JSON: true");
@@ -249,60 +249,60 @@
{
if($selectionSet == null)
return "";
-
+
//FB::log("Processing JSON response");
/*
- A sample of the JSON output this method will produce:
-
-
- {
- "Layer1" : [
- {
- 'values' { "name" : "name1" , "value" : "value1" },
- 'zoom' : { x: num1, y: num2 }
- } ,
- ..,
- ..,
- ..,
- ],
- "Layer2" : [
- {
- 'values' { "name" : "name2" , "value" : "value2" },
- 'zoom' : { x: num1, y: num2 }
- } ,
- ..,
- ..,
- ..,
- ]
- }
- */
-
+ A sample of the JSON output this method will produce:
+
+
+ {
+ "Layer1" : [
+ {
+ 'values' { "name" : "name1" , "value" : "value1" },
+ 'zoom' : { x: num1, y: num2 }
+ } ,
+ ..,
+ ..,
+ ..,
+ ],
+ "Layer2" : [
+ {
+ 'values' { "name" : "name2" , "value" : "value2" },
+ 'zoom' : { x: num1, y: num2 }
+ } ,
+ ..,
+ ..,
+ ..,
+ ]
+ }
+ */
+
$layers = $selectionSet->GetLayers();
$totalLayers = array(); //The data portion of the JSON response
-
+
//FB::log("Layers in selection set: ".count($layers));
-
+
for ($i = 0; $i < count($layers); $i++)
- {
+ {
$layerName = $layers[$i];
-
+
$features = $selectionSet->GetFeatures($layerName);
-
+
//FB::log("Features: ".$features);
-
+
if($features != null)
{
//FB::log("Processing layer: $layerName");
-
+
$totalFeaturesOnLayer = array();
-
+
if (count($features) > 0)
{
for ($j = 0; $j < count($features); $j++)
{
$feat = $features[$j];
$featureProperties = array();
-
+
$fps = $feat->GetProperties();
foreach($fps as $fp)
{
@@ -316,18 +316,18 @@
array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : { \"x\": ".$feat->zoom->x.", \"y\": ".$feat->zoom->y." } }");
else
array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : null }");
-
+
//FB::log("Feature processed on layer: $layerName");
}
}
-
+
array_push($totalLayers, "\"$layerName\" : [" . join(", ", $totalFeaturesOnLayer) . "]");
//FB::log("Selected features on layer added to final JSON response");
}
}
-
+
//FB::log("Selection layer count: ".count($totalLayers));
-
+
$result = "{" . join(",",$totalLayers) . "}";
//return json_encode($result);
return $result;
@@ -482,4 +482,4 @@
GetParameters($_GET);
}
-?>
\ No newline at end of file
+?>
Modified: trunk/MgDev/Web/src/mapviewerphp/mainframe.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/mainframe.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/mainframe.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -581,7 +581,7 @@
global $debug, $webLayoutDefinition;
global $sessionId, $username, $password, $orgSessionId, $locale;
- $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
+ $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
$locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
$webLayoutDefinition = ValidateResourceId(GetParameter($params, 'WEBLAYOUT'));
Modified: trunk/MgDev/Web/src/mapviewerphp/mapframe.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/mapframe.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/mapframe.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -173,7 +173,7 @@
$hlTgt = ValidateHyperlinkTargetValue(GetParameter($params, 'HLTGT'));
$hlTgtName = ValidateFrameName(GetParameter($params, 'HLTGTNAME'));
$mapDefinition = ValidateResourceId(GetParameter($params, 'MAPDEFINITION'));
- $showLegend = (GetIntParameter($params, 'SHOWLEGEND') == 1);
+ $showLegend = (GetIntParameter($params, 'SHOWLEGEND') == 1);
$showProperties = (GetIntParameter($params, 'SHOWPROP') == 1);
$showSlider = (GetIntParameter($params, 'SHOWSLIDER') == 1);
$infoWidth = GetIntParameter($params, 'INFOWIDTH');
Modified: trunk/MgDev/Web/src/mapviewerphp/measureui.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/measureui.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/measureui.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -44,8 +44,8 @@
$sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
$locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
- $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
- $target = GetIntParameter($params, 'TGT');
+ $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
+ $target = GetIntParameter($params, 'TGT');
$popup = GetIntParameter($params, 'POPUP');
$cmdIndex = GetIntParameter($params, 'CMDINDEX');
$clientWidth = GetIntParameter($params, 'WIDTH');
Modified: trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -2,7 +2,7 @@
include 'common.php';
include 'constants.php';
-
+
$sessionID = "";
$mapName = "";
$rotation = 0.0;
@@ -12,12 +12,12 @@
$normalizedCapture;
$printSize;
$paperSize;
-
+
GetParameters();
GenerateMap($printSize);
?>
-<?php
+<?php
function GetParameters()
{
global $sessionID, $mapName, $printDpi, $rotation, $paperSize, $captureBox, $printSize, $scaleDenominator, $normalizedCapture;
@@ -26,8 +26,8 @@
{
$args = $_POST;
}
-
- // Not necessary to validate the parameters
+
+ // Not necessary to validate the parameters
$sessionID = $args["session_id"];
$mapName = $args["map_name"];
$rotation = floatval($args["rotation"]);
@@ -38,49 +38,49 @@
$array = explode(",", $args["paper_size"]);
$paperSize = new Size(floatval($array[0]), floatval($array[1]));
$printSize = new Size($paperSize->width / 25.4 * $printDpi, $paperSize->height / 25.4 * $printDpi);
-
+
$array = explode(",", $args["box"]);
$captureBox = CreatePolygon($array);
-
+
$array = explode(",", $args["normalized_box"]);
$normalizedCapture = CreatePolygon($array);
}
-
+
function CreatePolygon($coordinates)
{
$geometryFactory = new MgGeometryFactory();
$coordinateCollection = new MgCoordinateCollection();
$linearRingCollection = new MgLinearRingCollection();
-
+
for ($index = 0; $index < count($coordinates); ++$index)
{
$coordinate = $geometryFactory->CreateCoordinateXY(floatval($coordinates[$index]), floatval($coordinates[++$index]));
$coordinateCollection->Add($coordinate);
}
-
+
$coordinateCollection->Add($geometryFactory->CreateCoordinateXY(floatval($coordinates[0]), floatval($coordinates[1])));
-
+
$linearRingCollection = $geometryFactory->CreateLinearRing($coordinateCollection);
$captureBox = $geometryFactory->CreatePolygon($linearRingCollection, null);
-
+
return $captureBox;
}
function GenerateMap($size)
{
global $sessionID, $mapName, $captureBox, $printSize, $normalizedCapture, $rotation, $scaleDenominator, $printDpi;
-
+
$userInfo = new MgUserInformation($sessionID);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
$resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
$renderingService = $siteConnection->CreateService(MgServiceType::RenderingService);
-
+
$map = new MgMap();
$map->Open($resourceService, $mapName);
-
+
$selection = new MgSelection($map);
-
+
// Calculate the generated picture size
$envelope = $captureBox->Envelope();
$normalizedE = $normalizedCapture->Envelope();
@@ -88,7 +88,7 @@
$size2 = new Size($normalizedE->getWidth(), $normalizedE->getHeight());
$toSize = new Size($size1->width / $size2->width * $size->width, $size1->height / $size2->height * $size->height);
$center = $captureBox->GetCentroid()->GetCoordinate();
-
+
// Get the map agent url
// Get the correct http protocal
$mapAgent = "http";
@@ -98,20 +98,20 @@
}
// Get the correct port number
// Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
- // be always on the same server with map agent.
+ // be always on the same server with map agent.
$mapAgent .= "://127.0.0.1:" . $_SERVER["SERVER_PORT"];
// Get the correct virtual directory
$mapAgent .= substr($_SERVER["REQUEST_URI"], 0, strpos($_SERVER["REQUEST_URI"], "/", 1));
$mapAgent .="/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE" .
- "&SESSION=$sessionID" .
+ "&SESSION=$sessionID" .
"&MAPNAME=$mapName" .
"&FORMAT=PNG" .
"&SETVIEWCENTERX=" . $center->GetX() .
"&SETVIEWCENTERY=" . $center->GetY() .
- "&SETVIEWSCALE=$scaleDenominator" .
- "&SETDISPLAYDPI=$printDpi" .
- "&SETDISPLAYWIDTH=$toSize->width" .
- "&SETDISPLAYHEIGHT=$toSize->height" .
+ "&SETVIEWSCALE=$scaleDenominator" .
+ "&SETDISPLAYDPI=$printDpi" .
+ "&SETDISPLAYWIDTH=$toSize->width" .
+ "&SETDISPLAYHEIGHT=$toSize->height" .
"&CLIP=0";
$image = imagecreatefrompng($mapAgent);
@@ -127,15 +127,15 @@
// Draw the north arrow on the map
DrawNorthArrow($croppedImg);
- header ("Content-type: image/png");
+ header ("Content-type: image/png");
imagepng($croppedImg);
imagedestroy($croppedImg);
}
-
+
function DrawNorthArrow($map)
{
global $paperSize, $rotation;
-
+
// Load the north arrow image which has a 300 dpi resolution
$na = imagecreatefrompng("../viewerfiles/quickplotnortharrow.png");
// Rotate the north arrow according to the capture rotation
@@ -162,21 +162,21 @@
// Draw the north arrow on the map picture
imagecopyresized($map, $rotatedNa, $mapWidth - $drawWidth - $margin, $mapHeight - $drawHeight - $margin, 0, 0, $drawWidth, $drawHeight, $naWidth, $naHeight);
// Free the north arrow image
- imagedestroy($rotatedNa);
+ imagedestroy($rotatedNa);
}
?>
-<?php
+<?php
class Size
{
public $width;
public $height;
-
+
public function __construct($width, $height)
{
$this->width = $width;
$this->height = $height;
}
}
-?>
\ No newline at end of file
+?>
Modified: trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -17,20 +17,20 @@
include 'common.php';
include 'constants.php';
-
+
$locale = GetDefaultLocale();
$scaleDenominator;
$annotations;
-
+
$args = GetRequestMethod();
GetParameters($args);
$templ = file_get_contents("../viewerfiles/QuickPlotPreviewInner.templ");
SetLocalizedFilesPath(GetLocalizationPath());
-
+
// Localize the page
$templ = Localize($templ, $locale, GetClientOS());
-
+
// Set some annotation labels in the page by replacing the placeholders in the html code
$templ = str_replace(array_keys($annotations), array_values($annotations), $templ);
// Set the date annotation according to its format mask
@@ -42,7 +42,7 @@
$date = date($mask);
$templ = preg_replace($pattern, $date, $templ);
}
-
+
$jsPath = "../viewerfiles/";
print sprintf($templ, $jsPath);
?>
@@ -51,10 +51,10 @@
function GetParameters($params)
{
global $scaleDenominator, $annotations;
-
+
$scaleDenominator = intval($params["scale_denominator"]);
$annotations = array();
-
+
// The parameters whose name matches this pattern will be treated as annotation
$pattern = "/^\{field:.+\}$/i";
foreach ($params as $key => $value)
@@ -64,7 +64,7 @@
$annotations[$key] = htmlspecialchars(urlDecode($value), ENT_QUOTES);
}
}
-
+
// The scale annotation
$annotations["{scale}"] = "1 : " . $scaleDenominator;
}
Modified: trunk/MgDev/Web/src/mapviewerphp/selectwithin.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/selectwithin.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/selectwithin.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -148,8 +148,8 @@
$sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
$mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
$dwf = GetIntParameter($params, 'DWF');
-
- $inputSel = UnescapeMagicQuotes(GetParameter($params, 'SELECTION'));
+
+ $inputSel = UnescapeMagicQuotes(GetParameter($params, 'SELECTION'));
$layers = GetParameter($params, 'LAYERS');
}
Modified: trunk/MgDev/Web/src/mapviewerphp/taskframe.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/taskframe.php 2010-10-02 06:01:25 UTC (rev 5229)
+++ trunk/MgDev/Web/src/mapviewerphp/taskframe.php 2010-10-02 06:04:47 UTC (rev 5230)
@@ -30,27 +30,27 @@
try
{
- InitializeWebTier();
+ InitializeWebTier();
- $cred = new MgUserInformation($sessionId);
- $cred->SetClientIp(GetClientIp());
- $cred->SetClientAgent(GetClientAgent());
+ $cred = new MgUserInformation($sessionId);
+ $cred->SetClientIp(GetClientIp());
+ $cred->SetClientAgent(GetClientAgent());
- //Connect to the site
- $site = new MgSiteConnection();
- $site->Open($cred);
+ //Connect to the site
+ $site = new MgSiteConnection();
+ $site->Open($cred);
- //Get the MgWebLayout object
- $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
- $webLayoutResId = new MgResourceIdentifier($webLayoutId);
- $webLayout = new MgWebLayout($resourceSrvc, $webLayoutResId);
- $taskPane = $webLayout->GetTaskPane();
- $taskPaneUrl = $taskPane->GetInitialTaskUrl();
- $vpath = GetSurroundVirtualPath();
- if ($taskPaneUrl == null || strlen($taskPaneUrl) == 0)
- {
- $taskPaneUrl = "gettingstarted.php";
- }
+ //Get the MgWebLayout object
+ $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
+ $webLayoutResId = new MgResourceIdentifier($webLayoutId);
+ $webLayout = new MgWebLayout($resourceSrvc, $webLayoutResId);
+ $taskPane = $webLayout->GetTaskPane();
+ $taskPaneUrl = $taskPane->GetInitialTaskUrl();
+ $vpath = GetSurroundVirtualPath();
+ if ($taskPaneUrl == null || strlen($taskPaneUrl) == 0)
+ {
+ $taskPaneUrl = "gettingstarted.php";
+ }
//If there is an initial url, it will be encoded, so parse the decoded url.
$comp = parse_url(urldecode($taskPaneUrl));
More information about the mapguide-commits
mailing list