MODx.grid.Resolver=function(A){A=A||{};Ext.applyIf(A,{title:_("resolvers"),id:"grid-resolver",fields:["type","name","source","target"],columns:[{header:_("type"),dataIndex:"type",width:120},{header:_("name"),dataIndex:"name",width:150},{header:_("source"),dataIndex:"source",width:250},{header:_("target"),dataIndex:"target",width:250}],primaryKey:"index",tbar:[{text:_("resolver_add"),handler:{xtype:"window-resolver-create",blankValues:true}}]});MODx.grid.Resolver.superclass.constructor.call(this,A);};Ext.extend(MODx.grid.Resolver,MODx.grid.LocalGrid,{getMenu:function(){return[{text:_("resolver_remove"),handler:this.remove.createDelegate(this,[{title:_("resolver_remove"),text:_("resolver_remove_confirm")}])}];}});Ext.reg("grid-resolver",MODx.grid.Resolver);MODx.window.CreateResolver=function(A){A=A||{};Ext.applyIf(A,{title:_("resolver_create"),width:550,url:MODx.config.connectors_url+"workspace/builder/resolver.php",action:"create",fields:[{xtype:"combo",fieldLabel:_("type"),description:_("resolver_type_desc"),name:"type",hiddenName:"type",store:new Ext.data.SimpleStore({fields:["d","v"],data:[[_("file"),"file"],[_("php_script"),"php"]]}),displayField:"d",valueField:"v",mode:"local",editable:false,typeAhead:false,triggerAction:"all",value:"file"},{xtype:"textfield",fieldLabel:_("name"),description:_("resolver_name_desc"),name:"name",width:300},{xtype:"textfield",fieldLabel:_("source"),description:_("resolver_source_desc"),name:"source",width:400,allowBlank:false},{xtype:"textfield",fieldLabel:_("target"),description:_("resolver_target_desc"),name:"target",width:400,allowBlank:false,value:"return MODX_ASSETS_PATH . 'snippets/';"}]});MODx.window.CreateResolver.superclass.constructor.call(this,A);};Ext.extend(MODx.window.CreateResolver,MODx.Window,{submit:function(){var B=this.fp.getForm();if(B.isValid()){var A=new Ext.data.Record(B.getValues());Ext.getCmp("grid-resolver").getStore().add(A);this.hide();}}});Ext.reg("window-resolver-create",MODx.window.CreateResolver);