window.import.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ClientConfig.window.Import = function(config) {
  2. config = config || {};
  3. config.id = config.id || Ext.id(),
  4. Ext.applyIf(config,{
  5. url: ClientConfig.config.connectorUrl,
  6. autoHeight: true,
  7. fileUpload: true,
  8. modal: true,
  9. width: 450,
  10. fields: [{
  11. xtype: 'panel',
  12. cls: 'panel-desc',
  13. html: '<p>' + config.introduction + '</p>',
  14. border: false
  15. },{
  16. xtype: 'textfield',
  17. fieldLabel: _('clientconfig.import_file'),
  18. name: 'file',
  19. inputType: 'file'
  20. },{
  21. xtype: 'radiogroup',
  22. fieldLabel: _('clientconfig.import_mode'),
  23. columns: 1,
  24. items: [{
  25. boxLabel: _('clientconfig.import_mode.insert', {what: config.what}),
  26. name: 'mode',
  27. inputValue: 'insert',
  28. checked: true
  29. },{
  30. boxLabel: _('clientconfig.import_mode.overwrite', {what: config.what}),
  31. name: 'mode',
  32. inputValue: 'overwrite'
  33. },{
  34. boxLabel: _('clientconfig.import_mode.replace', {what: config.what}),
  35. name: 'mode',
  36. inputValue: 'replace'
  37. }]
  38. }],
  39. buttons: [{
  40. text: _('cancel'),
  41. scope: this,
  42. handler: function() { this.hide(); }
  43. },'-',{
  44. text: _('clientconfig.start_import'),
  45. scope: this,
  46. handler: this.submit,
  47. cls: 'primary-button'
  48. }]
  49. });
  50. ClientConfig.window.Import.superclass.constructor.call(this,config);
  51. };
  52. Ext.extend(ClientConfig.window.Import, MODx.Window);
  53. Ext.reg('clientconfig-window-import',ClientConfig.window.Import);