action.index.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Ext.onReady(function() {
  2. Ext.QuickTips.init();
  3. MODx.load({
  4. xtype: 'versionx-page-index',
  5. renderTo: 'versionx'
  6. });
  7. });
  8. VersionX.page.Index = function(config) {
  9. config = config || {};
  10. config.id = config.id || 'versionx-panel-index';
  11. Ext.applyIf(config, {
  12. cls: 'container form-with-labels',
  13. components: [{
  14. xtype: 'panel',
  15. html: '<h2>'+_('versionx')+'</h2>',
  16. border: false,
  17. cls: 'modx-page-header',
  18. bodyStyle: 'margin: 20px 0 0 0;'
  19. },{
  20. xtype: 'modx-tabs',
  21. width: '98%',
  22. border: true,
  23. defaults: {
  24. border: false,
  25. autoHeight: true,
  26. cls: 'main-wrapper',
  27. defaults: {
  28. border: false
  29. }
  30. },
  31. items: [{
  32. title: _('versionx'),
  33. items: [{
  34. html: '<p>'+_('versionx.home.text')+'</p>',
  35. border: false
  36. }]
  37. },{
  38. title: _('resources'),
  39. items: [{
  40. xtype: 'versionx-panel-resources'
  41. },{
  42. html: '<hr />'
  43. },{
  44. xtype: 'versionx-grid-resources'
  45. }]
  46. },{
  47. title: _('templates'),
  48. items: [{
  49. xtype: 'versionx-panel-templates'
  50. },{
  51. html: '<hr />'
  52. },{
  53. xtype: 'versionx-grid-templates'
  54. }]
  55. },{
  56. title: _('tmplvars'),
  57. items: [{
  58. xtype: 'versionx-panel-templatevars'
  59. },{
  60. html: '<hr />'
  61. },{
  62. xtype: 'versionx-grid-templatevars'
  63. }]
  64. },{
  65. title: _('chunks'),
  66. items: [{
  67. xtype: 'versionx-panel-chunks'
  68. },{
  69. html: '<hr />'
  70. },{
  71. xtype: 'versionx-grid-chunks'
  72. }]
  73. },{
  74. title: _('snippets'),
  75. items: [{
  76. xtype: 'versionx-panel-snippets'
  77. },{
  78. html: '<hr />'
  79. },{
  80. xtype: 'versionx-grid-snippets'
  81. }]
  82. },{
  83. title: _('plugins'),
  84. items: [{
  85. xtype: 'versionx-panel-plugins'
  86. },{
  87. html: '<hr />'
  88. },{
  89. xtype: 'versionx-grid-plugins'
  90. }]
  91. }],
  92. stateful: true,
  93. stateId: config.id,
  94. stateEvents: ['tabchange'],
  95. getState: function() {
  96. return { activeTab:this.items.indexOf(this.getActiveTab()) };
  97. }
  98. }]
  99. });
  100. VersionX.page.Index.superclass.constructor.call(this,config);
  101. };
  102. Ext.extend(VersionX.page.Index,MODx.Component);
  103. Ext.reg('versionx-page-index',VersionX.page.Index);