Relation selection dialog
[potlatch2.git] / net / systemeD / potlatch2 / TagViewer.mxml
index 5fc43f4a6ff6f09a79daa20136912c27929adaf9..449c05f269b893d4bcd41808aa96dad6a3d99305 100644 (file)
@@ -68,6 +68,7 @@
       import mx.core.*;
       import mx.managers.PopUpManager;
       import flash.geom.Point;
+      import flash.net.*;
       
       private var mapFeatures:MapFeatures;
       private var selectedEntity:Entity;
           popupChange.label = feature.name;
           setLimitTypes(entity);
           tw.setSelectedFeature(feature);
+          helpLabel.visible = feature.hasHelpURL();
       }
       
       private function setLimitTypes(entity:Entity):void {
           popupChange.label = "unknown";
           setLimitTypes(entity);
           tw.setSelectedFeature(null);
+          helpLabel.visible = false;
       }
 
       private function initialiseEditors():void {
                   props["id"] = rel.id;
                   var memberIndex:uint = rel.findEntityMemberIndex(entity);
                   props["role"] = rel.getMember(memberIndex).role;
-                  
-                  var desc:String = "";
-                  var relTags:Object = rel.getTagsHash();
-                  if ( relTags["type"] ) {
-                      desc = relTags["type"];
-                      if ( relTags[desc] )
-                          desc += " " + relTags[desc];
-                  }
-                  if ( relTags["ref"] )
-                      desc += " " + relTags["ref"];
-                  if ( relTags["name"] )
-                      desc += " " + relTags["name"];
-                  props["description"] = desc;
+                  props["description"] = rel.getDescription();
                   
                   relations.push(props);
               }
 
       public function openDescription():void {
           trace("open description here");
+          if ( feature != null && feature.hasHelpURL() )
+              navigateToURL(new URLRequest(feature.helpURL), "potlatch_help");
       }
 
       public function addNewTag():void {
       }
       
       public function addToRelation():void {
+          new RelationSelectPanel().init(selectedEntity);        
       }
       
       public function removeFromRelation():void {