modx.panel.resource.symlink.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * @class MODx.panel.SymLink
  3. * @extends MODx.FormPanel
  4. * @param {Object} config An object of configuration properties
  5. * @xtype modx-panel-symlink
  6. */
  7. MODx.panel.SymLink = function(config) {
  8. config = config || {};
  9. var it = [];
  10. it.push({
  11. title: _('createedit_symlink')
  12. ,id: 'modx-resource-settings'
  13. ,layout: 'form'
  14. ,labelWidth: 200
  15. ,bodyStyle: 'padding: 15px;'
  16. ,autoHeight: true
  17. ,defaults: { border: false ,msgTarget: 'side' ,width: 400 }
  18. ,items: this.getFields(config)
  19. });
  20. Ext.applyIf(config,{
  21. id: 'modx-panel-resource'
  22. ,class_key: 'modSymLink'
  23. ,items: this.getFields(config)
  24. });
  25. MODx.panel.SymLink.superclass.constructor.call(this,config);
  26. };
  27. Ext.extend(MODx.panel.SymLink,MODx.panel.Resource,{
  28. defaultClassKey: 'modSymLink'
  29. ,classLexiconKey: 'symlink'
  30. ,rteElements: false
  31. ,getPageHeader: function(config) {
  32. return {
  33. html: _('symlink_new')
  34. ,id: 'modx-resource-header'
  35. ,xtype: 'modx-header'
  36. };
  37. }
  38. ,getMainFields: function(config) {
  39. var its = MODx.panel.SymLink.superclass.getMainFields.call(this,config);
  40. its.push({
  41. xtype: 'textfield'
  42. ,fieldLabel: _('symlink')
  43. ,description: '<b>[[*content]]</b><br />'+_('symlink_help')
  44. ,name: 'content'
  45. ,id: 'modx-symlink-content'
  46. ,maxLength: 255
  47. ,anchor: '100%'
  48. ,value: (config.record.content || config.record.ta) || ''
  49. });
  50. return its;
  51. }
  52. ,getContentField: function(config) {
  53. return null;
  54. }
  55. });
  56. Ext.reg('modx-panel-symlink',MODx.panel.SymLink);