admin.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ClientConfig.page.Admin = function(config) {
  2. config = config || {};
  3. Ext.applyIf(config,{
  4. renderTo: 'clientconfig-wrapper-div',
  5. border: false,
  6. components: [{
  7. cls: 'container form-with-labels',
  8. xtype: 'panel',
  9. items: [{
  10. xtype: 'panel',
  11. html: '<h2>' + _('clientconfig.adminpanel') + '</h2>',
  12. border: false,
  13. cls: 'modx-page-header'
  14. }, {
  15. xtype: 'modx-tabs',
  16. width: '98%',
  17. border: true,
  18. defaults: {
  19. border: false,
  20. autoHeight: true,
  21. defaults: {
  22. border: false
  23. }
  24. },
  25. items: [{
  26. title: _('clientconfig.settings'),
  27. cls: 'main-wrapper',
  28. items: [{
  29. xtype: 'clientconfig-grid-settings'
  30. }]
  31. }, {
  32. title: _('clientconfig.groups'),
  33. cls: 'main-wrapper',
  34. items: [{
  35. xtype: 'clientconfig-grid-groups'
  36. }]
  37. }],
  38. stateful: true,
  39. stateId: 'clientconfig-page-admin',
  40. stateEvents: ['tabchange'],
  41. getState: function () {
  42. return {
  43. activeTab: this.items.indexOf(this.getActiveTab())
  44. };
  45. }
  46. }]
  47. }],
  48. buttons: [{
  49. text: _('clientconfig.to_client_view'),
  50. handler: this.toClientView,
  51. scope: this
  52. },'-',{
  53. text: _('help_ex'),
  54. handler: MODx.loadHelpPane,
  55. scope: this
  56. }]
  57. });
  58. ClientConfig.page.Admin.superclass.constructor.call(this,config);
  59. };
  60. Ext.extend(ClientConfig.page.Admin,MODx.Component,{
  61. toClientView: function() {
  62. MODx.loadPage('?a=home&namespace=clientconfig');
  63. }
  64. });
  65. Ext.reg('clientconfig-page-admin',ClientConfig.page.Admin);