Skip to content

Instantly share code, notes, and snippets.

@vgrish
Created June 30, 2014 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgrish/38330952c44d6380d09f to your computer and use it in GitHub Desktop.
Save vgrish/38330952c44d6380d09f to your computer and use it in GitHub Desktop.
Crossposting.panel.Send = function(config) {
config = config || {record:{}};
config.record = config.record || {};
Ext.applyIf(config,{
//extend: MODx.panel.Resource,
baseParams: {}
,panelXType: 'crossposting-panel-send'
,border: false
//,cls: 'modx-resource-tab'
,layout: 'form'
,forceLayout: true
,deferredRender: false
,labelWidth: 200
,bodyCssClass: 'main-wrapper'
,autoHeight: true
,labelAlign: 'top'
,listeners: {
'beforeSubmit': {fn:this.beforeSubmit,scope:this}
}
,items: [
{
xtype: 'textfield'
,fieldLabel: _('resource_pagetitle')+'<span class="required">*</span>'
,description: '<b>[[*pagetitle]]</b><br />'+_('resource_pagetitle_help')
,name: 'crossposting[pagetitle]'
,id: 'crossposting-pagetitle'
,maxLength: 255
,anchor: '100%'
,allowBlank: false
,value: Ext.getCmp('modx-panel-resource').getField('pagetitle').getValue() || {}
}
,{
xtype: 'textfield'
,fieldLabel: _('resource_longtitle')
,description: '<b>[[*longtitle]]</b><br />'+_('resource_longtitle_help')
,name: 'crossposting[longtitle]'
,id: 'crossposting-longtitle'
,maxLength: 255
,anchor: '100%'
,value: Ext.getCmp('modx-panel-resource').getField('pagetitle').getValue() || {}
}
,{
xtype: 'textarea'//xtype: 'htmleditor'
,fieldLabel: _('resource_description')
,description: '<b>[[*description]]</b><br />'+_('resource_description_help')
,name: 'crossposting[content]'//'crossposting[content-text]'
,id: 'crossposting-content'
,maxLength: 255
,grow: false
,height: 200
,anchor: '100%'
,value: Ext.getCmp('modx-panel-resource').getField('content').getValue() || {}
}
/*
,{
xtype: 'hidden'
,name: 'crossposting[content]'
,id: 'crossposting-hiddenContent'
,value: Ext.getCmp('modx-panel-resource').getField('hiddenContent').getValue() || {}
}
*/
,{
xtype: 'button'
,text : 'My Button'
,id: 'crossposting-button'
}
]
});
Crossposting.panel.Send.superclass.constructor.call(this,config);
var element = Ext.get('modx-abtn-save');
element.on('click', function(e, target, options){
}, this);
};
Ext.extend(Crossposting.panel.Send,MODx.Panel,MODx.FormPanel,{
});
Ext.reg('crossposting-panel-send',Crossposting.panel.Send);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment