MODx.panel.Namespaces=function(A){A=A||{};Ext.applyIf(A,{id:"modx-panel-namespaces",bodyStyle:"",defaults:{collapsible:false,autoHeight:true},items:[{html:"<h2>"+_("namespaces")+"</h2>",border:false,id:"modx-namespaces-header",cls:"modx-page-header"},{layout:"form",bodyStyle:"padding: 15px;",items:[{html:"<p>"+_("namespaces_desc")+"</p>",border:false},{xtype:"modx-grid-namespace",preventRender:true}]}]});MODx.panel.Namespaces.superclass.constructor.call(this,A);};Ext.extend(MODx.panel.Namespaces,MODx.FormPanel);Ext.reg("modx-panel-namespaces",MODx.panel.Namespaces);MODx.grid.Namespace=function(A){A=A||{};Ext.applyIf(A,{url:MODx.config.connectors_url+"workspace/namespace.php",fields:["id","name","path","perm"],anchor:"100%",paging:true,autosave:true,primaryKey:"name",remoteSort:true,columns:[{header:_("name"),dataIndex:"name",width:200,sortable:true},{header:_("path"),dataIndex:"path",width:500,sortable:false,editor:{xtype:"textfield"}}],tbar:[{text:_("create_new"),handler:{xtype:"modx-window-namespace-create",blankValues:true},scope:this},"->",{xtype:"textfield",name:"search",id:"modx-namespace-search",emptyText:_("search_ellipsis"),listeners:{change:{fn:this.search,scope:this},render:{fn:function(B){new Ext.KeyMap(B.getEl(),{key:Ext.EventObject.ENTER,fn:function(){this.fireEvent("change",this.getValue());this.blur();return true;},scope:B});},scope:this}}},{xtype:"button",id:"modx-filter-clear",text:_("filter_clear"),listeners:{click:{fn:this.clearFilter,scope:this}}}]});MODx.grid.Namespace.superclass.constructor.call(this,A);};Ext.extend(MODx.grid.Namespace,MODx.grid.Grid,{getMenu:function(){var B=this.getSelectionModel().getSelected();var C=B.data.perm;var A=[];if(C.indexOf("premove")!=-1){A.push({text:_("namespace_remove"),handler:this.remove.createDelegate(this,["namespace_remove_confirm"])});}return A;},search:function(D,C,B){var A=C||D;this.getStore().baseParams.search=Ext.isEmpty(A)||Ext.isObject(A)?"":A;this.getBottomToolbar().changePage(1);this.refresh();return true;},clearFilter:function(){this.getStore().baseParams={action:"getList"};Ext.getCmp("modx-namespace-search").reset();this.getBottomToolbar().changePage(1);this.refresh();}});Ext.reg("modx-grid-namespace",MODx.grid.Namespace);