diff --git a/js/app/models/AliasNode.js b/js/app/models/AliasNode.js index 36de6e0..497a10d 100644 --- a/js/app/models/AliasNode.js +++ b/js/app/models/AliasNode.js @@ -17,13 +17,17 @@ Ext.define('amdaModel.AliasNode', { objectName: 'Alias', deletedAliases : null }, - + + fields: [ + {name: 'component_info', type: 'object', persist: false}, + {name: 'iconCls', type: 'string', defaultValue: 'icon-scalar', persist: false} + ], + constructor : function(config) { - this.callParent(arguments); -// if (this.get('leaf')) -// this.set('iconCls', 'icon-scalar'); - if (this.get('leaf') && (!this.get('iconCls') || this.get('iconCls') == "")) - this.set('iconCls', 'icon-scalar'); + this.callParent(arguments); + if (this.get('leaf') && + (!this.get('iconCls') || this.get('iconCls') == "")) + this.set('iconCls', 'icon-scalar'); }, allMenuItems : function() { diff --git a/js/app/models/InteractiveNode.js b/js/app/models/InteractiveNode.js index 7fc5913..f4ec568 100644 --- a/js/app/models/InteractiveNode.js +++ b/js/app/models/InteractiveNode.js @@ -22,8 +22,7 @@ Ext.define('amdaModel.InteractiveNode', { {name: 'moduleId', type: 'string', persist: false}, {name: 'filtered', type: 'boolean', defaultValue: false, persist: false}, {name: 'needsArgs', type:'boolean', defaultValue: false}, - {name: 'disable', type: 'boolean', defaultValue: false, persist: false}, - {name: 'component_info', type: 'object', persist: false} + {name: 'disable', type: 'boolean', defaultValue: false, persist: false} ], statics: { diff --git a/js/app/models/PlotObjects/PlotPanelObject.js b/js/app/models/PlotObjects/PlotPanelObject.js index de85896..659b6db 100644 --- a/js/app/models/PlotObjects/PlotPanelObject.js +++ b/js/app/models/PlotObjects/PlotPanelObject.js @@ -324,8 +324,12 @@ Ext.define('amdaPlotObj.PlotPanelObject', { recs[0].set('real-type', 1); } } + + // alias if (realparamid) { - recs[0].set('real-paramid',realparamid); // aliases + recs[0].set('real-paramid',realparamid); + var iconCls = (typeof data.iconCls !== "undefined") ? data.iconCls : null; + isVector = iconCls == 'icon-vector'; } recs[0].set('param-type', isTTCat ? 'ttcat' : 'param'); diff --git a/js/app/views/PlotComponents/PlotTree.js b/js/app/views/PlotComponents/PlotTree.js index 7d1bf8b..1a03284 100644 --- a/js/app/views/PlotComponents/PlotTree.js +++ b/js/app/views/PlotComponents/PlotTree.js @@ -707,6 +707,7 @@ Ext.define('amdaPlotComp.PlotTree', { return false; var component_info = record.get('component_info'); var components = null; + var iconCls = null; if (component_info && component_info.parentId) { //It's a component components = []; @@ -718,8 +719,10 @@ Ext.define('amdaPlotComp.PlotTree', { if (component_info.index2) components['index2'] = component_info.index2; } - - this.dropParamToCreate(targetNode, position, "#" + record.get('text'), { 'components': components, 'realparamid' : record.get('info') }); + if (record.get('iconCls')) + iconCls = record.get('iconCls'); + + this.dropParamToCreate(targetNode, position, "#" + record.get('text'), { 'components': components, 'realparamid' : record.get('info'), 'iconCls' : iconCls }); return true; case 'amdaModel.DerivedParamNode' : if (!record.get('isParameter')) diff --git a/php/classes/AliasMgr.php b/php/classes/AliasMgr.php index 6838ec7..08d790b 100644 --- a/php/classes/AliasMgr.php +++ b/php/classes/AliasMgr.php @@ -29,12 +29,13 @@ class AliasMgr extends AmdaObjectMgr { * Add Alias in Alias.xml */ protected function addAlias($obj) { + $objList = $this->contentDom->getElementById($this->contentRootId); $newObj = $this->contentDom->createElement($this->objTagName); $newObj->setAttribute('xml:id',$this->id); $obj_arr = (array)$obj; foreach ($this->attributes as $key => $value) { - if ($key == 'name') $newObj->setAttribute($key, $obj_arr[$key]); + $newObj->setAttribute($key, $obj_arr[$key]); } if (count($obj_arr['component_info']) > 0) { diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index 7b20f55..8524c2d 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -198,6 +198,9 @@ class AmdaAction if ($child->hasAttribute("parentId")) $component_info["parentId"] = $child->getAttribute("parentId"); + if ($child->hasAttribute("iconCls")) + $iconCls = $child->getAttribute("iconCls"); + if ($isLeaf) $isParameter = true; break; @@ -572,7 +575,8 @@ class AmdaAction $childrenToReturn[] = array('text' => $name, 'id' => $id, 'nodeType' => $nodeType, 'info' => $info, 'help' => $help, 'leaf' => $isLeaf, 'isParameter' => $isParameter, 'dim_1' => $dim_1, 'dim_2' => $dim_2, - "component_info" => isset($component_info) ? $component_info : NULL); + 'component_info' => isset($component_info) ? $component_info : NULL, + 'iconCls' => isset($iconCls) ? $iconCls : NULL ); } } // if $childrenToReturn we have to return [] -- libgit2 0.21.2