page.js 1.2 KB

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