MODx.panel.ResourceSchedule=function(A){A=A||{};Ext.applyIf(A,{id:"modx-panel-resource-schedule",bodyStyle:"",defaults:{collapsible:false,autoHeight:true},items:[{html:"<h2>"+_("site_schedule")+"</h2>",border:false,cls:"modx-page-header",id:"modx-resource-schedule-header"},{layout:"form",bodyStyle:"padding: 15px;",items:[{html:"<p>"+_("site_schedule_desc")+"</p>",border:false},{xtype:"modx-grid-resource-schedule",preventRender:true}]}]});MODx.panel.ResourceSchedule.superclass.constructor.call(this,A);};Ext.extend(MODx.panel.ResourceSchedule,MODx.FormPanel);Ext.reg("modx-panel-resource-schedule",MODx.panel.ResourceSchedule);MODx.grid.ResourceSchedule=function(A){A=A||{};Ext.applyIf(A,{title:_("site_schedule"),url:MODx.config.connectors_url+"resource/event.php",baseParams:{action:"getList",mode:"pub_date"},fields:["id","pagetitle","class_key",{name:"pub_date",type:"date",format:"D M d, Y"},{name:"unpub_date",type:"date",format:"D M d, Y"},"menu"],paging:true,autosave:true,columns:[{header:_("id"),dataIndex:"id",width:40},{header:_("pagetitle"),dataIndex:"pagetitle",width:40},{header:_("publish_date"),dataIndex:"pub_date",width:150,editor:{xtype:"datefield",format:MODx.config.manager_date_format}},{header:_("unpublish_date"),dataIndex:"unpub_date",width:150,editor:{xtype:"datefield",format:MODx.config.manager_date_format}}],tbar:[{text:_("showing_pub"),scope:this,handler:this.toggle,enableToggle:true,tooltip:_("click_to_change"),id:"btn-toggle"}]});MODx.grid.ResourceSchedule.superclass.constructor.call(this,A);};Ext.extend(MODx.grid.ResourceSchedule,MODx.grid.Grid,{toggle:function(A,C){var B=this.getStore();if(A.pressed){B.setBaseParam("mode","unpub_date");A.setText(_("showing_unpub"));}else{B.setBaseParam("mode","pub_date");A.setText(_("showing_pub"));}this.getBottomToolbar().changePage(1);B.removeAll();this.refresh();}});Ext.reg("modx-grid-resource-schedule",MODx.grid.ResourceSchedule);