modx.panel.trash.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. MODx.panel.Trash = function (config) {
  2. config = config || {};
  3. var pageLayout = MODx.getPageStructure([{
  4. layout: 'form',
  5. title: _('trash.tab_title'),
  6. items: [{
  7. html: '<p>' + _('trash.intro_msg') + '</p>',
  8. xtype: 'modx-description'
  9. }, {
  10. xtype: 'modx-grid-trash',
  11. id: 'modx-trash-resources',
  12. cls: 'main-wrapper',
  13. preventRender: true
  14. }]
  15. }], {
  16. stateful: true,
  17. stateId: 'modx-trash-tabpanel',
  18. stateEvents: ['tabchange'],
  19. getState: function () {
  20. return {activeTab: this.items.indexOf(this.getActiveTab())};
  21. }
  22. }
  23. );
  24. Ext.applyIf(config, {
  25. id: 'modx-panel-trash',
  26. cls: 'container',
  27. bodyStyle: '',
  28. defaults: {collapsible: false, autoHeight: true},
  29. items: [{
  30. html: _('trash.page_title'),
  31. id: 'modx-trash-header',
  32. xtype: 'modx-header'
  33. }, pageLayout]
  34. });
  35. MODx.panel.Trash.superclass.constructor.call(this, config);
  36. this.addEvents('emptyTrash');
  37. };
  38. Ext.extend(MODx.panel.Trash, MODx.FormPanel);
  39. Ext.reg('modx-panel-trash', MODx.panel.Trash);