page.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. fred.page.ElementOptionSet = function (config) {
  2. config = config || {};
  3. config.isUpdate = (MODx.request.id) ? true : false;
  4. Ext.applyIf(config, {
  5. formpanel: 'fred-panel-element-option-set',
  6. buttons: [
  7. {
  8. text: _('save'),
  9. method: 'remote',
  10. process: config.isUpdate ? 'mgr/element_option_sets/update' : 'mgr/element_option_sets/create',
  11. keys: [
  12. {
  13. key: MODx.config.keymap_save || 's',
  14. ctrl: true
  15. }
  16. ]
  17. },
  18. {
  19. text: _('cancel'),
  20. params: {
  21. a: 'home',
  22. namespace: 'fred'
  23. }
  24. }
  25. ],
  26. components: [
  27. {
  28. xtype: 'fred-panel-element-option-set',
  29. isUpdate: config.isUpdate,
  30. }
  31. ]
  32. });
  33. fred.page.ElementOptionSet.superclass.constructor.call(this, config);
  34. };
  35. Ext.extend(fred.page.ElementOptionSet, MODx.Component);
  36. Ext.reg('fred-page-element-option-set', fred.page.ElementOptionSet);