MODx.grid.LexiconTopic=function(A){A=A||{};Ext.applyIf(A,{title:_("lexicon_topics"),id:"modx-grid-lexicon-topic",url:MODx.config.connectors_url+"workspace/lexicon/topic.php",fields:["id","name","namespace","menu"],baseParams:{action:"getList","namespace":"core"},saveParams:{"namespace":"core"},width:"97%",paging:true,autosave:true,columns:[{header:_("name"),dataIndex:"name",width:200,sortable:true},{header:_("namespace"),dataIndex:"namespace",width:500,sortable:false,editor:{xtype:"modx-combo-namespace",renderer:true}}],tbar:[{xtype:"modx-combo-namespace",name:"namespace",id:"modx-lexicon-topic-filter-namespace",itemId:"namespace",value:"core",listeners:{"change":{fn:this.filter.createDelegate(this,["namespace"],true),scope:this}}},"->",{text:_("search_by_key")},{xtype:"textfield",name:"name",id:"modx-lexicon-topic-filter-name",itemId:"name",listeners:{"change":{fn:this.filter.createDelegate(this,["name"],true),scope:this},"render":{fn:function(B){B.getEl().addKeyListener(Ext.EventObject.ENTER,function(){B.fireEvent("change");},this);}}}},{text:_("create_new"),xtype:"button",menu:[{text:_("topic"),handler:this.loadWindow2.createDelegate(this,[{xtype:"modx-window-lexicon-topic-create",listeners:{"success":{fn:function(D){var C=D.a.result.object;this.setNamespace(C["namespace"]);var B=Ext.getCmp("modx-grid-lexicon");if(B){B.setFilterParams(C["namespace"],C.id);}},scope:this}}}],true),scope:this},{text:_("namespace"),handler:this.loadWindow2.createDelegate(this,[{xtype:"modx-window-namespace-create",listeners:{"success":{fn:function(D){var C=D.a.result.object;this.setNamespace(C.name);var B=Ext.getCmp("modx-grid-lexicon");if(B){B.setFilterParams(C.name);}},scope:this}}}],true),scope:this}]}]});MODx.grid.LexiconTopic.superclass.constructor.call(this,A);};Ext.extend(MODx.grid.LexiconTopic,MODx.grid.Grid,{filter:function(A,B,D,C){if(!C){return false;}this.getStore().baseParams[C]=B;this.config.saveParams[C]=B;this.getBottomToolbar().changePage(1);this.refresh();},loadWindow2:function(A,B,C){this.menu.record={"namespace":this.getTopToolbar().getComponent("namespace").getValue()};this.loadWindow(A,B,C);},setNamespace:function(B){var A=this.getTopToolbar().getComponent("namespace");if(A){A.setValue(B);}this.config.saveParams["namespace"]=B;this.getBottomToolbar().changePage(1);this.getStore().baseParams["namespace"]=B;this.refresh();}});Ext.reg("modx-grid-lexicon-topic",MODx.grid.LexiconTopic);MODx.window.CreateLexiconTopic=function(A){A=A||{};var B=A.record;Ext.applyIf(A,{title:_("topic_create"),url:MODx.config.connectors_url+"workspace/lexicon/topic.php",action:"create",fields:[{xtype:"textfield",fieldLabel:_("name"),name:"name",id:"modx-clt-name",itemId:"name",width:250,maxLength:100},{xtype:"modx-combo-namespace",fieldLabel:_("namespace"),name:"namespace",id:"modx-clt-namespace",itemId:"namespace",value:B["namespace"]}]});MODx.window.CreateLexiconTopic.superclass.constructor.call(this,A);};Ext.extend(MODx.window.CreateLexiconTopic,MODx.Window);Ext.reg("modx-window-lexicon-topic-create",MODx.window.CreateLexiconTopic);