create.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Loads the chunk create page
  3. *
  4. * @class MODx.page.CreateChunk
  5. * @extends MODx.Component
  6. * @param {Object} config An object of config properties
  7. * @xtype modx-page-chunk-create
  8. */
  9. MODx.page.CreateChunk = function(config) {
  10. config = config || {};
  11. Ext.applyIf(config,{
  12. formpanel: 'modx-panel-chunk'
  13. ,buttons: [{
  14. process: 'element/chunk/create'
  15. ,reload: true
  16. ,text: _('save')
  17. ,id: 'modx-abtn-save'
  18. ,cls: 'primary-button'
  19. ,method: 'remote'
  20. // ,checkDirty: true
  21. ,keys: [{
  22. key: MODx.config.keymap_save || 's'
  23. ,ctrl: true
  24. }]
  25. },{
  26. text: _('cancel')
  27. ,id: 'modx-abtn-cancel'
  28. },{
  29. text: _('help_ex')
  30. ,id: 'modx-abtn-help'
  31. ,handler: MODx.loadHelpPane
  32. }]
  33. ,components: [{
  34. xtype: 'modx-panel-chunk'
  35. ,renderTo: 'modx-panel-chunk-div'
  36. ,chunk: config.record.id || MODx.request.id
  37. ,record: config.record || {}
  38. }]
  39. });
  40. MODx.page.CreateChunk.superclass.constructor.call(this,config);
  41. };
  42. Ext.extend(MODx.page.CreateChunk,MODx.Component);
  43. Ext.reg('modx-page-chunk-create',MODx.page.CreateChunk);