[fusion-commits] r1973 - trunk/widgets/Theme/classes
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Nov 12 21:39:27 EST 2009
Author: christinebao
Date: 2009-11-12 21:39:23 -0500 (Thu, 12 Nov 2009)
New Revision: 1973
Modified:
trunk/widgets/Theme/classes/theme.php
Log:
Fix ticket http://trac.osgeo.org/fusion/ticket/324.
Theme widget doesn't work because layer definition schema definition.
Modified: trunk/widgets/Theme/classes/theme.php
===================================================================
--- trunk/widgets/Theme/classes/theme.php 2009-11-11 20:47:47 UTC (rev 1972)
+++ trunk/widgets/Theme/classes/theme.php 2009-11-13 02:39:23 UTC (rev 1973)
@@ -231,7 +231,7 @@
$vectorScaleRangecElement = $nodeList->item($this->args['SCALERANGEINDEX']);
$areaTypeStyle = $vectorScaleRangecElement->getElementsByTagName('AreaTypeStyle')->item(0);
-
+
// Remove any existing <AreaRule> elements.
$areaRuleList = $areaTypeStyle->getElementsByTagName('AreaRule');
@@ -241,6 +241,11 @@
$areaTypeStyle->removeChild($areaRuleList->item(0));
}
+ $hasChild = $areaTypeStyle->hasChildNodes();
+ if($hasChild)
+ {
+ $element = $areaTypeStyle->childNodes->item(0);
+ }
// Now create the new <AreaRule> elements.
@@ -255,7 +260,7 @@
$aggregateOptions->AddFeatureProperty($this->args['PROPERTYNAME']);
$aggregateOptions->SelectDistinct(true);
- $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
+ $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
while ($dataReader->ReadNext())
{
$value = $this->GetFeaturePropertyValue($dataReader, $this->args['PROPERTYNAME']);
@@ -274,7 +279,14 @@
$areaDoc = DOMDocument::loadXML($areaRuleXML);
$areaNode = $doc->importNode($areaDoc->documentElement, true);
- $areaTypeStyle->appendChild($areaNode);
+ if($hasChild)
+ {
+ $areaTypeStyle->insertBefore($areaNode, $element);
+ }
+ else
+ {
+ $areaTypeStyle->appendChild($areaNode);
+ }
$portion += $increment;
}
@@ -311,7 +323,14 @@
$areaDoc = DOMDocument::loadXML($areaRuleXML);
$areaNode = $doc->importNode($areaDoc->documentElement, true);
- $areaTypeStyle->appendChild($areaNode);
+ if($hasChild)
+ {
+ $areaTypeStyle->insertBefore($areaNode, $element);
+ }
+ else
+ {
+ $areaTypeStyle->appendChild($areaNode);
+ }
$portion += $increment;
}
More information about the fusion-commits
mailing list