window.groups.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ClientConfig.window.Group = function(config) {
  2. config = config || {};
  3. config.id = config.id || Ext.id(),
  4. Ext.applyIf(config,{
  5. title: (config.isUpdate) ?
  6. _('clientconfig.update_group') :
  7. _('clientconfig.add_group'),
  8. autoHeight: true,
  9. url: ClientConfig.config.connectorUrl,
  10. baseParams: {
  11. action: (config.isUpdate) ?
  12. 'mgr/groups/update' :
  13. 'mgr/groups/create'
  14. },
  15. width: 500,
  16. fields: [{
  17. xtype: 'hidden',
  18. name: 'id'
  19. },{
  20. xtype: 'textfield',
  21. name: 'label',
  22. fieldLabel: _('clientconfig.label'),
  23. allowBlank: false,
  24. anchor: '100%'
  25. },{
  26. xtype: 'numberfield',
  27. name: 'sortorder',
  28. fieldLabel: _('clientconfig.sortorder'),
  29. allowBlank: false,
  30. minValue: 0,
  31. maxValue: 9999999999,
  32. anchor: '100%',
  33. value: 0
  34. },{
  35. xtype: 'textarea',
  36. name: 'description',
  37. fieldLabel: _('clientconfig.description'),
  38. anchor: '100%'
  39. }],
  40. keys: [] //prevent enter in textarea from firing submit
  41. });
  42. ClientConfig.window.Group.superclass.constructor.call(this,config);
  43. };
  44. Ext.extend(ClientConfig.window.Group,MODx.Window);
  45. Ext.reg('clientconfig-window-group',ClientConfig.window.Group);