action.chunk.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Ext.applyIf(VersionX.panel, {ChunksDetail:{}});
  2. Ext.applyIf(VersionX.grid, {ChunksDetail:{}});
  3. Ext.onReady(function() {
  4. Ext.QuickTips.init();
  5. page = MODx.load({ xtype: 'versionx-page-chunk'});
  6. page.show();
  7. });
  8. VersionX.page.Chunk = function(config) {
  9. config = config || {};
  10. var buttons = [];
  11. buttons.push({
  12. text: _('versionx.back'),
  13. handler: function () {
  14. MODx.loadPage('?namespace=versionx&a=index');
  15. }
  16. });
  17. if (MODx.request.backTo) {
  18. var back = MODx.request.backTo.split('-');
  19. buttons.push('-',{
  20. text: _('versionx.backto',{what: _('chunk')}),
  21. handler: function() {
  22. MODx.loadPage('?a='+back[0]+'&id='+back[1]);
  23. }
  24. });
  25. }
  26. Ext.applyIf(config,{
  27. renderTo: 'versionx',
  28. cls: 'container',
  29. components: [{
  30. xtype: 'panel',
  31. html: '<h2>'+_('versionx')+' '+_('versionx.chunks.detail')+'</h2>',
  32. cls: 'modx-page-header',
  33. border: false
  34. },{
  35. xtype: !VersionX.record ? 'versionx-panel-notfound' : 'versionx-panel-chunksdetail',
  36. cls: 'x-panel-body',
  37. vxRecord: VersionX.record,
  38. vxRecordCmp: VersionX.cmrecord,
  39. border: false,
  40. width: '98%'
  41. }],
  42. buttons: buttons
  43. });
  44. VersionX.page.Chunk.superclass.constructor.call(this,config);
  45. };
  46. Ext.extend(VersionX.page.Chunk,MODx.Component);
  47. Ext.reg('versionx-page-chunk',VersionX.page.Chunk);