template.js 1.0 KB

123456789101112131415161718192021222324252627282930
  1. collections.page.Template = function(config) {
  2. config = config || {};
  3. config.isUpdate = (MODx.request.id) ? true : false;
  4. Ext.applyIf(config,{
  5. formpanel: 'collections-panel-template'
  6. ,buttons: [{
  7. text: _('save')
  8. ,method: 'remote'
  9. ,process: config.isUpdate ? 'mgr/template/update' : 'mgr/template/create'
  10. ,keys: [{
  11. key: MODx.config.keymap_save || 's'
  12. ,ctrl: true
  13. }]
  14. },{
  15. text: _('cancel')
  16. ,params: {a:'home', namespace:'collections'}
  17. }]
  18. ,components: [{
  19. xtype: 'collections-panel-template'
  20. ,renderTo: 'collections-panel-template-div'
  21. ,isUpdate: config.isUpdate
  22. ,fredInstalled: !!config.fredInstalled
  23. }]
  24. });
  25. collections.page.Template.superclass.constructor.call(this,config);
  26. };
  27. Ext.extend(collections.page.Template,MODx.Component);
  28. Ext.reg('collections-page-template',collections.page.Template);