[fusion-commits] r2274 - in trunk/layers: . MapServer/php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Nov 11 10:41:30 EST 2010
Author: pagameba
Date: 2010-11-11 07:41:30 -0800 (Thu, 11 Nov 2010)
New Revision: 2274
Modified:
trunk/layers/Layers.js
trunk/layers/MapServer/php/LoadMap.php
Log:
make the metadata related to editing more fine-grained so that we can differentiate between attribute and feature editing and between create/update/delete operations on the two.
Modified: trunk/layers/Layers.js
===================================================================
--- trunk/layers/Layers.js 2010-11-05 18:30:23 UTC (rev 2273)
+++ trunk/layers/Layers.js 2010-11-11 15:41:30 UTC (rev 2274)
@@ -484,7 +484,14 @@
this.expandInLegend = o.expandInLegend;
this.actuallyVisible = o.actuallyVisible;
this.statusDefault = o.statusdefault;
- this.editable = o.editable;
+ this.feature = OpenLayers.Util.extend({},o.feature);
+ this.attribute = OpenLayers.Util.extend({},o.attribute);
+ this.editable = this.feature.create ||
+ this.feature.update ||
+ this.feature.del ||
+ this.attribute.create ||
+ this.attribute.update ||
+ this.attribute.del;
this.isEditing = false;
this.visible = o.visible;
this.initiallyVisible = o.visible;
Modified: trunk/layers/MapServer/php/LoadMap.php
===================================================================
--- trunk/layers/MapServer/php/LoadMap.php 2010-11-05 18:30:23 UTC (rev 2273)
+++ trunk/layers/MapServer/php/LoadMap.php 2010-11-11 15:41:30 UTC (rev 2274)
@@ -294,9 +294,34 @@
$layerObj->visible = ($layer->status == MS_ON || $layer->status == MS_DEFAULT);
$layerObj->actuallyVisible = true;
- $editable = strtolower($layer->getMetaData('editable'));
- $layerObj->editable = $editable == 'true' ? true : false;
+ $layerObj->feature = null;
+
+ $create = strtolower($layer->getMetaData('feature_create'));
+ $layerObj->feature->create = $create == 'true' ? true : false;
+ $read = strtolower($layer->getMetaData('feature_read'));
+ $layerObj->feature->read = $read == 'true' ? true : false;
+
+ $update = strtolower($layer->getMetaData('feature_update'));
+ $layerObj->feature->update = $update == 'true' ? true : false;
+
+ $del = strtolower($layer->getMetaData('feature_delete'));
+ $layerObj->feature->del = $del == 'true' ? true : false;
+
+ $layerObj->attribute = null;
+
+ $create = strtolower($layer->getMetaData('attribute_create'));
+ $layerObj->attribute->create = $create == 'true' ? true : false;
+
+ $read = strtolower($layer->getMetaData('attribute_read'));
+ $layerObj->attribute->read = $read == 'true' ? true : false;
+
+ $update = strtolower($layer->getMetaData('attribute_update'));
+ $layerObj->attribute->update = $update == 'true' ? true : false;
+
+ $del = strtolower($layer->getMetaData('attribute_delete'));
+ $layerObj->attribute->del = $del == 'true' ? true : false;
+
/* process the classes. The legend expects things
* organized by scale range so we have to first
* find all the scale breaks, then create ranges
@@ -382,11 +407,13 @@
}
$mapObj->groups = array();
$aGroups = $oMap->getAllGroupNames();
- foreach($aGroups as $groupName) {
- $aLayerIndexes = $oMap->getLayersIndexByGroup($groupName);
- if (count($aLayerIndexes) > 0) {
- array_push($mapObj->groups, getGroupObject($oMap->getLayer($aLayerIndexes[0])));
- }
+ if (is_array($aGroups)) {
+ foreach($aGroups as $groupName) {
+ $aLayerIndexes = $oMap->getLayersIndexByGroup($groupName);
+ if (count($aLayerIndexes) > 0) {
+ array_push($mapObj->groups, getGroupObject($oMap->getLayer($aLayerIndexes[0])));
+ }
+ }
}
echo var2json($mapObj);
}
More information about the fusion-commits
mailing list