create.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. MODx.page.CreateDashboardWidget = function(config) {
  2. config = config || {};
  3. Ext.applyIf(config,{
  4. formpanel: 'modx-panel-dashboard-widget'
  5. ,actions: {
  6. 'new': 'system/dashboard/widget/create'
  7. ,edit: 'system/dashboard/widget/update'
  8. ,cancel: 'system/dashboards'
  9. }
  10. ,buttons: [{
  11. process: 'system/dashboard/widget/create'
  12. ,reload: true
  13. ,text: _('save')
  14. ,id: 'modx-abtn-save'
  15. ,cls: 'primary-button'
  16. ,method: 'remote'
  17. // ,checkDirty: false
  18. ,keys: [{
  19. key: MODx.config.keymap_save || 's'
  20. ,ctrl: true
  21. }]
  22. },{
  23. text: _('cancel')
  24. ,id: 'modx-abtn-cancel'
  25. ,handler: function() {
  26. MODx.loadPage('system/dashboards');
  27. }
  28. },{
  29. text: _('help_ex')
  30. ,id: 'modx-abtn-help'
  31. ,handler: MODx.loadHelpPane
  32. }]
  33. ,components: [{
  34. xtype: 'modx-panel-dashboard-widget'
  35. ,record: config.record || {}
  36. }]
  37. });
  38. MODx.page.CreateDashboardWidget.superclass.constructor.call(this,config);
  39. };
  40. Ext.extend(MODx.page.CreateDashboardWidget,MODx.Component);
  41. Ext.reg('modx-page-dashboard-widget-create',MODx.page.CreateDashboardWidget);