MODx.grid.Context=function(A){A=A||{};Ext.applyIf(A,{title:_("contexts"),url:MODx.config.connectors_url+"context/index.php",fields:["key","description","menu"],paging:true,autosave:true,remoteSort:true,primaryKey:"key",columns:[{header:_("context_key"),dataIndex:"key",width:150,sortable:true},{header:_("description"),dataIndex:"description",width:575,sortable:false,editor:{xtype:"textfield"}}],tbar:[{text:_("create_new"),handler:{xtype:"modx-window-context-create",blankValues:true}}]});MODx.grid.Context.superclass.constructor.call(this,A);};Ext.extend(MODx.grid.Context,MODx.grid.Grid,{update:function(B,A){location.href="index.php?a="+MODx.action["context/update"]+"&key="+this.menu.record.key;}});Ext.reg("modx-grid-contexts",MODx.grid.Context);MODx.window.CreateContext=function(A){A=A||{};Ext.applyIf(A,{title:_("context_create"),url:MODx.config.connectors_url+"context/index.php",action:"create",fields:[{xtype:"textfield",fieldLabel:_("context_key"),name:"key",anchor:"90%",maxLength:100},{xtype:"textarea",fieldLabel:_("description"),name:"description",anchor:"90%",grow:true}]});MODx.window.CreateContext.superclass.constructor.call(this,A);};Ext.extend(MODx.window.CreateContext,MODx.Window);Ext.reg("modx-window-context-create",MODx.window.CreateContext);MODx.panel.Contexts=function(A){A=A||{};Ext.applyIf(A,{id:"modx-panel-contexts",bodyStyle:"",defaults:{collapsible:false,autoHeight:true},items:[{html:"<h2>"+_("contexts")+"</h2>",border:false,id:"modx-contexts-header",cls:"modx-page-header"},{layout:"form",bodyStyle:"padding: 15px",items:[{html:"<p>"+_("context_management_message")+"</p>",border:false},{xtype:"modx-grid-contexts",preventRender:true}]}]});MODx.panel.Contexts.superclass.constructor.call(this,A);};Ext.extend(MODx.panel.Contexts,MODx.FormPanel);Ext.reg("modx-panel-contexts",MODx.panel.Contexts);